Performance optimizations
This commit is contained in:
@@ -146,6 +146,8 @@
|
|||||||
<th>Kundenkabel</th>
|
<th>Kundenkabel</th>
|
||||||
<th>Spleiß Netz</th>
|
<th>Spleiß Netz</th>
|
||||||
<th>Spleiß Kunde</th>
|
<th>Spleiß Kunde</th>
|
||||||
|
<th>FTU</th>
|
||||||
|
<th>FTU verlegt</th>
|
||||||
<th>Fertig</th>
|
<th>Fertig</th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php $bcount = 0;
|
<?php $bcount = 0;
|
||||||
@@ -161,6 +163,8 @@
|
|||||||
<th>Kundenkabel</th>
|
<th>Kundenkabel</th>
|
||||||
<th>Spleiß Netz</th>
|
<th>Spleiß Netz</th>
|
||||||
<th>Spleiß Kunde</th>
|
<th>Spleiß Kunde</th>
|
||||||
|
<th>FTU</th>
|
||||||
|
<th>FTU verlegt</th>
|
||||||
<th>Fertig</th>
|
<th>Fertig</th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
@@ -190,6 +194,17 @@
|
|||||||
<td onclick="togglePipework(<?=$term->id?>)"><?=($term->getWorkflowvalue('customer_cable_injected') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?></td>
|
<td onclick="togglePipework(<?=$term->id?>)"><?=($term->getWorkflowvalue('customer_cable_injected') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?></td>
|
||||||
<td onclick="togglePipework(<?=$term->id?>)"><?=($term->getWorkflowvalue('spliced_network') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?></td>
|
<td onclick="togglePipework(<?=$term->id?>)"><?=($term->getWorkflowvalue('spliced_network') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?></td>
|
||||||
<td onclick="togglePipework(<?=$term->id?>)"><?=($term->getWorkflowvalue('spliced_customer') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?></td>
|
<td onclick="togglePipework(<?=$term->id?>)"><?=($term->getWorkflowvalue('spliced_customer') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?></td>
|
||||||
|
<td onclick="togglePipework(<?=$term->id?>)">
|
||||||
|
<?php if(($term->getWorkflowvalue('abschlusstyp') == "SC/APC in FTU" && empty($term->getWorkflowvalue('ist_abschlusstyp'))) || $term->getWorkflowvalue('ist_abschlusstyp') == "SC/APC in FTU"): ?>
|
||||||
|
<?=($term->getWorkflowvalue('inhouse_cabling_supplied') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
<td onclick="togglePipework(<?=$term->id?>)">
|
||||||
|
<?php if(($term->getWorkflowvalue('abschlusstyp') == "SC/APC in FTU" && empty($term->getWorkflowvalue('ist_abschlusstyp'))) || $term->getWorkflowvalue('ist_abschlusstyp') == "SC/APC in FTU"): ?>
|
||||||
|
<?=($term->getWorkflowvalue('inhouse_cabling_deployed') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?>
|
||||||
|
<?php endif; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
<td onclick="togglePipework(<?=$term->id?>)"><?=($term->getWorkflowvalue('customer_passive_finished') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?></td>
|
<td onclick="togglePipework(<?=$term->id?>)"><?=($term->getWorkflowvalue('customer_passive_finished') != "1") ? "<i class='fas fa-times text-danger'></i>" : "<i class='fas fa-check text-success'></i>" ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr id="termination-<?=$term->id?>" class="table-bg-<?=($bcount % 2 == 0) ? "even" : "odd"?> hidden">
|
<tr id="termination-<?=$term->id?>" class="table-bg-<?=($bcount % 2 == 0) ? "even" : "odd"?> hidden">
|
||||||
@@ -242,7 +257,7 @@
|
|||||||
Nicht fertiggestellt.
|
Nicht fertiggestellt.
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td colspan="8">
|
<td colspan="10">
|
||||||
<table class="table workflow-table table-bordered table-sm table-bg-<?=($bcount % 2 == 0) ? "odd" : "even"?>">
|
<table class="table workflow-table table-bordered table-sm table-bg-<?=($bcount % 2 == 0) ? "odd" : "even"?>">
|
||||||
<tr>
|
<tr>
|
||||||
<th>AP-Typ</th>
|
<th>AP-Typ</th>
|
||||||
@@ -377,6 +392,8 @@
|
|||||||
<th>Kundenkabel</th>
|
<th>Kundenkabel</th>
|
||||||
<th>Spleiß Netz</th>
|
<th>Spleiß Netz</th>
|
||||||
<th>Spleiß Kunde</th>
|
<th>Spleiß Kunde</th>
|
||||||
|
<th>FTU</th>
|
||||||
|
<th>FTU verlegt</th>
|
||||||
<th>Fertig</th>
|
<th>Fertig</th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
@@ -37,14 +37,25 @@ class Termination extends mfBaseModel {
|
|||||||
|
|
||||||
public function loadWorkflowItems() {
|
public function loadWorkflowItems() {
|
||||||
$item_ids = [];
|
$item_ids = [];
|
||||||
foreach(WorkflowitemModel::search(["object_type" => "Termination", "active" => 1]) as $item) {
|
|
||||||
|
$term_wfitems = mfValuecache::singleton()->get("wfitems-term-active");
|
||||||
|
if(!$term_wfitems) {
|
||||||
|
$term_wfitems = WorkflowitemModel::search(["object_type" => "Termination", "active" => 1]);
|
||||||
|
mfValuecache::singleton()->set("wfitems-term-active", $term_wfitems);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach($term_wfitems as $item) {
|
||||||
$item->setObjectId($this->id);
|
$item->setObjectId($this->id);
|
||||||
$this->workflowitems[$item->name] = $item;
|
$this->workflowitems[$item->name] = $item;
|
||||||
//mfValuecache::set("wfTerm-name-".$item->name, $item);
|
mfValuecache::singleton()->set("wfTerm-name-".$item->name, $item);
|
||||||
//mfValuecache::set("wfTerm-id-".$item->id, $item);
|
mfValuecache::singleton()->set("wfTerm-id-".$item->id, $item);
|
||||||
$item_ids[] = $item->id;
|
$item_ids[] = $item->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach($item_ids as $id) {
|
||||||
|
mfValuecache::singleton()->set("wfItemvalue-item-".$id."-object-".$this->id, new Workflowvalue());
|
||||||
|
}
|
||||||
|
|
||||||
// get values
|
// get values
|
||||||
$values = WorkflowvalueModel::search(["object_id" => $this->id]);
|
$values = WorkflowvalueModel::search(["object_id" => $this->id]);
|
||||||
//var_dump($values);exit;
|
//var_dump($values);exit;
|
||||||
@@ -52,13 +63,13 @@ class Termination extends mfBaseModel {
|
|||||||
if(array_key_exists($value->item->name, $this->workflowitems)) {
|
if(array_key_exists($value->item->name, $this->workflowitems)) {
|
||||||
//var_dump($value);exit;
|
//var_dump($value);exit;
|
||||||
$this->workflowitems[$value->item->name]->setValue($value);
|
$this->workflowitems[$value->item->name]->setValue($value);
|
||||||
mfValuecache::singleton()->set("wfTerm-name-".$this->workflowitems[$value->item->name]->name, $this->workflowitems[$value->item->name]);
|
mfValuecache::singleton()->set("wfItemvalue-item-".$value->item_id."-object-".$this->id, $value);
|
||||||
mfValuecache::singleton()->set("wfTerm-id-".$this->workflowitems[$value->item->name]->id, $this->workflowitems[$value->item->name]);
|
|
||||||
mfValuecache::singleton()->set("wfItemvalue-item-".$value->item_id."-object-".$value->object_id, $value);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/*if($this->id == 42) {
|
||||||
//var_dump(array_keys(mfValuecache::singleton()->getCache()));
|
//var_dump(array_keys(mfValuecache::singleton()->getCache()));exit;
|
||||||
|
var_dump(mfValuecache::singleton()->get("wfItemvalue-item-20-object-42"));exit;
|
||||||
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,12 +30,14 @@ class Workflowitem extends mfBaseModel {
|
|||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
$value = WorkflowvalueModel::getFirst(['item_id' => $this->id, "object_id" => $this->object_id]);
|
$value = WorkflowvalueModel::getFirst(['item_id' => $this->id, "object_id" => $this->object_id]);
|
||||||
|
// explicitly cache empty value
|
||||||
|
mfValuecache::singleton()->set("wfItemvalue-item-".$this->id."-object-".$this->object_id, $value);
|
||||||
if(!$value) {
|
if(!$value) {
|
||||||
$vdata['item_id'] = $this->id;
|
$vdata['item_id'] = $this->id;
|
||||||
$vdata['object_id'] = $this->object_id;
|
$vdata['object_id'] = $this->object_id;
|
||||||
$value = WorkflowvalueModel::create($vdata);
|
$value = WorkflowvalueModel::create($vdata);
|
||||||
|
|
||||||
}
|
}
|
||||||
mfValuecache::singleton()->set("wfItemvalue-item-".$this->id."-object-".$this->object_id, $value);
|
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
return $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,14 @@ class FronkDB {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(FRONKDB_SQLDEBUG==true) {
|
if(FRONKDB_SQLDEBUG==true) {
|
||||||
|
/*$this->log->debug("[FronkDB] ================");
|
||||||
|
$this->log->debug("[FronkDB] START SQL QUERY");
|
||||||
|
$bt = debug_backtrace();
|
||||||
|
foreach($bt as $n => $b) {
|
||||||
|
$this->log->debug($n.") ".$b["file"]."(".$b['line']."): ".$b['class']."->".$b['function']."()" );
|
||||||
|
}*/
|
||||||
$this->log->debug("[FronkDB] $sql");
|
$this->log->debug("[FronkDB] $sql");
|
||||||
|
//$this->log->debug("[FronkDB] END SQL QUERY");
|
||||||
//echo "$sql\n";
|
//echo "$sql\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user