. */ include_once __DIR__.'/core.php'; use Carbon\Carbon; // Disabilitazione dei campi $read_only = $structure->permission == 'r'; if (empty($id_record) && !empty($id_module) && empty($id_plugin)) { redirect(base_path().'/controller.php?id_module='.$id_module); } elseif (empty($id_record) && empty($id_module) && empty($id_plugin)) { redirect(base_path().'/index.php'); } include_once App::filepath('include|custom|', 'top.php'); if (!empty($id_record)) { Util\Query::setSegments(false); $query = Util\Query::getQuery($structure, [ 'id' => $id_record, ]); Util\Query::setSegments(true); } // Replace automatico del campo deleted_at se non specifico a una tabella if (!str_contains($query, '.`deleted_at`') && !str_contains($query, '.deleted_at')) { $query = str_replace(['AND `deleted_at` IS NULL', '`deleted_at` IS NULL AND', '`deleted_at` IS NULL', 'AND deleted_at IS NULL', 'deleted_at IS NULL AND', 'deleted_at IS NULL'], '', $query); } $has_access = !empty($query) ? $dbo->fetchNum($query) !== 0 : true; if ($has_access) { // Inclusione gli elementi fondamentali include_once base_dir().'/actions.php'; } if (empty($record) || !$has_access) { echo '

'. ' '.tr('Record non trovato').'

'.tr('Stai cercando di accedere ad un record eliminato o non presente').'.


'.tr('Indietro').'
'; } else { // Widget in alto echo '{( "name": "widgets", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "position": "top", "place": "editor" )}'; $advanced_sessions = setting('Attiva notifica di presenza utenti sul record'); if (!empty($advanced_sessions)) { $dbo->query('DELETE FROM zz_semaphores WHERE id_utente='.prepare(Auth::user()['id']).' AND posizione='.prepare($id_module.', '.$id_record)); $dbo->query('INSERT INTO zz_semaphores (id_utente, posizione, updated) VALUES ('.prepare(Auth::user()['id']).', '.prepare($id_module.', '.$id_record).', NOW())'); echo '

'.tr('Attenzione!').'

'.tr('I seguenti utenti stanno visualizzando questa pagina').':

'.tr('Prestare attenzione prima di effettuare modifiche, poichè queste potrebbero essere perse a causa di multipli salvataggi contemporanei').'.

'; } echo ' '; } redirectOperation($id_module, isset($id_parent) ? $id_parent : $id_record); // Widget in basso echo '{( "name": "widgets", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "position": "right", "place": "editor" )}'; if (!empty($record)) { echo '
'.tr('Indietro').' '; } echo '