From 9f57920975640fa44542653bbd2128ac19b33aa1 Mon Sep 17 00:00:00 2001 From: MatteoPistorello Date: Wed, 3 Apr 2024 17:21:32 +0200 Subject: [PATCH] =?UTF-8?q?Visualizzazione=20checklist=20impianti=20in=20s?= =?UTF-8?q?tampa=20Attivit=C3=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/interventi/body.php | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/templates/interventi/body.php b/templates/interventi/body.php index 70fa2d888..1936dc562 100755 --- a/templates/interventi/body.php +++ b/templates/interventi/body.php @@ -19,6 +19,7 @@ use Carbon\Carbon; use Models\Module; +use Modules\Checklists\Check; include_once __DIR__.'/../../core.php'; @@ -546,7 +547,23 @@ if ($options['checklist']) { echo renderChecklistHtml($check); } - echo ' + $impianti_collegati = $dbo->fetchArray('SELECT * FROM my_impianti_interventi INNER JOIN my_impianti ON my_impianti_interventi.idimpianto = my_impianti.id WHERE idintervento = '.prepare($id_record)); + foreach ($impianti_collegati as $impianto) { + $checks = Check::where('id_module_from', (new Module())->getByField('name', 'Impianti', Models\Locale::getPredefined()->id))->where('id_record_from', $impianto['id'])->where('id_module', (new Module())->getByField('name', 'Interventi', Models\Locale::getPredefined()->id))->where('id_record', $id_record)->where('id_parent', null)->get(); + + if (sizeof($checks)) { + echo ' + + + '.tr('Impianto', [], ['upper' => true]).' '.$impianto['matricola'].' - '.$impianto['nome'].' + + '; + foreach ($checks as $check) { + echo renderChecklistHtml($check); + } + } + } + echo ' '; } }