. */ include_once __DIR__.'/../../../core.php'; use Carbon\Carbon; use Models\Module; if (!empty($is_title_request)) { echo tr('Notifiche interne'); return; } $notes = collect(); $moduli = Module::getAll()->where('permission', '<>', '-'); foreach ($moduli as $modulo) { $note = $modulo->notes()->whereNotNull('notification_date')->orderBy('notification_date', 'asc')->get(); $notes = $notes->merge($note); } if (!empty($is_number_request)) { echo $notes->count(); return; } if ($notes->count() < 1) { echo '

'.tr('Non ci sono note da notificare').'.

'; return; } $moduli = $notes->groupBy('id_module')->sortBy('notification_date'); foreach ($moduli as $module_id => $note) { $modulo = Module::pool($module_id); echo '

'.$modulo->title.'

'; foreach ($note as $nota) { echo ' '; } echo '
'.tr('Record').' '.tr('Contenuto').' '.tr('Data di notifica').' #
'.$nota->id_record.' '.$nota->content.' '.$nota->user->nome_completo.' '.dateFormat($nota->notification_date).' ('.Carbon::parse($nota->notification_date)->diffForHumans().') '.Modules::link($module_id, $nota->id_record, '', null, 'class="btn btn-primary btn-xs"', true, 'tab_note').'
'; }