From 81fe058e3e55e1058ae07b95a26c046e0b14699f Mon Sep 17 00:00:00 2001 From: Daniel Spitzer Date: Sun, 14 Dec 2025 19:59:35 +0100 Subject: [PATCH] =?UTF-8?q?Pop=20Updates=20*=20Kategorie=20wurde=20hinzuge?= =?UTF-8?q?f=C3=BCgt=20*=20beim=20Bearbeiten=20von=20der=20Vue=20Table=20k?= =?UTF-8?q?ommt=20man=20beim=20Speichern=20und=20Abbrechen=20nun=20wieder?= =?UTF-8?q?=20in=20die=20Pop=20=C3=9Cbersicht?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Layout/default/Pop/Detail.php | 22 ++++++++----- Layout/default/Pop/Form.php | 12 ++++++- application/Pop/PopController.php | 6 ++++ application/Pop/PopModel.php | 9 +++++ .../20251214180619_add_pop_field_category.php | 33 +++++++++++++++++++ public/js/pages/Pop/Pop.js | 8 ++++- 6 files changed, 79 insertions(+), 11 deletions(-) create mode 100644 db/migrations/20251214180619_add_pop_field_category.php diff --git a/Layout/default/Pop/Detail.php b/Layout/default/Pop/Detail.php index de8e24d67..7e498970e 100644 --- a/Layout/default/Pop/Detail.php +++ b/Layout/default/Pop/Detail.php @@ -3,7 +3,7 @@ type="text/css"/> - +
@@ -66,6 +66,10 @@ if (!empty(trim($pops->vlan_ipv6))) Name name ?> + + Kategorie + category]['name']." (".$categoryArray[$pops->category]['comment'].")" ?> + Standort @@ -614,11 +618,11 @@ if (!empty(trim($pops->vlan_ipv6)))
- +
+ +
+ +
+
diff --git a/application/Pop/PopController.php b/application/Pop/PopController.php index 68c734dfa..9e0ef90ae 100644 --- a/application/Pop/PopController.php +++ b/application/Pop/PopController.php @@ -30,6 +30,7 @@ class PopController extends mfBaseController return [ "id" => $pop->id, "name" => $pop->name, + "category" => $pop->category, "networkArea" => $pop->networks, "location" => $pop->location, "state" => $pop->state, @@ -94,7 +95,9 @@ class PopController extends mfBaseController $this->layout()->set("cables_json", json_encode($cables_json)); $popnetwork = PopNetworkModel::getbyPopid($id); $stateArray = PopModel::$stateArray; + $categoryArray=PopModel::$categoryArray; $this->layout()->set("stateArray", $stateArray); + $this->layout()->set("categoryArray", $categoryArray); $this->layout()->set("popnetwork", implode(', ', $popnetwork['name'])); $this->layout()->set("popnetwork_ids", json_encode($popnetwork['network_id'])); $this->layout()->setTemplate("Pop/Detail"); @@ -1105,7 +1108,9 @@ class PopController extends mfBaseController protected function addAction() { $stateArray = PopModel::$stateArray; + $categoryArray=PopModel::$categoryArray; $this->layout()->set("stateArray", $stateArray); + $this->layout()->set("categoryArray", $categoryArray); $this->layout()->setTemplate("Pop/Form"); $this->layout()->set("networks", NetworkModel::getAll()); @@ -1166,6 +1171,7 @@ class PopController extends mfBaseController $data['name'] = $r->name; + $data['category']=$r->category; $data['gps_lat'] = ($r->gps_lat) ? $r->gps_lat : null; $data['gps_long'] = ($r->gps_long) ? $r->gps_long : null; $data['location'] = $r->location; diff --git a/application/Pop/PopModel.php b/application/Pop/PopModel.php index 3247a7c74..f6c15b14e 100644 --- a/application/Pop/PopModel.php +++ b/application/Pop/PopModel.php @@ -3,6 +3,7 @@ class PopModel { public $name = null; + public $category=null; public $network_id = null; public $gps_lat = null; public $gps_long = null; @@ -30,6 +31,14 @@ class PopModel 5 => "von Techniker abgenommen (Altbestand)", ]; + public static $categoryArray = [ + 1 => array('name' => 'Outdoor', 'comment' => 'Kasten/Schrank'), + 2 => array('name' => 'Indoor', 'comment' => 'Keller Gebäude'), + 3 => array('name' => 'Sender/Funk', 'comment' => 'Sendemast'), + 4 => array('name' => 'Container', 'comment' => 'Garage, Container') + ]; + + public static function find($data) { diff --git a/db/migrations/20251214180619_add_pop_field_category.php b/db/migrations/20251214180619_add_pop_field_category.php new file mode 100644 index 000000000..d20a19dad --- /dev/null +++ b/db/migrations/20251214180619_add_pop_field_category.php @@ -0,0 +1,33 @@ +getEnvironment() == "thetool") { + $timerecordingCategory = $this->table("Pop"); + $timerecordingCategory->addColumn("category", "integer", ["null" => false, "default" => 1, "after" => "name"]); + $timerecordingCategory->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $table = $this->table('Pop'); + $table->removeColumn("category"); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +} diff --git a/public/js/pages/Pop/Pop.js b/public/js/pages/Pop/Pop.js index 7746c1f15..d4b337192 100644 --- a/public/js/pages/Pop/Pop.js +++ b/public/js/pages/Pop/Pop.js @@ -1,5 +1,6 @@ Vue.component('Pop', { //language=Vue + // g template: ` @@ -37,7 +38,7 @@ Vue.component('Pop', { @@ -55,6 +56,11 @@ Vue.component('Pop', { defaultPageSize: 25, headers: [ {text: 'Name', key: 'name', priority: 10}, + {text: 'Kategorie', key: 'category', class: 'text-center', priority: 4, filter: 'select', filterOptions: [ + {value: '1', text: 'Outdoor (Kasten/Schrank)'}, + {value: '2', text: 'Indoor (Keller Gebäude)'}, + {value: '3', text: 'Sender/Funk (Sendemast)'}, + {value: '4', text: 'Container (Garage, Container)'}]}, {text: 'Netzgebiet', key: 'networkArea', class: 'text-center', // TODO: fix autocomplete Filter // filter: 'autocomplete',