From 702e9f54c5b9e21fe41fc161ab2ded437ed15723 Mon Sep 17 00:00:00 2001 From: Frank Schubert Date: Thu, 19 Oct 2023 13:38:28 +0200 Subject: [PATCH] Fixed not finishing Linework when ist_abschluss is not FTU --- Layout/default/Linework/Index.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Layout/default/Linework/Index.php b/Layout/default/Linework/Index.php index 7adee780d..14d661e0a 100644 --- a/Layout/default/Linework/Index.php +++ b/Layout/default/Linework/Index.php @@ -610,13 +610,19 @@ function validateWorkflowItem(id) { console.log("abschlusstyp: " + $("#wfitem_abschlusstyp_" + id).val()); console.log("ist abschlusstyp: " + $("#wfitem_ist_abschlusstyp_" + id).val()); - if($("#wfitem_ist_abschlusstyp_" + id).val() == "SC/APC in FTU") { + if($("#wfitem_abschlusstyp_" + id).val() == "SC/APC in FTU") { required_fields["inhouse_cabling_supplied"] = "bool"; required_fields["inhouse_cabling_deployed"] = "bool"; - } else if($("#wfitem_abschlusstyp_" + id).val() == "SC/APC in FTU") { - required_fields["inhouse_cabling_supplied"] = "bool"; - required_fields["inhouse_cabling_deployed"] = "bool"; - } + } + if($("#wfitem_ist_abschlusstyp_" + id).val().length) { + if($("#wfitem_ist_abschlusstyp_" + id).val() == "SC/APC in FTU") { + required_fields["inhouse_cabling_supplied"] = "bool"; + required_fields["inhouse_cabling_deployed"] = "bool"; + } else { + delete required_fields["inhouse_cabling_supplied"]; + delete required_fields["inhouse_cabling_deployed"]; + } + } var missing = false; for(var field1 in required_fields) {