. */ include_once __DIR__.'/../../../core.php'; use Modules\Interventi\Intervento; $id_records = explode(';', get('id_records')); $id_print = setting('Stampa per anteprima e firma'); $template = Prints::get($id_print)['name']; $interventi_completati = []; $interventi_firmati = []; $interventi_da_firmare = []; $records = []; foreach ($id_records as $id) { $intervento = Intervento::find($id); if ($intervento->stato->is_completato) { $interventi_completati[] = $id; } elseif ($intervento->firma_file) { $interventi_firmati[] = $id; $records[] = $id; } else { $interventi_da_firmare[] = $id; $records[] = $id; } } echo '

'.tr('Interventi da firmare').'

'; if ($interventi_da_firmare) { echo ' '; foreach ($interventi_da_firmare as $id) { $intervento = Intervento::find($id); echo ' '; } echo '
'.tr('Interventi').' #
'.Modules::link('Interventi', $intervento->id, tr('Intervento num. _NUM_ del _DATE_', [ '_NUM_' => $intervento->codice, '_DATE_' => Translator::dateToLocale($intervento->inizio), ])).' '.Prints::getLink($template, $id, 'btn btn-xs btn-primary', '', 'fa fa-print').'
'; } else { echo 'Nessun Intervento..'; } echo '

'.tr('Interventi firmati non completati').'

'; if ($interventi_firmati) { echo ' '; foreach ($interventi_firmati as $id) { $intervento = Intervento::find($id); echo ' '; } echo '
'.tr('Interventi').' #
'.Modules::link('Interventi', $intervento->id, tr('Intervento num. _NUM_ del _DATE_', [ '_NUM_' => $intervento->codice, '_DATE_' => Translator::dateToLocale($intervento->inizio), ])).' '.Prints::getLink($template, $id, 'btn btn-xs btn-primary', '', 'fa fa-print').'
'; } else { echo 'Nessun Intervento..'; } echo '

'.tr('Interventi completati').'

'; if ($interventi_completati) { echo ' '; foreach ($interventi_completati as $id) { $intervento = Intervento::find($id); echo ' '; } echo '
'.tr('Interventi').' #
'.Modules::link('Interventi', $intervento->id, tr('Intervento num. _NUM_ del _DATE_', [ '_NUM_' => $intervento->codice, '_DATE_' => Translator::dateToLocale($intervento->inizio), ])).' '.Prints::getLink($template, $id, 'btn btn-xs btn-primary', '', 'fa fa-print').'

'.tr('Questi interventi non verranno firmati').'
'; } else { echo 'Nessun Intervento..'; } echo '
'; // HTML per la visualizzazione echo '

'; ?>
{[ "type": "text", "label": "", "name": "firma_nome", "required": 1 ]}