Fixed FTU checkboxes
This commit is contained in:
@@ -361,7 +361,26 @@ $(document).ready(function() {
|
|||||||
var id_match = $(this).attr("id").match(/wfitem_abschlusstyp_(\d+)$/);
|
var id_match = $(this).attr("id").match(/wfitem_abschlusstyp_(\d+)$/);
|
||||||
var id = id_match[1];
|
var id = id_match[1];
|
||||||
|
|
||||||
if($('#wfitem_ist_abschlusstyp_' + id).val() == "SC/APC in FTU") {
|
if($('#wfitem_ist_abschlusstyp_' + id).val() == "") {
|
||||||
|
if($(this).val() == "SC/APC in FTU") {
|
||||||
|
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').show();
|
||||||
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
|
||||||
|
} else {
|
||||||
|
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').hide();
|
||||||
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').hide();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("ist not empty");
|
||||||
|
if($('#wfitem_ist_abschlusstyp_' + id).val() == "SC/APC in FTU") {
|
||||||
|
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').show();
|
||||||
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
|
||||||
|
} else {
|
||||||
|
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').hide();
|
||||||
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
if($('#wfitem_ist_abschlusstyp_' + id).val().length && $('#wfitem_ist_abschlusstyp_' + id).val() != "SC/APC in FTU") {
|
||||||
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').hide();
|
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').hide();
|
||||||
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').hide();
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').hide();
|
||||||
} else {
|
} else {
|
||||||
@@ -372,7 +391,7 @@ $(document).ready(function() {
|
|||||||
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').show();
|
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').show();
|
||||||
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
});
|
});
|
||||||
$(elem).change();
|
$(elem).change();
|
||||||
});
|
});
|
||||||
@@ -384,20 +403,22 @@ $(document).ready(function() {
|
|||||||
var id = id_match[1];
|
var id = id_match[1];
|
||||||
|
|
||||||
if($(this).val() == "") {
|
if($(this).val() == "") {
|
||||||
|
console.log("ist empty");
|
||||||
if($('#wfitem_abschlusstyp_' + id).val() == "SC/APC in FTU") {
|
if($('#wfitem_abschlusstyp_' + id).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_supplied-' + id + ' .wf-content').show();
|
||||||
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
|
||||||
|
} else {
|
||||||
|
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').hide();
|
||||||
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').hide();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if($(this).val() == "SC/APC in FTU") {
|
console.log("ist not empty");
|
||||||
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').hide();
|
if($('#wfitem_ist_abschlusstyp_' + id).val() == "SC/APC in FTU") {
|
||||||
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').hide();
|
|
||||||
} else {
|
|
||||||
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').show();
|
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').show();
|
||||||
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').show();
|
||||||
|
} else {
|
||||||
|
$('#workflow-item-inhouse_cabling_supplied-' + id + ' .wf-content').hide();
|
||||||
|
$('#workflow-item-inhouse_cabling_deployed-' + id + ' .wf-content').hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -449,12 +470,14 @@ function validateWorkflowItem(id) {
|
|||||||
|
|
||||||
console.log("abschlusstyp: " + $("#wfitem_abschlusstyp_" + id).val());
|
console.log("abschlusstyp: " + $("#wfitem_abschlusstyp_" + id).val());
|
||||||
console.log("ist abschlusstyp: " + $("#wfitem_ist_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") {
|
if($("#wfitem_ist_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_supplied"] = "bool";
|
||||||
required_fields["inhouse_cabling_deployed"] = "bool";
|
required_fields["inhouse_cabling_deployed"] = "bool";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var missing = false;
|
var missing = false;
|
||||||
for(var field1 in required_fields) {
|
for(var field1 in required_fields) {
|
||||||
var field2 = "ist_" + field1;
|
var field2 = "ist_" + field1;
|
||||||
|
|||||||
37
scripts/check_building_status.php
Normal file
37
scripts/check_building_status.php
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
#!/usr/bin/php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
//require 'vendor/autoload.php';
|
||||||
|
require("../config/config.php");
|
||||||
|
|
||||||
|
define('FRONKDB_SQLDEBUG',false);
|
||||||
|
error_reporting(E_ALL & ~(E_NOTICE | E_STRICT | E_DEPRECATED));
|
||||||
|
|
||||||
|
require_once(LIBDIR."/mvcfronk/mfRouter/mfRouter.php");
|
||||||
|
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseModel.php");
|
||||||
|
require_once(LIBDIR."/mvcfronk/mfBase/mfBaseController.php");
|
||||||
|
|
||||||
|
$me = new User(1);
|
||||||
|
|
||||||
|
|
||||||
|
$buildings = BuildingModel::search(['status_id' => 1]);
|
||||||
|
|
||||||
|
|
||||||
|
echo TT_WORKFLOW_ITEM_STATUS_FIELD."\n";
|
||||||
|
echo TT_WORKFLOW_ITEM_STATUS_VALUE_PASSED."\n";
|
||||||
|
echo TT_WORKFLOW_ITEM_STATUS_VALUE_CONNECTED."\n";
|
||||||
|
|
||||||
|
foreach($buildings as $building) {
|
||||||
|
if(array_key_exists(TT_WORKFLOW_ITEM_STATUS_FIELD, $building->workflowitems)) {
|
||||||
|
if($building->workflowitems[TT_WORKFLOW_ITEM_STATUS_FIELD]->value->value_string == TT_WORKFLOW_ITEM_STATUS_VALUE_PASSED) {
|
||||||
|
echo TT_WORKFLOW_ITEM_STATUS_VALUE_PASSED." (4) ".$building->id."\n";
|
||||||
|
//$building->status_id = 4;
|
||||||
|
//$building->save();
|
||||||
|
}
|
||||||
|
if($building->workflowitems[TT_WORKFLOW_ITEM_STATUS_FIELD]->value->value_string == TT_WORKFLOW_ITEM_STATUS_VALUE_CONNECTED) {
|
||||||
|
echo TT_WORKFLOW_ITEM_STATUS_VALUE_CONNECTED." (5) ".$building->id."\n";
|
||||||
|
//$building->status_id = 5;
|
||||||
|
//$building->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user