getIdentity(); $model = method_exists($this, 'getModel') ? $this->getModel('Circolare') : null; $item = $this->item; $canAdmin = $user->authorise('core.admin', 'com_circolari') || $user->authorise('core.manage', 'com_circolari'); // Firma dell'utente (se esiste) $firma = ($model && !$user->guest) ? $model->getFirmaUtente((int)$item->id, (int)$user->id) : null; $hasVoted = (bool) $firma; // Helper per confrontare anche in caso di schema ENUM $slugify = function (string $s): string { $s = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $s); $s = strtolower($s); $s = preg_replace('~[^a-z0-9]+~', '_', $s); return trim($s, '_'); }; $selectedBtnId = isset($firma->firmatipo_bottone_id) ? (int)$firma->firmatipo_bottone_id : 0; $selectedEnum = isset($firma->firma_enum) ? (string)$firma->firma_enum : ''; $buttons = $this->getModel()->getBottoniFirma((int)$item->tipologia_firma_id); $firme = []; if ($canAdmin) { $model = method_exists($this, 'getModel') ? $this->getModel('Circolare') : null; if (!$model) { // fallback creazione model via MVCFactory se necessario try { $factory = $app->bootComponent('com_circolari')->getMVCFactory(); $model = $factory->createModel('Circolare', 'Site', ['ignore_request' => true]); } catch (\Throwable $e) { $model = null; } } $firme = $model ? $model->getFirmeCircolare((int)$item->id) : []; } ?>
| Nome | Username | Scelta | Data |
|---|---|---|---|
| Nessuna firma registrata. | |||
| format('d/m/Y H:i'), ENT_QUOTES, 'UTF-8'); ?> | |||