';
if (!empty($record['deleted_at'])) {
$operation = $dbo->fetchOne("SELECT zz_operations.created_at, username FROM zz_operations INNER JOIN zz_users ON zz_operations.id_utente = zz_users.id WHERE op='delete' AND id_module=".prepare($id_module).' AND id_record='.prepare($id_record).' ORDER BY zz_operations.created_at DESC');
if (!empty($operation['username'])) {
$info = tr('Il record è stato eliminato il
_DATE_ da
_USER_', [
'_DATE_' => Translator::timestampToLocale($operation['created_at']),
'_USER_' => $operation['username'],
]).'. ';
}
echo '
';
}
// Pulsanti di default
echo '
';
// Pulsanti personalizzati
$buttons = $structure->filepath('buttons.php');
if (!empty($buttons)) {
ob_start();
include $buttons;
$buttons = ob_get_clean();
echo '
'.$buttons.'
';
}
// Contenuti del modulo
echo '
';
include $structure->getEditFile();
echo '
';
// Campi personalizzati
echo '
{( "name": "custom_fields", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'", "position": "top" )}
{( "name": "custom_fields", "id_module": "'.$id_module.'", "id_record": "'.$id_record.'" )}
';
if ($structure->permission != '-' && $structure->use_notes) {
echo '
';
include DOCROOT.'/plugins/notes.php';
echo '
';
}
if ($structure->permission != '-' && $structure->use_checklists) {
echo '
';
include DOCROOT.'/plugins/checks.php';
echo '
';
}
// Informazioni sulle operazioni
if (Auth::admin()) {
echo '
';
$operations = $dbo->fetchArray('SELECT `zz_operations`.*, `zz_users`.`username` FROM `zz_operations` JOIN `zz_users` ON `zz_operations`.`id_utente` = `zz_users`.`id` WHERE id_module = '.prepare($id_module).' AND id_record = '.prepare($id_record).' ORDER BY `created_at` ASC LIMIT 200');
if (!empty($operations)) {
echo '
';
foreach ($operations as $operation) {
$description = $operation['op'];
$icon = 'pencil-square-o';
$color = null;
$timeline_class = null;
switch ($operation['op']) {
case 'add':
$description = tr('Creazione');
$icon = 'plus';
$color = 'success';
break;
case 'update':
$description = tr('Modifica');
$icon = 'pencil';
$color = 'info';
break;
case 'delete':
$description = tr('Eliminazione');
$icon = 'times';
$color = 'danger';
break;
default:
$timeline_class = ' class="timeline-inverted"';
break;
}
echo '
-
'.$description.'
'.Carbon::parse($operation['created_at'])->diffForHumans().'
'.tr('_USER_', [
'_USER_' => $operation['username'],
]).
'
';
}
echo '
';
} else {
echo '
'.tr('Informazione:').' '.tr('Nessun log disponibile per questa scheda').'.
';
}
echo '
';
}
// Plugin
$module_record = $record;
foreach ($plugins as $plugin) {
$record = $module_record;
echo '
';
$id_plugin = $plugin['id'];
include DOCROOT.'/include/manager.php';
echo '
';
}
$record = $module_record;
echo '