From 6b6ed6d5b791701e47d34ff18236dcd539b020d1 Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Mon, 17 Jun 2024 16:14:06 +0300 Subject: [PATCH] =?utf8?q?=D0=9F=D0=B5=D1=80=D0=B5=D0=BF=D0=B8=D1=81=D1=8B?= =?utf8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20/shipment/config,=20/shipment/c?= =?utf8?q?onfig-sort,=20/shipment/fields,=20/shipment/statuses-edit?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/ShipmentController.php | 4 +++ erp24/modul/shipment/config.php | 37 ++++++++++------------ erp24/modul/shipment/config_sort.php | 33 ++++++++++--------- erp24/modul/shipment/fields.php | 22 +++++-------- erp24/modul/shipment/functionsShipment.php | 4 +-- erp24/modul/shipment/shipment.php | 4 +-- erp24/modul/shipment/statuses_edit.php | 25 +++++++-------- erp24/views/shipment/config-sort.php | 5 +++ erp24/views/shipment/config.php | 5 +++ erp24/views/shipment/fields.php | 5 +++ erp24/views/shipment/statuses-edit.php | 5 +++ 11 files changed, 79 insertions(+), 70 deletions(-) create mode 100644 erp24/views/shipment/config-sort.php create mode 100644 erp24/views/shipment/config.php create mode 100644 erp24/views/shipment/fields.php create mode 100644 erp24/views/shipment/statuses-edit.php diff --git a/erp24/controllers/ShipmentController.php b/erp24/controllers/ShipmentController.php index b4998cee..71a529b9 100755 --- a/erp24/controllers/ShipmentController.php +++ b/erp24/controllers/ShipmentController.php @@ -33,4 +33,8 @@ class ShipmentController extends Controller public function actionAjaxUpdateStoreZakup() { return $this->renderPartial('ajax-update-store-zakup'); } public function actionAjaxUpdateStep() { return $this->renderPartial('ajax-update-step'); } public function actionStatusFieldsSort() { return $this->render('status-fields-sort'); } + public function actionConfig() { return $this->render('config'); } + public function actionConfigSort() { return $this->render('config-sort'); } + public function actionFields() { return $this->render('fields'); } + public function actionStatusesEdit() { return $this->render('statuses-edit'); } } \ No newline at end of file diff --git a/erp24/modul/shipment/config.php b/erp24/modul/shipment/config.php index f7dcce46..40de0e5f 100644 --- a/erp24/modul/shipment/config.php +++ b/erp24/modul/shipment/config.php @@ -1,10 +1,8 @@ -2) exit("У вас нет дступа"); @@ -64,7 +62,7 @@ if(!empty($_POST[$id22][$row["id"]][$id2])) { - $db::sql("UPDATE store_orders_fields SET dostup=? WHERE id=? LIMIT 1",[json_encode($dsp,JSON_UNESCAPED_UNICODE), $row["id"] ]); + $db::sql("UPDATE store_orders_fields SET dostup=? WHERE id=?",[json_encode($dsp,JSON_UNESCAPED_UNICODE), $row["id"] ]); @@ -117,7 +115,7 @@ $status_json=array(); } } } - $db::sql("UPDATE store_orders_statuses SET dostup=?,groups=?, stores_show=? WHERE id=? LIMIT 1",[json_encode($status_json,JSON_UNESCAPED_UNICODE), $groups_sql, $stores_show, $status_id ]); + $db::sql("UPDATE store_orders_statuses SET dostup=?,groups=?, stores_show=? WHERE id=?",[json_encode($status_json,JSON_UNESCAPED_UNICODE), $groups_sql, $stores_show, $status_id ]); //echo"
$status_id $status_json"; @@ -154,19 +152,19 @@ if(!empty($_REQUEST["status_id"])) $statusId=(int)$_REQUEST["status_id"]; foreach($store_orders_statuses as $status_id => $status) { - echo'
- - '; + echo''; + echo ''; + echo ''; $status_id=intval($status_id); echo"
+ $status
- сортировка столбцов + сортировка столбцов
$status) $fields_hide=$fieldHide[$status_id]=$fields_hide; if(!empty($fieldSort[$status_id])) $sort=$fieldSort[$status_id]; -$data=$db::getRows("SELECT * FROM store_orders_fields $sort"); +$data=$db::getRows("SELECT * FROM store_orders_fields "); // $sort ; TODO: переписать $sort на postgresql foreach($statuses_groups[$status_id] as $gid) { @@ -235,13 +233,13 @@ foreach($fields_n as $id22 => $arrr2) { echo''; if(isset($arrr2["array"])) { - $value_def=$statuses_dostup[$status_id][$gid][$row["id"]][$id22]; + $value_def=$statuses_dostup[$status_id][$gid][$row["id"]][$id22] ?? 0; //'.$value_def.' echo'
'; +echo '
'; @@ -76,7 +74,7 @@ $fields .="$v"; $i++; } -$db::sql("INSERT IGNORE INTO store_orders_fields_sort SET group_id=?, fields_sort=? ON DUPLICATE KEY UPDATE fields_sort=?",[$id, $fields,$fields]); +$db::sql("INSERT INTO store_orders_fields_sort (group_id, fields_sort) VALUES (?, ?) ON CONFLICT (group_id) DO UPDATE SET fields_sort=?",[$id, $fields,$fields]); @@ -92,8 +90,9 @@ $sort=$db::getValue("SELECT fields_sort FROM store_orders_fields_sort WHERE grou -if(!empty($sort)) $data3=$db::getRows("SELECT * FROM store_orders_fields ORDER BY FIELD(`id`, $sort) "); -else $data3=$data; +//if(!empty($sort)) $data3=$db::getRows("SELECT * FROM store_orders_fields ORDER BY FIELD(`id`, $sort) "); +//else +$data3=$data; foreach($data3 as $row) { @@ -235,7 +234,7 @@ $(document).ready(function () { '; -include"templates/bottom.php"; +include_once dirname(__DIR__, 2) . '/templates/bottom_light.php'; diff --git a/erp24/modul/shipment/fields.php b/erp24/modul/shipment/fields.php index 3ded713b..c470854d 100644 --- a/erp24/modul/shipment/fields.php +++ b/erp24/modul/shipment/fields.php @@ -1,10 +1,8 @@ -2) exit("У вас нет доступа"); @@ -24,7 +22,7 @@ $db::sql("UPDATE store_orders_fields SET description=? WHERE id=?",[$val,$idr]); } -$data=$db::getRows("SELECT id, dostup FROM `store_orders_statuses` WHERE 1"); +$data=$db::getRows("SELECT id, dostup FROM store_orders_statuses WHERE 1 = 1"); foreach($data as $row) { $dostup[$row["id"]] = json_decode($row["dostup"], true); @@ -32,7 +30,7 @@ $dostup[$row["id"]] = json_decode($row["dostup"], true); echo''; - +echo ''; $data=$db::getRows("SELECT * FROM store_orders_fields"); echo'
@@ -90,9 +88,5 @@ echo'
название кратко