changes linework to openable list
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user