Setting termination status on linework save
This commit is contained in:
@@ -215,18 +215,24 @@ class LineworkController extends mfBaseController {
|
||||
|
||||
$termination->resetProperties();
|
||||
|
||||
// set linework finished flag in building
|
||||
/*
|
||||
// set linework finished flag in termination
|
||||
|
||||
if($name == TT_WORKFLOW_ITEM_LINEWORK_DONE) {
|
||||
if($value && $building->workflow_finished == 0) {
|
||||
$building->workflow_finished = 1;
|
||||
$building->save();
|
||||
} elseif(!$value && $building->workflow_finished == 1) {
|
||||
$building->workflow_finished = 0;
|
||||
$building->save();
|
||||
if($value && $termination->workflow_finished == 0) {
|
||||
$termination->workflow_finished = 1;
|
||||
$termination->save();
|
||||
} elseif(!$value && $termination->workflow_finished == 1) {
|
||||
$termination->workflow_finished = 0;
|
||||
$termination->save();
|
||||
}
|
||||
|
||||
}*/
|
||||
// set status to connected
|
||||
if($value && $termination->status_id < 5) {
|
||||
$termination->status_id = 5;
|
||||
$termination->save();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -234,34 +240,23 @@ class LineworkController extends mfBaseController {
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
if($building->workflowitems['pipework_finished']->value->value_string) {
|
||||
// unset Tiefbau abgeschlossen if missing values
|
||||
if( (!$building->workflowitems['anschlusspunkt_typ']->value->value_string && !$building->workflowitems['ist_anschlusspunkt_typ']->value->value_string)
|
||||
|| (!$building->workflowitems['anschlusspunkt_name']->value->value_string && !$building->workflowitems['ist_anschlusspunkt_name']->value->value_string)
|
||||
|| (!$building->workflowitems['rohrverband_name']->value->value_string && !$building->workflowitems['ist_rohrverband_name']->value->value_string)
|
||||
|| (!$building->workflowitems['rohrtype']->value->value_string && !$building->workflowitems['ist_rohrtype']->value->value_string)
|
||||
|| (!$building->workflowitems['rohrfarbe']->value->value_string && !$building->workflowitems['ist_rohrfarbe']->value->value_string)
|
||||
) {
|
||||
$building->workflowitems['pipework_finished']->value->value_string = "";
|
||||
$building->workflowitems['pipework_finished']->value->save();
|
||||
|
||||
if($termination->workflowitems[TT_WORKFLOW_ITEM_LINEWORK_DONE]->value_int) {
|
||||
$required_fields = ["baugruppe","modul","ports","abschlusstyp","bb_kabel","bb_fasern","kundenkabel_typ","kundenkabel_fasern","backbone_finished","inhouse_cabling_supplied","inhouse_cabling_deployed","bep_deployed","customer_cable_injected","spliced_network","spliced_customer"];
|
||||
$can_finish = true;
|
||||
foreach($required_fields as $f) {
|
||||
$type = $termination->workflowitems[$f]->type;
|
||||
if(!$termination->workflowitems[$f]->value->{"value_$type"} && !$termination->workflowitems["ist_$f"]->value->{"value_$type"}) {
|
||||
$can_finish = false;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
// set building status if Status field was set
|
||||
/*
|
||||
if(defined("TT_WORKFLOW_ITEM_STATUS_FIELD") && defined("TT_WORKFLOW_ITEM_STATUS_VALUE_PASSED") && defined("TT_WORKFLOW_ITEM_STATUS_VALUE_CONNECTED")) {
|
||||
$status_value = $building->workflowitems[TT_WORKFLOW_ITEM_STATUS_FIELD]->value->value_string;
|
||||
//var_dump($status_value);exit;
|
||||
if($status_value == TT_WORKFLOW_ITEM_STATUS_VALUE_PASSED && $building->status_id != 4) {
|
||||
$building->status_id = 4;
|
||||
$building->save();
|
||||
|
||||
if(!$can_finish) {
|
||||
$this->log->info("Resetting customer_passive_finished because of missing");
|
||||
$termination->workflowitems[TT_WORKFLOW_ITEM_LINEWORK_DONE]->value->value_int = 0;
|
||||
$termination->workflowitems[TT_WORKFLOW_ITEM_LINEWORK_DONE]->value->save();
|
||||
}
|
||||
if($status_value == TT_WORKFLOW_ITEM_STATUS_VALUE_CONNECTED && $building->status_id != 5) {
|
||||
$building->status_id = 5;
|
||||
$building->save();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
// file upload
|
||||
//var_dump($_FILES);exit;
|
||||
|
||||
Reference in New Issue
Block a user