diff --git a/Layout/default/Contractconfig/Index.php b/Layout/default/Contractconfig/Index.php new file mode 100644 index 000000000..95bad86b1 --- /dev/null +++ b/Layout/default/Contractconfig/Index.php @@ -0,0 +1,118 @@ + + + + +
| Anschluss | +Baustatus | +Patchstatus | +BB hergestellt | +BEP montiert | +K-Kabel eingeblasen | +Spleiß Netz | +Spleiß Kunde | +Fertig | +||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Anschluss | +Baustatus | +Patchstatus | +BB hergestellt | +BEP montiert | +K-Kabel eingeblasen | +Spleiß Netz | +Spleiß Kunde | +Fertig | +||||||||||||||
|
+
+ building->gps_lat && $term->building->gps_long): ?>
+
+ =$term->building->street?>
+
+
+ =$term->building->street?>
+
+
+
+ + [=__($term->building->status->name."-b")?>] + + ["code" => $term->building->code]])?>" target="_blank">=$term->code?> + |
+ =(empty($term->building->getWorkflowvalue('pipework_finished') && empty($term->building->getWorkflowvalue('ist_pipework_finished')))) ? "" : ""?> | +=($term->isWorkflowPatchingDone()) ? "" : "" ?> | +=($term->getWorkflowvalue('backbone_finished') != "1") ? "" : "" ?> | +=($term->getWorkflowvalue('bep_deployed') != "1") ? "" : "" ?> | +=($term->getWorkflowvalue('customer_cable_injected') != "1") ? "" : "" ?> | +=($term->getWorkflowvalue('spliced_network') != "1") ? "" : "" ?> | +=($term->getWorkflowvalue('spliced_customer') != "1") ? "" : "" ?> | +=($term->getWorkflowvalue('customer_passive_finished') != "1") ? "" : "" ?> | +||||||||||||||
|
@@ -196,7 +248,7 @@
Nicht fertiggestellt.
|
- + |
|
- =$num->routing?> | +=__($num->routing)?> | ported_out): ?> Exportiert diff --git a/Layout/default/menu.php b/Layout/default/menu.php index c20243e43..47cefdeec 100644 --- a/Layout/default/menu.php +++ b/Layout/default/menu.php @@ -87,7 +87,20 @@ - + diff --git a/application/Building/Building.php b/application/Building/Building.php index 822d6bd7e..f216558d0 100644 --- a/application/Building/Building.php +++ b/application/Building/Building.php @@ -79,9 +79,46 @@ class Building extends mfBaseModel { return $code; } - public function getWorkflowvalue($itemname, $type = "string") { + public function getWorkflowvalue($itemname, $type = false) { + $item = WorkflowitemModel::getFirst(['name' => $itemname]); + if(!$item->id) { + return null; + } + + switch($item->type) { + case "string": + $value_type = "string"; + break; + case "enum": + $value_type = "string"; + break; + case "gps": + $value_type = "string"; + break; + case "color": + $value_type = "string"; + break; + case "date": + $value_type = "string"; + break; + case "int": + $value_type = "int"; + break; + case "bool": + $value_type = "int"; + break; + case "file": + $value_type = "int"; + break; + case "text": + $value_type = "text"; + break; + default: + $value_type = "string"; + } + if(array_key_exists($itemname, $this->getProperty("workflowitems"))) { - return $this->getProperty("workflowitems")[$itemname]->value->{"value_$type"}; + return $this->getProperty("workflowitems")[$itemname]->value->{"value_$value_type"}; } return null; diff --git a/application/Contractconfig/ContractconfigController.php b/application/Contractconfig/ContractconfigController.php new file mode 100644 index 000000000..2a2178342 --- /dev/null +++ b/application/Contractconfig/ContractconfigController.php @@ -0,0 +1,23 @@ +needlogin=true; + $me = new User(); + $me->loadMe(); + $this->me = $me; + $this->layout()->set("me",$me); + + if(!$me->is(["Admin"])) { + $this->redirect("Dashboard"); + } + } + + protected function indexAction() { + $groups = ContractconfigGroupModel::getAll(); + + $this->layout()->set("groups", $groups); + } + +} \ No newline at end of file diff --git a/application/ContractconfigGroup/ContractconfigGroup.php b/application/ContractconfigGroup/ContractconfigGroup.php new file mode 100644 index 000000000..66e425c03 --- /dev/null +++ b/application/ContractconfigGroup/ContractconfigGroup.php @@ -0,0 +1,30 @@ +$name == null) { + + if($name == "items") { + $this->items = ContractconfigItemModel::search(['group_id' => $this->id]); + return $this->items; + } + + $classname = ucfirst($name); + $idfield = $name."_id"; + $this->$name = new $classname($this->$idfield); + + if($this->$name->id) { + return $this->$name; + } else { + return null; + } + } + + return $this->$name; + } + +} \ No newline at end of file diff --git a/application/ContractconfigGroup/ContractconfigGroupModel.php b/application/ContractconfigGroup/ContractconfigGroupModel.php new file mode 100644 index 000000000..77a41f055 --- /dev/null +++ b/application/ContractconfigGroup/ContractconfigGroupModel.php @@ -0,0 +1,114 @@ + $value) { + if(property_exists(get_called_class(), $field)) { + $model ->$field = $value; + } + } + + $me = new User(); + $me->loadMe(); + + if($model->create_by === null) { + $model->create_by = $me->id; + } + if($model->edit_by === null) { + $model->edit_by = $me->id; + } + + return $model; + } + + public static function getAll() { + $items = []; + + $db = FronkDB::singleton(); + + $res = $db->select("ContractconfigGroup", "*", "1=1 ORDER BY name, `create`"); + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new ContractconfigGroup($data); + } + } + return $items; + + } + + public static function getFirst() { + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $res = $db->select("ContractconfigGroup", "*", "$where LIMIT 1"); + if($db->num_rows($res)) { + $data = $db->fetch_object($res); + $item = new ContractconfigGroup($data); + if($item->id) { + return $item; + } else { + return null; + } + } + return null; + } + + public static function search($filter) { + $items = []; + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $res = $db->select("ContractconfigGroup", "*", "$where ORDER BY name, filename"); + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new ContractconfigGroup($data); + } + } + return $items; + } + + private function getSqlFilter($filter) { + $where = "1=1 "; + + //var_dump($filter);exit; + if(array_key_exists("name", $filter)) { + $name = FronkDB::singleton()->escape($filter['name']); + if($name) { + $where .= " AND name='$name'"; + } + } + + if(array_key_exists("filename", $filter)) { + $filename = FronkDB::singleton()->escape($filter['filename']); + if($filename) { + $where .= " AND filename='$filename'"; + } + } + + if(array_key_exists("subfolder", $filter)) { + $subfolder = FronkDB::singleton()->escape($filter['subfolder']); + if($subfolder) { + $where .= " AND subfolder='$subfolder'"; + } + } + + //var_dump($filter, $where);exit; + return $where; + } + +} \ No newline at end of file diff --git a/application/ContractconfigItem/ContractconfigItem.php b/application/ContractconfigItem/ContractconfigItem.php new file mode 100644 index 000000000..e6fb43949 --- /dev/null +++ b/application/ContractconfigItem/ContractconfigItem.php @@ -0,0 +1,5 @@ + $value) { + if(property_exists(get_called_class(), $field)) { + $model ->$field = $value; + } + } + + $me = new User(); + $me->loadMe(); + + if($model->create_by === null) { + $model->create_by = $me->id; + } + if($model->edit_by === null) { + $model->edit_by = $me->id; + } + + return $model; + } + + public static function getAll() { + $items = []; + + $db = FronkDB::singleton(); + + $res = $db->select("ContractconfigItem", "*", "1=1 ORDER BY name, `create`"); + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new ContractconfigItem($data); + } + } + return $items; + + } + + public static function getFirst() { + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $res = $db->select("ContractconfigItem", "*", "$where LIMIT 1"); + if($db->num_rows($res)) { + $data = $db->fetch_object($res); + $item = new ContractconfigItem($data); + if($item->id) { + return $item; + } else { + return null; + } + } + return null; + } + + public static function search($filter) { + $items = []; + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $res = $db->select("ContractconfigItem", "*", "$where ORDER BY name"); + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new ContractconfigItem($data); + } + } + return $items; + } + + private function getSqlFilter($filter) { + $where = "1=1 "; + + //var_dump($filter);exit; + if(array_key_exists("name", $filter)) { + $name = FronkDB::singleton()->escape($filter['name']); + if($name) { + $where .= " AND name='$name'"; + } + } + + if(array_key_exists("type", $filter)) { + $type = FronkDB::singleton()->escape($filter['type']); + if($type) { + $where .= " AND type='$type'"; + } + } + + if(array_key_exists("group_id", $filter)) { + $group_id = $filter['group_id']; + if(is_numeric($group_id)) { + $where .= " AND group_id=$group_id"; + } + } + + + //var_dump($filter, $where);exit; + return $where; + } + +} \ No newline at end of file diff --git a/application/ContractconfigValue/ContractconfigValue.php b/application/ContractconfigValue/ContractconfigValue.php new file mode 100644 index 000000000..c59f79872 --- /dev/null +++ b/application/ContractconfigValue/ContractconfigValue.php @@ -0,0 +1,5 @@ + $value) { + if(property_exists(get_called_class(), $field)) { + $model ->$field = $value; + } + } + + $me = new User(); + $me->loadMe(); + + if($model->create_by === null) { + $model->create_by = $me->id; + } + if($model->edit_by === null) { + $model->edit_by = $me->id; + } + + return $model; + } + + public static function getAll() { + $items = []; + + $db = FronkDB::singleton(); + + $res = $db->select("ContractconfigValue", "*", "1=1"); + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new ContractconfigValue($data); + } + } + return $items; + + } + + public static function getFirst() { + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $res = $db->select("ContractconfigValue", "*", "$where LIMIT 1"); + if($db->num_rows($res)) { + $data = $db->fetch_object($res); + $item = new ContractconfigValue($data); + if($item->id) { + return $item; + } else { + return null; + } + } + return null; + } + + public static function search($filter) { + $items = []; + $db = FronkDB::singleton(); + + $where = self::getSqlFilter($filter); + $res = $db->select("ContractconfigValue", "*", "$where ORDER BY name, filename"); + if($db->num_rows($res)) { + while($data = $db->fetch_object($res)) { + $items[] = new ContractconfigValue($data); + } + } + return $items; + } + + private function getSqlFilter($filter) { + $where = "1=1 "; + + //var_dump($filter);exit; + if(array_key_exists("name", $filter)) { + $name = FronkDB::singleton()->escape($filter['name']); + if($name) { + $where .= " AND name='$name'"; + } + } + + if(array_key_exists("filename", $filter)) { + $filename = FronkDB::singleton()->escape($filter['filename']); + if($filename) { + $where .= " AND filename='$filename'"; + } + } + + if(array_key_exists("subfolder", $filter)) { + $subfolder = FronkDB::singleton()->escape($filter['subfolder']); + if($subfolder) { + $where .= " AND subfolder='$subfolder'"; + } + } + + //var_dump($filter, $where);exit; + return $where; + } + +} \ No newline at end of file diff --git a/application/Linework/LineworkController.php b/application/Linework/LineworkController.php index 0cdb16b96..30d404507 100644 --- a/application/Linework/LineworkController.php +++ b/application/Linework/LineworkController.php @@ -25,7 +25,7 @@ class LineworkController extends mfBaseController { // pagination defaults $pagination = []; $pagination['start'] = 0; - $pagination['count'] = 5; + $pagination['count'] = 20; $pagination['maxItems'] = 0; if(is_numeric($this->request->s)) { diff --git a/application/Termination/Termination.php b/application/Termination/Termination.php index 8754a04d5..a5b094073 100644 --- a/application/Termination/Termination.php +++ b/application/Termination/Termination.php @@ -35,14 +35,79 @@ class Termination extends mfBaseModel { return $address; } - public function getWorkflowvalue($itemname, $type = "string") { + public function getWorkflowvalue($itemname, $type = false) { + $item = WorkflowitemModel::getFirst(['name' => $itemname]); + if(!$item->id) { + return null; + } + + switch($item->type) { + case "string": + $value_type = "string"; + break; + case "enum": + $value_type = "string"; + break; + case "gps": + $value_type = "string"; + break; + case "color": + $value_type = "string"; + break; + case "date": + $value_type = "string"; + break; + case "int": + $value_type = "int"; + break; + case "bool": + $value_type = "int"; + break; + case "file": + $value_type = "int"; + break; + case "text": + $value_type = "text"; + break; + default: + $value_type = "string"; + } + if(array_key_exists($itemname, $this->getProperty("workflowitems"))) { - return $this->getProperty("workflowitems")[$itemname]->value->{"value_$type"}; + return $this->getProperty("workflowitems")[$itemname]->value->{"value_$value_type"}; } return null; } + public function isWorkflowPatchingDone() { + $item_names = [ + 'pop_id', + 'schrank', + 'baugruppe', + 'modul', + 'ports', + 'abschlusstyp', + 'bb_kabel', + 'bb_kabel_steps', + 'bb_fasern', + 'kundenkabel_typ', + 'kundenkabel_fasern' + ]; + + $done = true; + + foreach($item_names as $name) { + $this->log->debug(__FILE__.": (Termination ".$this->id.") $name => $type == '".$this->getWorkflowvalue($name)."' (ist: '".$this->getWorkflowvalue("ist_".$name)."')"); + if(empty($this->getWorkflowvalue($name)) && empty($this->getWorkflowvalue("ist_".$name))) { + $done = false; + break; + } + } + + return $done; + } + public function getPop() { $pop_id = $this->getWorkflowvalue('pop_id'); if(!$pop_id) { diff --git a/lang/de.php b/lang/de.php index 5a8fd0734..b6cfc5596 100644 --- a/lang/de.php +++ b/lang/de.php @@ -35,4 +35,7 @@ $l['passed-t'] = "Fasern im Gebäude"; $l['connected-t'] = "Passiv erschlossen"; $l['active-t'] = "Internetprodukt aktiv"; +$l['kolmisoft'] = "VPORTAL (kolmisoft)"; +$l['sipit'] = "SCA (sipit)"; + $lang['de'] = $l; \ No newline at end of file | |||||||||||||||||