Added Linework workflow

This commit is contained in:
Frank Schubert
2021-09-09 22:09:07 +02:00
parent af23c18dc6
commit e5acbdba40
22 changed files with 969 additions and 36 deletions

View File

@@ -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)"
>

View File

@@ -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);

View File

@@ -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,

View File

@@ -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

View File

@@ -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?>">

View File

@@ -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">&nbsp;</label>

View File

@@ -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?>">

View File

@@ -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?>">

View File

@@ -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?>">