Added Linework workflow
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<input type="hidden" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$building->id?>" value="<?=($item->value->value_int == 1) ? "1" : "0"?>" />
|
||||
<input type="hidden" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$$wftype->id?>" value="<?=($item->value->value_int == 1) ? "1" : "0"?>" />
|
||||
<input
|
||||
type="checkbox"
|
||||
class="form-control"
|
||||
name="wfitemplaceholder_<?=$item->name?>"
|
||||
id="wfitemplaceholder_<?=$item->name?>_<?=$building->id?>"
|
||||
id="wfitemplaceholder_<?=$item->name?>_<?=$$wftype->id?>"
|
||||
value="1"
|
||||
<?=($item->value->value_int == 1) ? "checked='checked'" : ""?>
|
||||
onchange="$('#wfitem_<?=$item->name?>_<?=$building->id?>').val((this.checked) ? 1 : 0)"
|
||||
onchange="$('#wfitem_<?=$item->name?>_<?=$$wftype->id?>').val((this.checked) ? 1 : 0)"
|
||||
>
|
||||
|
||||
@@ -8,7 +8,7 @@ if(preg_match('/^(.+)-1R$/', $color_name, $cmatch)) {
|
||||
?>
|
||||
|
||||
|
||||
<select class="form-control selectpicker show-tick" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$building->id?>" title="Farbe wählen" data-style="btn-outline-<?=$color_name?>">
|
||||
<select class="form-control selectpicker show-tick" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$$wftype->id?>" title="Farbe wählen" data-style="btn-outline-<?=$color_name?>">
|
||||
<option></option>
|
||||
<?php foreach(TT_CABLE_COLORS as $name => $color): ?>
|
||||
<option
|
||||
@@ -23,24 +23,24 @@ if(preg_match('/^(.+)-1R$/', $color_name, $cmatch)) {
|
||||
</select>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#wfitem_<?=$item->name?>_<?=$building->id?>').change(function() {
|
||||
var color = $('#wfitem_<?=$item->name?>_<?=$building->id?> option:selected').data("bg-color");
|
||||
var name = $('#wfitem_<?=$item->name?>_<?=$building->id?> option:selected').val();
|
||||
$("wfitem_<?=$item->name?>_<?=$building->id?>").data("style", "btn-danger");
|
||||
console.log("button [data-id='wfitem_<?=$item->name?>_<?=$building->id?>']");
|
||||
console.log($("button [data-id='wfitem_<?=$item->name?>_<?=$building->id?>']"));
|
||||
$('#wfitem_<?=$item->name?>_<?=$$wftype->id?>').change(function() {
|
||||
var color = $('#wfitem_<?=$item->name?>_<?=$$wftype->id?> option:selected').data("bg-color");
|
||||
var name = $('#wfitem_<?=$item->name?>_<?=$$wftype->id?> option:selected').val();
|
||||
$("wfitem_<?=$item->name?>_<?=$$wftype->id?>").data("style", "btn-danger");
|
||||
console.log("button [data-id='wfitem_<?=$item->name?>_<?=$$wftype->id?>']");
|
||||
console.log($("button [data-id='wfitem_<?=$item->name?>_<?=$$wftype->id?>']"));
|
||||
|
||||
var matches;
|
||||
if(matches = name.match(/^(.+)-1R$/)) {
|
||||
name = matches[1];
|
||||
}
|
||||
|
||||
$("[data-id='wfitem_<?=$item->name?>_<?=$building->id?>']").removeClass(function (index, className) {
|
||||
$("[data-id='wfitem_<?=$item->name?>_<?=$$wftype->id?>']").removeClass(function (index, className) {
|
||||
console.log(className);
|
||||
return (className.match (/(^|\s)btn-outline-\S+/g) || []).join(' ');
|
||||
});
|
||||
|
||||
$("[data-id='wfitem_<?=$item->name?>_<?=$building->id?>']").addClass("btn-outline-" + name)
|
||||
$("[data-id='wfitem_<?=$item->name?>_<?=$$wftype->id?>']").addClass("btn-outline-" + name)
|
||||
|
||||
console.log(color);
|
||||
console.log(name);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$building->id?>" value="<?=$item->value->value_string?>" placeholder="<?=$item->placeholder?>" />
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$$wftype->id?>" value="<?=$item->value->value_string?>" placeholder="<?=$item->placeholder?>" />
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#wfitem_<?=$item->name?>_<?=$building->id?>').datepicker({
|
||||
$('#wfitem_<?=$item->name?>_<?=$$wftype->id?>').datepicker({
|
||||
language: 'de',
|
||||
format: "dd.mm.yyyy",
|
||||
showWeekDays: true,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1 +1 @@
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$building->id?>" value="<?=$item->value->value_string?>">
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$$wftype->id?>" value="<?=$item->value->value_string?>">
|
||||
@@ -9,12 +9,12 @@
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-5 padding-right-2">
|
||||
<label class="form-label" for="wfitem_<?=$item->name?>_lat_<?=$building->id?>">GPS Breite <?=($item->required == 1) ? "*" : ""?></label>
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>[lat]" id="wfitem_<?=$item->name?>_lat_<?=$building->id?>" value="<?=$lat?>" placeholder="<?=str_replace(",", ".", TT_PLACEHOLDER_GPS_LAT)?>">
|
||||
<label class="form-label" for="wfitem_<?=$item->name?>_lat_<?=$$wftype->id?>">GPS Breite <?=($item->required == 1) ? "*" : ""?></label>
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>[lat]" id="wfitem_<?=$item->name?>_lat_<?=$$wftype->id?>" value="<?=$lat?>" placeholder="<?=str_replace(",", ".", TT_PLACEHOLDER_GPS_LAT)?>">
|
||||
</div>
|
||||
<div class="col-md-5 padding-left-2">
|
||||
<label class="form-label" for="wfitem_<?=$item->name?>_long_<?=$building->id?>">GPS Länge <?=($item->required == 1) ? "*" : ""?></label>
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>[long]" id="wfitem_<?=$item->name?>_long_<?=$building->id?>" value="<?=$long?>" placeholder="<?=str_replace(",", ".", TT_PLACEHOLDER_GPS_LONG)?>">
|
||||
<label class="form-label" for="wfitem_<?=$item->name?>_long_<?=$$wftype->id?>">GPS Länge <?=($item->required == 1) ? "*" : ""?></label>
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>[long]" id="wfitem_<?=$item->name?>_long_<?=$$wftype->id?>" value="<?=$long?>" placeholder="<?=str_replace(",", ".", TT_PLACEHOLDER_GPS_LONG)?>">
|
||||
</div>
|
||||
<div class="col-md-2 padding-left-2">
|
||||
<label class="form-label"> </label>
|
||||
|
||||
@@ -1 +1 @@
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$building->id?>" value="<?=$item->value->value_string?>">
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$$wftype->id?>" value="<?=$item->value->value_string?>">
|
||||
@@ -1 +1 @@
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$building->id?>" value="<?=$item->value->value_string?>" placeholder="<?=$item->placeholder?>">
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$$wftype->id?>" value="<?=$item->value->value_string?>" placeholder="<?=$item->placeholder?>">
|
||||
@@ -1 +1 @@
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$building->id?>" value="<?=$item->value->value_string?>">
|
||||
<input type="text" class="form-control" name="wfitem_<?=$item->name?>" id="wfitem_<?=$item->name?>_<?=$$wftype->id?>" value="<?=$item->value->value_string?>">
|
||||
Reference in New Issue
Block a user