diff --git a/Layout/default/Pop/Detail.php b/Layout/default/Pop/Detail.php index 1793fd0e0..601293ce8 100644 --- a/Layout/default/Pop/Detail.php +++ b/Layout/default/Pop/Detail.php @@ -1,5 +1,6 @@ - +
@@ -139,6 +143,35 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "pop-detail") {
+
+ +
+ +
+
+
+ +
+ doku_date) : "" ?>" + value="doku_date) ? date("Y-m-d", $pop->doku_date) : "" ?>" + class="form-control" name="doku_date" id="doku_date"> +
+
+
+ +
+ " + class="form-control" name="folder_link" id="folder_link"> +
+
@@ -146,6 +179,7 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "pop-detail") { rows="5">note ?>
+
@@ -183,7 +217,8 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "pop-detail") { $('form').on('blur', 'input[type=number]', function (e) { $(this).off('wheel.disableScroll') }); - $(".select2").select2(); + $(".select2").select2({ + }); // network_id // owner_id @@ -191,7 +226,7 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "pop-detail") { const urlParams = new URLSearchParams(window.location.search); const network_id = urlParams.get('network_id'); - if(network_id) { + if (network_id) { console.log("network_id", network_id); $("#owner_id").val(network_id).trigger('change'); } diff --git a/application/Pop/PopController.php b/application/Pop/PopController.php index dc63b3e47..f1f225c8a 100644 --- a/application/Pop/PopController.php +++ b/application/Pop/PopController.php @@ -74,6 +74,8 @@ class PopController extends mfBaseController $this->redirect("Pop"); } $popnetwork = PopNetworkModel::getbyPopid($id); + $stateArray=PopModel::$stateArray; + $this->layout()->set("stateArray", $stateArray); $this->layout()->set("popnetwork", implode(', ' , $popnetwork['name'])); $this->layout()->setTemplate("Pop/Detail"); $filter['pop_id'] = $id; @@ -86,8 +88,12 @@ class PopController extends mfBaseController protected function addAction() { + $stateArray=PopModel::$stateArray; + $this->layout()->set("stateArray", $stateArray); $this->layout()->setTemplate("Pop/Form"); $this->layout()->set("networks", NetworkModel::getAll()); + + if ($this->request->network_id) { $pop = new Pop(); $pop->network_id = $this->request->network_id; @@ -151,6 +157,9 @@ class PopController extends mfBaseController $data['vlan_public'] = ($r->vlan_public) ? $r->vlan_public : null; $data['vlan_nat'] = ($r->vlan_nat) ? $r->vlan_nat : null; $data['vlan_ipv6'] = ($r->vlan_ipv6) ? $r->vlan_ipv6 : null; + $data['state'] = ($r->state) ? $r->state : null; + $data['folder_link'] = ($r->folder_link) ? $r->folder_link : null; + $data['doku_date'] = ($r->doku_date) ? strtotime($r->doku_date) : null; $data['note'] = $r->note; $data['edit_by'] = 1; diff --git a/application/Pop/PopModel.php b/application/Pop/PopModel.php index edc93d8fd..a96561c0a 100644 --- a/application/Pop/PopModel.php +++ b/application/Pop/PopModel.php @@ -10,6 +10,10 @@ class PopModel public $vlan_public = null; public $vlan_nat = null; public $vlan_ipv6 = null; + public $state = null; + + public $folder_link = null; + public $doku_date = null; public $note = null; @@ -18,6 +22,14 @@ class PopModel public $create = null; public $edit = null; + public static $stateArray = [ + 1 => "Planung (Innenleben)", + 2 => "Bauphase (Schrank)", + 3 => "Grobdoku", + 4 => "in Betrieb", + 5 => "von Techniker abgenommen (Altbestand)", + ]; + public static function find($data) { @@ -122,7 +134,7 @@ class PopModel WHERE $where ORDER BY name, PopNetwork.network_id LIMIT 1 "; - + $res = $db->query($sql); if ($db->num_rows($res)) { $data = $db->fetch_object($res); @@ -142,15 +154,15 @@ class PopModel $db = FronkDB::singleton(); $where = self::getSqlFilter($filter); - + $sql = "SELECT Pop.* FROM Pop LEFT JOIN PopNetwork ON (PopNetwork.pop_id = Pop.id) WHERE $where ORDER BY name, PopNetwork.network_id"; - + $res = $db->query($sql); //$res = $db->select("Pop", "*", "$where ORDER BY name, network_id"); - + if ($db->num_rows($res)) { while ($data = $db->fetch_object($res)) { $items[] = new Pop($data); diff --git a/db/migrations/20250511155600_pop_add_fields.php b/db/migrations/20250511155600_pop_add_fields.php new file mode 100644 index 000000000..cca070c76 --- /dev/null +++ b/db/migrations/20250511155600_pop_add_fields.php @@ -0,0 +1,37 @@ +getEnvironment() == "thetool") { + $timerecordingCategory = $this->table("Pop"); + $timerecordingCategory->addColumn("state", "integer", ["null" => true, "default" => null,"comment" => "1:Planung/2:Bauphase/3:Grobdoku,4:in Betrieb/5:von Techniker abgenommen", "after" => "vlan_ipv6"]); + $timerecordingCategory->addColumn("folder_link", "text", ["null" => true, "default" => null, "after" => "state"]); + $timerecordingCategory->addColumn("doku_date", "integer", ["null" => true, "default" => null, "after" => "folder_link"]); + $timerecordingCategory->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } + + public function down(): void + { + if($this->getEnvironment() == "thetool") { + $table = $this->table('Pop'); + $table->removeColumn("state"); + $table->removeColumn("folder_link"); + $table->removeColumn("doku_date"); + $table->update(); + } + + if($this->getEnvironment() == "addressdb") { + + } + } +} diff --git a/public/assets/css/select2-cstm.css b/public/assets/css/select2-cstm.css index f9258132e..a9e2f0799 100644 --- a/public/assets/css/select2-cstm.css +++ b/public/assets/css/select2-cstm.css @@ -8,4 +8,7 @@ } .select2-container--default .select2-selection--single { border: 1px solid #ced4da; +} +.select2-container .select2-selection--multiple { + min-height: calc(1.5em + 0.9rem + 2px); } \ No newline at end of file