. */ include_once __DIR__.'/../../../core.php'; use Carbon\Carbon; use Models\Module; if (!empty($is_title_request)) { echo tr('Note 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::find($module_id); echo ''.(($modulo->getTranslation('title') == 'Anagrafiche') ? '' : tr('Riferimento')).' | '.($modulo->getTranslation('title') == 'Anagrafiche' ? 'Tecnico' : (($modulo->getTranslation('title') == 'Fatture di acquisto' || $modulo->getTranslation('title') == 'Ordini fornitore' || $modulo->getTranslation('title') == 'Ddt in entrata') ? tr('Fornitore') : tr('Cliente'))).' | '.tr('Contenuto').' | '.tr('Data di notifica').' | # |
---|---|---|---|---|
'.($documento['numero'] == null ? ' - ' : $documento['numero']).' | '.$documento['ragione_sociale'].' | '.$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').' |