changed some workflowitems to update every termination in building

This commit is contained in:
Frank Schubert
2021-11-06 14:12:55 +01:00
parent 5935571887
commit 9c84e82d3c
6 changed files with 171 additions and 65 deletions

View File

@@ -358,9 +358,42 @@ $(document).ready(function() {
});
$('select[id^="wfitem_abschlusstyp_"]').each(function() {
var elem = this;
$(elem).change(function() {
var id_match = $(this).attr("id").match(/wfitem_abschlusstyp_(\d+)$/);
var id = id_match[1];
if($(this).val() == "SC/APC in FTU") {
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').hide();
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').hide();
} else {
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').show();
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
}
});
$(elem).change();
});
$('select[id^="wfitem_ist_abschlusstyp_"]').each(function() {
var elem = this;
$(elem).change(function() {
var id_match = $(this).attr("id").match(/wfitem_ist_abschlusstyp_(\d+)$/);
var id = id_match[1];
if($(this).val() == "SC/APC in FTU") {
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').hide();
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').hide();
} else {
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').show();
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
}
});
$(elem).change();
});
$('form[id^="wf-termination-"]').each(function() {
var elem = this;
console.log(elem);
$(elem).submit(function(e) {
console.log(this);
@@ -392,14 +425,19 @@ function validateWorkflowItem(id) {
kundenkabel_typ: "string",
kundenkabel_fasern: "string",
backbone_finished: "bool",
inhouse_cabling_supplied: "bool",
inhouse_cabling_deployed: "bool",
bep_deployed: "bool",
customer_cable_injected: "bool",
spliced_network: "bool",
spliced_customer: "bool",
};
console.log("abschlusstyp: " + $("#wfitem_abschlusstyp_" + id).val());
console.log("ist abschlusstyp: " + $("#wfitem_ist_abschlusstyp_" + id).val());
if($("#wfitem_abschlusstyp_" + id).val() != "SC/APC in FTU" && $("#wfitem_ist_abschlusstyp_" + id).val() != "SC/APC in FTU") {
required_fields["inhouse_cabling_supplied"] = "bool";
required_fields["inhouse_cabling_deployed"] = "bool";
}
var missing = false;
for(var field1 in required_fields) {

View File

@@ -298,7 +298,7 @@
</div>
<div class="form-group row">
<label class="col-lg-2 col-form-label" for="bank_account_bank">Kreitinstitut</label>
<label class="col-lg-2 col-form-label" for="bank_account_bank">Kreditinstitut</label>
<div class="col-lg-10">
<input type="text" class="form-control" name="bank_account_bank" id="bank_account_bank" value="<?=$order->bank_account_bank?>" />
</div>

View File

@@ -289,6 +289,8 @@ $(document).ready(function() {
var pos = $('#building-' + building).offset().top;
$(window).scrollTop(pos - 150 );
}
});
$('select[name=wfitem_pipework_finished]').each(function() {

View File

@@ -7,64 +7,66 @@
}
}
?>
<td class="workflow-item wfitem-<?=$item->type?> wfitem-width-<?=$item->width?>" <?=($item->width > 1) ? "colspan='".$item->width."'" : ""?> style="width: <?=$this->commaToDot(round(100 / $wfColspan, 2) * $item->width)?>%">
<?php if($item->type != "gps"): ?>
<label class="form-label <?=$wfLabelClass?>" for="wfitem_<?=$item->name?>_<?=$$wftype->id?>">
<?=($item->label) ? $item->label : "&nbsp;"?>
<?=($item->label && $item->required == 1) ? "*" : ""?>
</label>
<?php endif; ?>
<td id="workflow-item-<?=$item->name?>-<?=$$wftype->id?>" class="workflow-item wfitem-<?=$item->type?> wfitem-width-<?=$item->width?>" <?=($item->width > 1) ? "colspan='".$item->width."'" : ""?> style="width: <?=$this->commaToDot(round(100 / $wfColspan, 2) * $item->width)?>%">
<div class="wf-content">
<?php if($item->type != "gps"): ?>
<label class="form-label <?=$wfLabelClass?>" for="wfitem_<?=$item->name?>_<?=$$wftype->id?>">
<?=($item->label) ? $item->label : "&nbsp;"?>
<?=($item->label && $item->required == 1) ? "*" : ""?>
</label>
<?php endif; ?>
<?php
<?php
switch($item->type) {
case "string":
include(realpath(dirname(__FILE__)."/items/")."/string.php");
break;
case "int":
include(realpath(dirname(__FILE__)."/items/")."/int.php");
break;
case "bool":
include(realpath(dirname(__FILE__)."/items/")."/bool.php");
break;
case "enum":
include(realpath(dirname(__FILE__)."/items/")."/enum.php");
break;
case "text":
include(realpath(dirname(__FILE__)."/items/")."/text.php");
break;
case "file":
include(realpath(dirname(__FILE__)."/items/")."/file.php");
break;
case "gps":
include(realpath(dirname(__FILE__)."/items/")."/gps.php");
break;
case "color":
include(realpath(dirname(__FILE__)."/items/")."/color.php");
break;
case "delimiter":
include(realpath(dirname(__FILE__)."/items/")."/delimiter.php");
break;
case "date":
include(realpath(dirname(__FILE__)."/items/")."/date.php");
break;
case "empty":
include(realpath(dirname(__FILE__)."/items/")."/empty.php");
break;
default:
include(realpath(dirname(__FILE__)."/items/")."/string.php");
}
?>
<div style="overflow-x: hidden">
<small
class="text-info text-mono"
<?php if($item->value->changed): ?>
title="Geändert: <?=date("d.m.Y H:i",$item->value->changed)?> von <?=$item->value->changer->name?> (<?=$item->value->changer->address->getCompanyOrName(true)?>)"
<?php endif; ?>
>
<?php if($item->value->changed): ?>
<?=$item->value->changer->getAbbrName()?>
<?php endif; ?>
</small>
switch($item->type) {
case "string":
include(realpath(dirname(__FILE__)."/items/")."/string.php");
break;
case "int":
include(realpath(dirname(__FILE__)."/items/")."/int.php");
break;
case "bool":
include(realpath(dirname(__FILE__)."/items/")."/bool.php");
break;
case "enum":
include(realpath(dirname(__FILE__)."/items/")."/enum.php");
break;
case "text":
include(realpath(dirname(__FILE__)."/items/")."/text.php");
break;
case "file":
include(realpath(dirname(__FILE__)."/items/")."/file.php");
break;
case "gps":
include(realpath(dirname(__FILE__)."/items/")."/gps.php");
break;
case "color":
include(realpath(dirname(__FILE__)."/items/")."/color.php");
break;
case "delimiter":
include(realpath(dirname(__FILE__)."/items/")."/delimiter.php");
break;
case "date":
include(realpath(dirname(__FILE__)."/items/")."/date.php");
break;
case "empty":
include(realpath(dirname(__FILE__)."/items/")."/empty.php");
break;
default:
include(realpath(dirname(__FILE__)."/items/")."/string.php");
}
?>
<div style="overflow-x: hidden">
<small
class="text-info text-mono"
<?php if($item->value->changed): ?>
title="Geändert: <?=date("d.m.Y H:i",$item->value->changed)?> von <?=$item->value->changer->name?> (<?=$item->value->changer->address->getCompanyOrName(true)?>)"
<?php endif; ?>
>
<?php if($item->value->changed): ?>
<?=$item->value->changer->getAbbrName()?>
<?php endif; ?>
</small>
</div>
</div>
</td>