';
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');
$info = tr('Il record è stato eliminato il
_DATE_ da
_USER_', [
'_DATE_' => (($operation['created_at']) ? timestampFormat($operation['created_at']) : timestampFormat($record['deleted_at'])),
'_USER_' => ((!empty($operation['username'])) ? $operation['username'] : 'N.D.'),
]).'. ';
echo '
';
}
// Pulsanti di default
echo '
'.tr("Torna all'elenco").'
{( "name": "button", "type": "print", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}
{( "name": "button", "type": "email", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}';
if (Modules::get('Account SMS')) {
echo '
{( "name": "button", "type": "sms", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}';
}
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 '
';
$path = $structure->getEditFile();
if (!empty($path)) {
include $path;
}
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 && $user->gruppo != 'Clienti') {
echo '
';
include base_dir().'/plugins/notes.php';
echo '
';
}
if ($structure->permission != '-' && $structure->use_checklists) {
echo '
';
include base_dir().'/plugins/checks.php';
echo '
';
}
// Informazioni sulle operazioni
if (auth()->user()->isAdmin()) {
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` DESC 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;
case 'copy':
$description = tr('Duplicato');
$icon = 'clone';
$color = 'info';
break;
default:
$timeline_class = ' class="timeline-inverted"';
break;
}
echo '
-
'.$description.'
'.Carbon::parse($operation['created_at'])->diffForHumans().'
'.$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 base_dir().'/include/manager.php';
echo '
';
}
$record = $module_record;
echo '