From 98196e32a3cff4ea560303f5d9276b830de029e5 Mon Sep 17 00:00:00 2001 From: Spitzer_Daniel Date: Thu, 6 Apr 2023 17:55:33 +0200 Subject: [PATCH 01/18] Filestore Beta --- Layout/default/Filestore/Form.php | 48 +++++++- Layout/default/Filestore/Index.php | 112 ++++++++++++++++-- application/Filestore/FilestoreController.php | 74 +++++++++--- application/Filestore/FilestoreModel.php | 5 +- .../FilestoreHistoryModel.php | 20 ++++ 5 files changed, 226 insertions(+), 33 deletions(-) diff --git a/Layout/default/Filestore/Form.php b/Layout/default/Filestore/Form.php index 3293e4f32..cca8082c7 100644 --- a/Layout/default/Filestore/Form.php +++ b/Layout/default/Filestore/Form.php @@ -8,7 +8,7 @@ - +

Datei

@@ -16,6 +16,16 @@ +permissions->isAdmin) { + foreach ($networkaddresses as $networkaddress) { + if ($me->address->id == $networkaddress->address_id) { + $allowedNetworks[$networkaddress->network_id] = "ok"; + } + } +} + +?>
@@ -23,18 +33,50 @@

id) ? "Datei bearbeiten" : "Neue Datei" ?>

