Added Linework workflow
This commit is contained in:
@@ -1,9 +1,47 @@
|
||||
<?php
|
||||
$options = [];
|
||||
$options = explode(";", $item->typedata);
|
||||
if(strpos($item->typedata, "=Model=") !== false) {
|
||||
// get options from Model
|
||||
$m = [];
|
||||
if(preg_match('/^=Model=(\w+)(?::([^:]+):)?$/', $item->typedata, $m)) {
|
||||
// dynamic enum
|
||||
$model = $m[1];
|
||||
$modelClass = $model."Model";
|
||||
|
||||
$filter = [];
|
||||
if($m[2]) {
|
||||
$filter_parts = explode("=", $m[2]);
|
||||
$filter_name = $filter_parts[0];
|
||||
$filter_value = $filter_parts[1];
|
||||
|
||||
if(substr($filter_value, 0, 1) == '`') {
|
||||
$filter_value = substr($filter_value, 1, strlen($filter_value) - 2);
|
||||
$objPath = explode("->", $filter_value);
|
||||
|
||||
if(count($objPath) > 1) {
|
||||
$obj = array_shift($objPath);
|
||||
$curr = $$obj;
|
||||
foreach($objPath as $part) {
|
||||
$curr = $curr->$part;
|
||||
}
|
||||
$filter_value = $curr;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($modelClass::search([$filter_name => $filter_value]) as $modelObject) {
|
||||
$options[] = $modelObject->id . "=" . $modelObject->name;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$options = explode(";", $item->typedata);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<select class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$building->id?>">
|
||||
<select class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$$wftype->id?>">
|
||||
<option></option>
|
||||
<?php foreach($options as $opt): ?>
|
||||
<?php
|
||||
|
||||
Reference in New Issue
Block a user