Pop Feature Erweiterungen

* Project 8454 (Erweiterung Felder Status, Speicherort, Dokustand Datum)
* Schrank breite um 1ne Col verbreitert
* neue Migration
This commit is contained in:
Daniel Spitzer
2025-05-11 19:53:31 +02:00
parent 14bcb7b3c2
commit 09aaede76b
6 changed files with 117 additions and 12 deletions
+9
View File
@@ -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;
+16 -4
View File
@@ -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);