showing construction company in Pipe- and Linework

This commit is contained in:
Frank Schubert
2025-04-22 17:11:20 +02:00
parent d054cee094
commit 72a4353b3b
3 changed files with 30 additions and 0 deletions

View File

@@ -210,6 +210,12 @@
<span class="text-monospace">[<?=__($term->building->status->name."-b")?>]</span>
<br />
<a href="<?=self::getUrl("Pipework", "Index", ["filter" => ["code" => $term->building->code]])?>" target="_blank"><span class="text-success"><?=$term->code?></span></a>
<br />
<?php if($term->building->pipeworker_id): ?>
<span class="text-primary"><?=($term->building->lineworker_id) ? $term->building->lineworker->getCompanyOrName() : ""?></span><br />
<?php else: ?>
<span><em>-- Keiner Baufirma zugewiesen --</em></span><br />
<?php endif; ?>
</div>
<div class="up-arrow hidden">
<i class="fas fa-angle-up"></i>
@@ -253,6 +259,12 @@
<div class="mt-2 mb-2">
<a href="<?=self::getUrl("Pipework", "Index", ["filter" => ["code" => $term->building->code]])?>" target="_blank"><span class="text-success"><?=$term->code?></span></a>
<br />
<?php if($term->building->pipeworker_id): ?>
<span class="text-primary"><?=($term->building->lineworker_id) ? $term->building->lineworker->getCompanyOrName() : ""?></span><br />
<?php else: ?>
<span><em>-- Keiner Baufirma zugewiesen --</em></span><br />
<?php endif; ?>
<br />
<?php if($term->name): ?>
<?=$term->name?><br />
<?php endif; ?>

View File

@@ -168,6 +168,11 @@
<div>
<strong style="white-space: nowrap;"><?=$building->street?></strong><br />
<span class="text-success"><?=$building->code?></span><br />
<?php if($building->pipeworker_id): ?>
<span class="text-primary"><?=($building->pipeworker_id) ? $building->pipeworker->getCompanyOrName() : ""?></span><br />
<?php else: ?>
<span><em>-- Keiner Baufirma zugewiesen --</em></span><br />
<?php endif; ?>
</div>
<div class="mt-3">
<?=$building->contact?><br />

View File

@@ -10,6 +10,7 @@ class Building extends mfBaseModel {
private $type;
private $status;
private $pipeworker;
private $lineworker;
private $terminations;
private $termination_workflow_comments;
private $workflowitems;
@@ -56,6 +57,7 @@ class Building extends mfBaseModel {
$this->type = null;
$this->status = null;
$this->pipeworker = null;
$this->lineworker = null;
$this->terminations = null;
$this->workflowitems = null;
$this->files = null;
@@ -292,6 +294,17 @@ class Building extends mfBaseModel {
//$this->pipeworker = new Address($this->pipeworker_id);
return $this->pipeworker;
}
if($name == "lineworker") {
$lineworker = mfValuecache::singleton()->get("mfObjectmodel-Address-".$this->lineworker_id);
if(!$lineworker) {
$lineworker = new Address($this->lineworker_id);
mfValuecache::singleton()->set("mfObjectmodel-Address-".$this->lineworker_id, $lineworker);
}
$this->lineworker = $lineworker;
//$this->lineworker = new Address($this->lineworker_id);
return $this->lineworker;
}
if($name == "terminations") {
$this->terminations = TerminationModel::search(['building_id' => $this->id]);