-
">
+
- + + + + name ?> + +
+
+
+ +
+ + + $network): + if (($file->network_id == $network->id)) : + $networkName = $network->name; + endif; + endforeach; + ?> + +
diff --git a/Layout/default/Filestore/Index.php b/Layout/default/Filestore/Index.php index 36395207d..b6afd6abf 100644 --- a/Layout/default/Filestore/Index.php +++ b/Layout/default/Filestore/Index.php @@ -1,5 +1,5 @@ - +
@@ -33,17 +33,25 @@
- - + + permissions->isAdmin) { + foreach ($networkaddresses as $networkaddress) { + if ($me->address->id == $networkaddress->address_id) { + $allowedNetworks[$networkaddress->network_id] = "ok"; + } + } + } + ?> - + - + @@ -54,16 +62,42 @@ - + permissions->isAdmin) { + if (!array_key_exists($file->networkid, $allowedNetworks)) { + continue; + } + } + ?> + - + + + creator->name + ?> + create) + ?> @@ -72,7 +106,6 @@
Name BeschreibungErstellerNetzgebiet Bearbeiter
name ?> description ?>creator->name ?> (create) ?>)network ?> editor->name ?> (edit) ?>) - $file->file_id, 's' => $pagination['start']])?>"> - $file->id, 's' => $pagination['start']])?>"> - $file->id, 's' => $pagination['start']])?>" onclick="if(!confirm('Person/Firma wirklich löschen?')) return false;" class="text-danger" title="Löschen"> + $file->file_id]) ?>"> + $file->id, "mode" => "add-version"]) ?>"> + + + $file->id]) ?>"> + + permissions->isAdmin || $me->id == $file->edit_by) : ?> + $file->id]) ?>" + onclick="if(!confirm('Datei wirklich löschen?')) return false;" + class="text-danger" title="Löschen"> +
-
@@ -81,13 +114,66 @@ - + diff --git a/application/Filestore/FilestoreController.php b/application/Filestore/FilestoreController.php index ba33a710f..9f0401545 100644 --- a/application/Filestore/FilestoreController.php +++ b/application/Filestore/FilestoreController.php @@ -19,26 +19,20 @@ class FilestoreController extends mfBaseController { $this->layout()->setTemplate("Filestore/Index"); $files = FilestoreModel::getAll(); + $networkaddress = NetworkAddressModel::getAll(); - - // pagination defaults - $pagination = []; - $pagination['start'] = 0; - $pagination['count'] = 25; - $pagination['maxItems'] = 0; - if(is_numeric($this->request->s)) { - $pagination['start'] = intval($this->request->s); - } - $pagination['maxItems'] = FilestoreModel::count(); $this->layout()->set("files", $files); - $this->layout()->set("pagination", $pagination); + $this->layout()->set("networkaddresses", $networkaddress); + } protected function addAction() { + $this->layout()->set("networks", NetworkModel::getAll()); + $this->layout()->set("networkaddresses", NetworkAddressModel::getAll()); $this->layout()->setTemplate("Filestore/Form"); } @@ -46,9 +40,12 @@ class FilestoreController extends mfBaseController { $r = $this->request; $id = $r->id; + $editmode=$r->mode; + //var_dump($r->get());exit; if (is_numeric($id) && $id > 0) { $mode = "edit"; + $filestore = new Filestore($id); if (!$filestore->id) { $this->layout()->setFlash("Datei nicht gefunden", "error"); @@ -59,17 +56,23 @@ class FilestoreController extends mfBaseController $dataHistory['name'] = $filestore->name; $dataHistory['description'] = $filestore->description; $dataHistory['file_id'] = $filestore->file_id; + $dataHistory['network_id'] = $filestore->network_id; $dataHistory['filestore_id'] = $filestore->id; $dataHistory['create'] = $filestore->create; $dataHistory['create_by'] = $filestore->create_by; - $dataHistory['edit'] = date("U"); + $dataHistory['edit_by'] = $filestore->edit_by; +// $dataHistory['edit'] = date("U"); + $dataHistory['edit'] = $filestore->edit; + } else { $mode = "add"; } $data = []; $data['name'] = trim($r->name); + $data['network_id'] = trim($r->network_id); $data['description'] = trim($r->description); + $data['edit_by'] = trim($this->me->id); if (!$data['name']) { $this->layout()->setFlash("Name darf nicht leer sein", "error"); @@ -114,7 +117,6 @@ class FilestoreController extends mfBaseController $data['file_id'] = $file_id; if ($mode == "edit") { - $fsh = FilestoreHistoryModel::create($dataHistory); } } else { @@ -141,7 +143,7 @@ class FilestoreController extends mfBaseController $id = $filestore->save(); if (!$id) { - $this->layout()->setFlash("Dateiupload fehlgeschlagen33", "error"); + $this->layout()->setFlash("Dateiupload fehlgeschlagen", "error"); $this->redirect("Filestore"); } if ($fsh) { @@ -155,19 +157,28 @@ class FilestoreController extends mfBaseController { $r = $this->request; $id = $r->id; - //var_dump($r->get());exit; + if ($r->mode) { + $mode = $r->mode; + } else { + $mode = ""; + } if (!is_numeric($id) && $id < 1) { $this->layout()->setFlash("Datei nicht gefunden", "error"); $this->redirect("Filestore"); } - $filestore = new Filestore($id); + $filestore = new Filestore($id); + $filestorehistory = new FilestoreHistory($id); if (!$filestore->id) { $this->layout()->setFlash("Datei nicht gefunden", "error"); $this->redirect("Filestore"); } + if ($mode) { + $this->layout()->set("mode", $mode); + } + $this->layout()->set("filestorehistory", $filestorehistory); $this->layout()->set("file", $filestore); return $this->addAction(); @@ -194,4 +205,35 @@ class FilestoreController extends mfBaseController $filstore->delete(); $this->redirect("Filestore"); } + + protected function apiAction() + { + if (!$this->me->is(["Admin", "netowner", "pipeplanner", "lineplanner", "pipeworker", "netoperator", "lineworker"])) { + $this->redirect("Dashboard"); + } + $id = $this->request->id; + + $filestorehistory = FilestoreHistoryModel::getAllhistory($id); + $counter = 0; + foreach ($filestorehistory as $history) { + $data[$counter]['id'] = $history->id; + $data[$counter]['file_id'] = $history->data->file_id; + $data[$counter]['name'] = $history->data->name; + $data[$counter]['description'] = $history->data->description; + $data[$counter]['workername'] = $history->data->workername; + $data[$counter]['workerid'] = $history->data->workerid; + $data[$counter]['edit'] = $history->edit; + if (trim($this->me->id) == $history->data->workerid) { + $data[$counter]['is_delete'] = 1; + } else { + $data[$counter]['is_delete'] = 0; + } + + + $counter++; + } + echo json_encode($data); + exit; + + } } \ No newline at end of file diff --git a/application/Filestore/FilestoreModel.php b/application/Filestore/FilestoreModel.php index f11111366..a9ad20eef 100644 --- a/application/Filestore/FilestoreModel.php +++ b/application/Filestore/FilestoreModel.php @@ -4,6 +4,7 @@ class FilestoreModel { public $order_id; public $file_id; + public $network_id; public $name; public $description; @@ -54,11 +55,13 @@ class FilestoreModel public static function getAll() { + $items = []; $db = FronkDB::singleton(); - $sql = "SELECT Filestore.* FROM Filestore + $sql = "SELECT Filestore.*,Network.name network,Network.id networkid FROM Filestore LEFT JOIN File ON (Filestore.file_id = File.id) + LEFT JOIN Network ON (Filestore.network_id = Network.id) ORDER BY name"; $res = $db->query($sql); if ($db->num_rows($res)) { diff --git a/application/FilestoreHistory/FilestoreHistoryModel.php b/application/FilestoreHistory/FilestoreHistoryModel.php index 3faae0e21..0800185c0 100644 --- a/application/FilestoreHistory/FilestoreHistoryModel.php +++ b/application/FilestoreHistory/FilestoreHistoryModel.php @@ -70,6 +70,26 @@ class FilestoreHistoryModel } + public static function getAllhistory($id) + { + $items = []; + + $db = FronkDB::singleton(); + $sql = "SELECT FilestoreHistory.*,Worker.name workername,Worker.id workerid FROM FilestoreHistory + LEFT JOIN File ON (FilestoreHistory.file_id = File.id) + INNER JOIN Worker ON (FilestoreHistory.edit_by=Worker.id) + WHERE `filestore_id` ='" . $id . "' + ORDER BY edit DESC"; + $res = $db->query($sql); + if ($db->num_rows($res)) { + while ($data = $db->fetch_object($res)) { + $items[] = new FilestoreHistory($data); + } + } + return $items; + + } + public static function getFirst() { $db = FronkDB::singleton(); From 39087dc16c12c584908c62ce0510eb29d778576e Mon Sep 17 00:00:00 2001 From: Spitzer_Daniel Date: Wed, 22 Mar 2023 16:24:42 +0100 Subject: [PATCH 02/18] Remerge --- application/Device/Device.php | 1 - application/Device/DeviceController.php | 1 - application/Device/DeviceModel.php | 1 - 3 files changed, 3 deletions(-) diff --git a/application/Device/Device.php b/application/Device/Device.php index 178f165fc..4abccfb32 100644 --- a/application/Device/Device.php +++ b/application/Device/Device.php @@ -1,5 +1,4 @@ Date: Wed, 22 Mar 2023 16:27:00 +0100 Subject: [PATCH 03/18] Remerge --- application/Device/Device.php | 1 - application/Device/DeviceController.php | 1 - application/Device/DeviceModel.php | 1 - 3 files changed, 3 deletions(-) diff --git a/application/Device/Device.php b/application/Device/Device.php index 4abccfb32..43aa1e620 100644 --- a/application/Device/Device.php +++ b/application/Device/Device.php @@ -34,7 +34,6 @@ class Device extends mfBaseModel return null; } } - return $this->$name; } } \ No newline at end of file diff --git a/application/Device/DeviceController.php b/application/Device/DeviceController.php index 18929ec5b..a7116fc84 100644 --- a/application/Device/DeviceController.php +++ b/application/Device/DeviceController.php @@ -1,7 +1,6 @@ needlogin = true; diff --git a/application/Device/DeviceModel.php b/application/Device/DeviceModel.php index 0e2e72c4a..8591a2db4 100644 --- a/application/Device/DeviceModel.php +++ b/application/Device/DeviceModel.php @@ -22,7 +22,6 @@ class DeviceModel public static function find($data) { - } public static function create(array $data) From 657c7ea3c046ebb200b4f872d39ed3b5e6772fcd Mon Sep 17 00:00:00 2001 From: Spitzer_Daniel Date: Wed, 22 Mar 2023 16:56:02 +0100 Subject: [PATCH 04/18] Remerge --- application/Device/Device.php | 2 ++ application/Device/DeviceController.php | 2 ++ application/Device/DeviceModel.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/application/Device/Device.php b/application/Device/Device.php index 43aa1e620..178f165fc 100644 --- a/application/Device/Device.php +++ b/application/Device/Device.php @@ -1,4 +1,5 @@ $name; } } \ No newline at end of file diff --git a/application/Device/DeviceController.php b/application/Device/DeviceController.php index a7116fc84..d33b45cc7 100644 --- a/application/Device/DeviceController.php +++ b/application/Device/DeviceController.php @@ -1,6 +1,8 @@ needlogin = true; diff --git a/application/Device/DeviceModel.php b/application/Device/DeviceModel.php index 8591a2db4..b79ed2c71 100644 --- a/application/Device/DeviceModel.php +++ b/application/Device/DeviceModel.php @@ -1,4 +1,5 @@ Date: Thu, 23 Feb 2023 13:06:04 +0100 Subject: [PATCH 05/18] Contract WIP --- application/Contract/Contract.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/application/Contract/Contract.php b/application/Contract/Contract.php index 7cdda9229..8700b0b20 100644 --- a/application/Contract/Contract.php +++ b/application/Contract/Contract.php @@ -208,6 +208,11 @@ class Contract extends mfBaseModel { return $this->journals; } + if($name == "journals") { + $this->journals = array_reverse(ContractjournalModel::search(["contract_id" => $this->id])); + return $this->journals; + } + if($name == "links") { $this->links = ContractLinkModel::includesContractId($this->id, ["type" => $link]); //var_dump($this->links);exit; From cb75b50c54dfee8894b31e55fec1987ce6a27337 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Fri, 24 Feb 2023 15:50:28 +0100 Subject: [PATCH 06/18] Contractjournal finished & Started Contractconfig Hooks for Provisioning Workflow --- application/Contractconfig/hooks/Voip.php | 42 +++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 application/Contractconfig/hooks/Voip.php diff --git a/application/Contractconfig/hooks/Voip.php b/application/Contractconfig/hooks/Voip.php new file mode 100644 index 000000000..06ba1d585 --- /dev/null +++ b/application/Contractconfig/hooks/Voip.php @@ -0,0 +1,42 @@ + Date: Tue, 28 Feb 2023 13:35:58 +0100 Subject: [PATCH 07/18] Fixed external_id filter --- application/Product/ProductController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/Product/ProductController.php b/application/Product/ProductController.php index 5f8d385ea..fe3f4dbc4 100644 --- a/application/Product/ProductController.php +++ b/application/Product/ProductController.php @@ -32,7 +32,7 @@ class ProductController extends mfBaseController { $filter = $_SESSION[MFAPPNAME.'-Product-filter']; } } - + //var_dump($filter); $this->layout->set("filter", $filter); $filter = $this->getPreparedFilter($filter); @@ -46,7 +46,7 @@ class ProductController extends mfBaseController { if(is_numeric($this->request->s)) { $pagination['start'] = intval($this->request->s); } - + //var_dump($filter);exit; $pagination['maxItems'] = ProductModel::count($filter); $this->layout()->set("pagination", $pagination); From e21aa35c379ee4454aeb203ed0843d6047e0cb91 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 28 Feb 2023 16:43:17 +0100 Subject: [PATCH 08/18] Added internal billing NBE email for external products --- application/Product/ProductController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/Product/ProductController.php b/application/Product/ProductController.php index fe3f4dbc4..5f8d385ea 100644 --- a/application/Product/ProductController.php +++ b/application/Product/ProductController.php @@ -32,7 +32,7 @@ class ProductController extends mfBaseController { $filter = $_SESSION[MFAPPNAME.'-Product-filter']; } } - //var_dump($filter); + $this->layout->set("filter", $filter); $filter = $this->getPreparedFilter($filter); @@ -46,7 +46,7 @@ class ProductController extends mfBaseController { if(is_numeric($this->request->s)) { $pagination['start'] = intval($this->request->s); } - //var_dump($filter);exit; + $pagination['maxItems'] = ProductModel::count($filter); $this->layout()->set("pagination", $pagination); From f1f53cec73137bda7fee8f7c3a1ad1b41c6562e9 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Wed, 1 Mar 2023 17:01:49 +0100 Subject: [PATCH 09/18] Contracconfig Hooks WIP --- application/Contractconfig/hooks/Voip.php | 42 ----------------------- 1 file changed, 42 deletions(-) delete mode 100644 application/Contractconfig/hooks/Voip.php diff --git a/application/Contractconfig/hooks/Voip.php b/application/Contractconfig/hooks/Voip.php deleted file mode 100644 index 06ba1d585..000000000 --- a/application/Contractconfig/hooks/Voip.php +++ /dev/null @@ -1,42 +0,0 @@ - Date: Wed, 8 Mar 2023 16:14:28 +0100 Subject: [PATCH 10/18] Added Hausnummer filter --- lib/mvcfronk/mfBase/mfBaseController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mvcfronk/mfBase/mfBaseController.php b/lib/mvcfronk/mfBase/mfBaseController.php index 4aa1cef52..0119a66ac 100644 --- a/lib/mvcfronk/mfBase/mfBaseController.php +++ b/lib/mvcfronk/mfBase/mfBaseController.php @@ -183,7 +183,7 @@ class mfBaseController { $log = mfLoghandler::singleton(); - if(MFUSEFANCYURLS && defined('MFFANCYBASEURL')) { + if(MFUSEFANCYURLS && defined('MFFANCYBASEURL') && strlen(MFFANCYBASEURL) > 1) { // use fancy urls $url=MFFANCYBASEURL; if($mod) { From c36281f77fa2aa2cb3916fed1602d0502561125f Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Wed, 8 Mar 2023 20:26:12 +0100 Subject: [PATCH 11/18] Added preorder network select to user/form --- Layout/default/Preorder/Index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Layout/default/Preorder/Index.php b/Layout/default/Preorder/Index.php index 09b2eaaf9..4232dedb2 100644 --- a/Layout/default/Preorder/Index.php +++ b/Layout/default/Preorder/Index.php @@ -185,7 +185,7 @@ - is("preorderfront")): ?>campaign->name?> + is("preorderfront")): ?>campaign->name?> type, "preorder")?> Aufgenommen building_id): ?> From 836534624ff9cf31d7502fcb029b97bb11104d5a Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 14 Mar 2023 16:06:57 +0100 Subject: [PATCH 12/18] fixed campaign_id filter in preorder map --- ...ock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# | 1 + 1 file changed, 1 insertion(+) create mode 100644 scripts/addressdb/premstaetten/import/.~lock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# diff --git a/scripts/addressdb/premstaetten/import/.~lock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# b/scripts/addressdb/premstaetten/import/.~lock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# new file mode 100644 index 000000000..f2850562c --- /dev/null +++ b/scripts/addressdb/premstaetten/import/.~lock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# @@ -0,0 +1 @@ +,fronk,fronk-nb,14.03.2023 14:13,file:///home/fronk/.config/libreoffice/4; \ No newline at end of file From 21a1313afc6cb3d41ec7ad2132c8c1270cdd2578 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Tue, 14 Mar 2023 16:35:23 +0100 Subject: [PATCH 13/18] changed colors in preorder map and added more cache --- ...ock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# | 1 - 1 file changed, 1 deletion(-) delete mode 100644 scripts/addressdb/premstaetten/import/.~lock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# diff --git a/scripts/addressdb/premstaetten/import/.~lock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# b/scripts/addressdb/premstaetten/import/.~lock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# deleted file mode 100644 index f2850562c..000000000 --- a/scripts/addressdb/premstaetten/import/.~lock.SDIBuilding__Locations__FTTx_premstaetten_2023-03-07.csv# +++ /dev/null @@ -1 +0,0 @@ -,fronk,fronk-nb,14.03.2023 14:13,file:///home/fronk/.config/libreoffice/4; \ No newline at end of file From 03ebbdb099dc5846623dadf7fb5f683680e72957 Mon Sep 17 00:00:00 2001 From: Spitzer_Daniel Date: Wed, 22 Mar 2023 16:24:42 +0100 Subject: [PATCH 14/18] Remerge --- application/Device/Device.php | 1 - application/Device/DeviceController.php | 1 - application/Device/DeviceModel.php | 1 - 3 files changed, 3 deletions(-) diff --git a/application/Device/Device.php b/application/Device/Device.php index 178f165fc..4abccfb32 100644 --- a/application/Device/Device.php +++ b/application/Device/Device.php @@ -1,5 +1,4 @@ Date: Wed, 22 Mar 2023 16:27:00 +0100 Subject: [PATCH 15/18] Remerge --- application/Device/Device.php | 1 - application/Device/DeviceController.php | 1 - application/Device/DeviceModel.php | 1 - 3 files changed, 3 deletions(-) diff --git a/application/Device/Device.php b/application/Device/Device.php index 4abccfb32..43aa1e620 100644 --- a/application/Device/Device.php +++ b/application/Device/Device.php @@ -34,7 +34,6 @@ class Device extends mfBaseModel return null; } } - return $this->$name; } } \ No newline at end of file diff --git a/application/Device/DeviceController.php b/application/Device/DeviceController.php index 18929ec5b..a7116fc84 100644 --- a/application/Device/DeviceController.php +++ b/application/Device/DeviceController.php @@ -1,7 +1,6 @@ needlogin = true; diff --git a/application/Device/DeviceModel.php b/application/Device/DeviceModel.php index 0e2e72c4a..8591a2db4 100644 --- a/application/Device/DeviceModel.php +++ b/application/Device/DeviceModel.php @@ -22,7 +22,6 @@ class DeviceModel public static function find($data) { - } public static function create(array $data) From 77eb285c37a77ac19188c9d8d30f81a7e4877c35 Mon Sep 17 00:00:00 2001 From: Spitzer_Daniel Date: Wed, 22 Mar 2023 16:56:02 +0100 Subject: [PATCH 16/18] Remerge --- application/Device/Device.php | 2 ++ application/Device/DeviceModel.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/application/Device/Device.php b/application/Device/Device.php index 43aa1e620..178f165fc 100644 --- a/application/Device/Device.php +++ b/application/Device/Device.php @@ -1,4 +1,5 @@ $name; } } \ No newline at end of file diff --git a/application/Device/DeviceModel.php b/application/Device/DeviceModel.php index 8591a2db4..b79ed2c71 100644 --- a/application/Device/DeviceModel.php +++ b/application/Device/DeviceModel.php @@ -1,4 +1,5 @@ Date: Fri, 7 Apr 2023 18:59:58 +0200 Subject: [PATCH 17/18] =?UTF-8?q?MBI=20API=20Config=20Server-Configuration?= =?UTF-8?q?=20hinzugef=C3=BCgt.=20Devicemodel/Controller=20dementsprechend?= =?UTF-8?q?=20angepasst.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Variablen: TT_MBI_API_ENABLE ... true/false TT_MBI_API_URL ... Backend URL TT_MBI_API_VERSION ... API Version TT_MBI_API_KEY ... API Key --- application/Device/DeviceController.php | 3 + application/Device/DeviceModel.php | 113 +++++++++++++----------- config/config.sample.php | 6 ++ 3 files changed, 68 insertions(+), 54 deletions(-) diff --git a/application/Device/DeviceController.php b/application/Device/DeviceController.php index a7116fc84..436c3dc81 100644 --- a/application/Device/DeviceController.php +++ b/application/Device/DeviceController.php @@ -1,4 +1,5 @@ success === "true") { $this->layout()->setFlash("Backup wurde erfolgreich erstellt", "success"); + } elseif (!TT_MBI_API_ENABLE) { + $this->layout()->setFlash("Backup konnte nicht erstellt werden. Fehler: Schnittstellenserver wurde vom Admin deaktiviert.", "error"); } else { $this->layout()->setFlash("Backup konnte nicht erstellt werden. Fehler: " . $createConfig->error, "error"); } diff --git a/application/Device/DeviceModel.php b/application/Device/DeviceModel.php index b79ed2c71..e2bc076a1 100644 --- a/application/Device/DeviceModel.php +++ b/application/Device/DeviceModel.php @@ -139,75 +139,80 @@ class DeviceModel public static function getconifg($id) { - $curl = curl_init(); - - curl_setopt_array($curl, array( - CURLOPT_URL => 'https://172.16.5.56/api/deviceconfigs/' . $id, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_SSL_VERIFYHOST => false, - CURLOPT_SSL_VERIFYPEER => false, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Authorization: Bearer 4|6l5ixx3CYBP7xClqEfVAC3zrBbQlxusAtu4zNwQp'), - )); - $response = curl_exec($curl); - curl_close($curl); + $response = ""; + if (TT_MBI_API_ENABLE) : + $curl = curl_init(); + curl_setopt_array($curl, array( + CURLOPT_URL => TT_MBI_API_URL . TT_MBI_API_VERSION . '/deviceconfigs/' . $id, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_SSL_VERIFYHOST => false, + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_HTTPHEADER => array( + 'Authorization: Bearer ' . TT_MBI_API_KEY), + )); + $response = curl_exec($curl); + curl_close($curl); + endif; return json_decode($response); } public static function getconifgdownload($id, $format) { - $curl = curl_init(); + $response = ""; + if (TT_MBI_API_ENABLE) : + $curl = curl_init(); - curl_setopt_array($curl, array( - CURLOPT_URL => 'https://172.16.5.56/api/deviceconfigsdownload/' . $id . '/' . $format, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_SSL_VERIFYHOST => false, - CURLOPT_SSL_VERIFYPEER => false, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Authorization: Bearer 5|3QyhSkLgzrHwdVt05wQFUp2sFciiFhhGzucJirnI'), - )); + curl_setopt_array($curl, array( + CURLOPT_URL => TT_MBI_API_URL . TT_MBI_API_VERSION . '/deviceconfigsdownload/' . $id . '/' . $format, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_SSL_VERIFYHOST => false, + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_HTTPHEADER => array( + 'Authorization: Bearer ' . TT_MBI_API_KEY), + )); - $response = curl_exec($curl); + $response = curl_exec($curl); - curl_close($curl); -// echo $response; -// var_dump($response); + curl_close($curl); + endif; return ($response); } public static function configcreate($ip) { - $curl = curl_init(); - - curl_setopt_array($curl, array( - CURLOPT_URL => 'https://172.16.5.56/api/deviceconfigscreate/' . $ip, - CURLOPT_RETURNTRANSFER => true, - CURLOPT_ENCODING => '', - CURLOPT_MAXREDIRS => 10, - CURLOPT_SSL_VERIFYHOST => false, - CURLOPT_SSL_VERIFYPEER => false, - CURLOPT_TIMEOUT => 0, - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_CUSTOMREQUEST => 'GET', - CURLOPT_HTTPHEADER => array( - 'Authorization: Bearer 5|3QyhSkLgzrHwdVt05wQFUp2sFciiFhhGzucJirnI'), - )); - $response = curl_exec($curl); + $response = ""; + if (TT_MBI_API_ENABLE) : + $curl = curl_init(); + curl_setopt_array($curl, array( + CURLOPT_URL => TT_MBI_API_URL . TT_MBI_API_VERSION . '/deviceconfigscreate/' . $ip, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_SSL_VERIFYHOST => false, + CURLOPT_SSL_VERIFYPEER => false, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'GET', + CURLOPT_HTTPHEADER => array( + 'Authorization: Bearer ' . TT_MBI_API_KEY), + )); + $response = curl_exec($curl); + endif; return json_decode($response); } } \ No newline at end of file diff --git a/config/config.sample.php b/config/config.sample.php index b75305bae..6c68ba51b 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -681,3 +681,9 @@ define("PDFOUTPUTPATH",BASEDIR."/var/temp"); define("GIT_BIN_PATH", "/usr/bin/git"); define("PDFTOTEXT_BIN_PATH", "/usr/bin/pdftotext"); + +//MBI-API Server Configuration +define("TT_MBI_API_ENABLE", true); //Enable API Calls +define("TT_MBI_API_URL", "https://x.x.x.x/api/"); +define("TT_MBI_API_VERSION", "v01"); +define("TT_MBI_API_KEY", ""); \ No newline at end of file From 1d394a78525f75ddf770c59fd377cd692225db78 Mon Sep 17 00:00:00 2001 From: Spitzer_Daniel Date: Wed, 19 Apr 2023 17:27:48 +0200 Subject: [PATCH 18/18] Filestore Fertiggestellt Cpeprovisioning Performance Update --- Layout/default/Cpeprovisioning/Index.php | 803 ++++++++++-------- Layout/default/Device/Index.php | 2 +- Layout/default/Filestore/Form.php | 34 +- Layout/default/Filestore/Index.php | 77 +- .../CpeprovisioningController.php | 540 ++++++------ application/Filestore/Filestore.php | 2 +- application/Filestore/FilestoreController.php | 34 +- .../FilestoreHistoryController.php | 14 + .../FilestoreHistoryModel.php | 10 +- .../OrderProduct/OrderProductModel.php | 327 ++++--- public/assets/js/datatables-std.js | 8 + 11 files changed, 1037 insertions(+), 814 deletions(-) diff --git a/Layout/default/Cpeprovisioning/Index.php b/Layout/default/Cpeprovisioning/Index.php index 298faa3ec..67aa1aa98 100644 --- a/Layout/default/Cpeprovisioning/Index.php +++ b/Layout/default/Cpeprovisioning/Index.php @@ -1,381 +1,476 @@ getUrl($Mod, "Index"); +$pagination_baseurl_params = ["filter" => $filter]; +$pagination_entity_name = "Zu provisionierende CPEs"; ?> - - - -
-
+ + + +
+
-
- -
-

CPE Provisioning

+
+ +
+

CPE Provisioning

-
- +
+ + +
+
-
-
-
-
-

Filter

- - "> -
-
- - -
- -
- - -
- -
- - -
- - -
- - -
- -
-
-
- - ">Filter zurücksetzen -
-
- - -
-
- - -
-
-
-

CPE Provisioning

-
- - - - - - - bottom-no-border"> - - - - - - - - - top-no-border bottom-no-border"> - - - - - - - - - bottom-no-border top-no-border"> - - - - - - - - bottom-no-border"> - - - - top-no-border"> - - - - - -
NetzgebietService PINKundeProduktAccess TypeVLANs
- termination_id) ? $product->termination->building->network->name : $product->order->owner->zip." ".$product->order->owner->city?> - order->owner->spin?>order->owner->getCompanyOrName()?>product->name?>termination_id) ? " ".$product->termination->code."" : ""?>product->attributes['bras_type']->value?> - Down: product->attributes["bw_down"]->value?> / Up: product->attributes["bw_up"]->value?> - termination_id): ?> - termination->getPop()->vlan_public): ?> - - - termination->getPop()->vlan_nat): ?> - - - termination->getPop()->vlan_ipv6): ?> - - - - product->attributes['vlan_default_public']->value): ?> - - - product->attributes['vlan_default_nat']->value): ?> - - - product->attributes['vlan_default_ipv6']->value): ?> - - - - - order->products as $prod) { - if(is_array($prod->product->attributes) && count($prod->product->attributes)) { - if(array_key_exists("hw_only", $prod->product->attributes)) { - if($prod->product->attributes["hw_only"]->value) { - $hw[] = (int)$prod->amount."x ".$prod->product->name; - } - } - if(array_key_exists("voip_chan", $prod->product->attributes)) { - if($prod->product->attributes["voip_chan"]->value) { - $voip = true; - } - } - if(array_key_exists("vot", $prod->product->attributes)) { - if($prod->product->attributes["vot"]->value) { - $vot = true; - } - } - if($product->order->install_date) { - $vo_termin = $product->order->install_date; - } - if($hw && $voip_chan) { - break; - } - } - } - ?> - " : ""?> - ",$hw)."' >" : ""?> - " : ""?> - order->note) ? "',$product->order->note))."'>" : ""?> -
- termination_id && $product->termination->getPop()): ?> - POP: termination->getPop()->name?> - - Telefon: order->owner->phone?>Email: order->owner->email?> $product->order_id, "addJournal" => 1])?>"> Bestelljournal
- -
$filter])?>"> - - - - - +
+

Filter

+ + ">
-
- -
- - +
+ +
-
- -
-
- - +
+ +
-
-
-
- - +
+ +
-
- - -
- -
-
- - cpeprovisioning->shipping) ? "checked='checked'" : ""?> /> -
-
-
-
- - /> +
+ +
-
-
-
- - /> -
-
-
-
- - /> -
-
-
-
- - /> -
-
- - - -
-
- - cpeprovisioning->routerconfig_finished) ? "checked='checked'" : ""?> /> -
-
-
- - -
-
-
-
- - -
-
- -
- termination_id): ?> -
- -
-
- termination->getWorkflowValue("ont_deployed", "int")): ?> - - - - -
- " /> -
+
+
+ + ">Filter + zurücksetzen
-
+ - -
- -
-
- - -
-
-
-
-
- - -
-
- -
- -
- - -
- -
-
- - - + }) + + + diff --git a/Layout/default/Device/Index.php b/Layout/default/Device/Index.php index f30cfdbf2..162a79b27 100644 --- a/Layout/default/Device/Index.php +++ b/Layout/default/Device/Index.php @@ -127,7 +127,7 @@ $pagination_entity_name = "Device";