Look and feel v18

This commit is contained in:
Laurent Destailleur
2023-03-12 13:55:33 +01:00
parent 29417861db
commit 60fe730a48
13 changed files with 368 additions and 259 deletions

View File

@@ -120,9 +120,38 @@ function fichinter_prepare_head($object)
$head[$h][2] = 'documents';
$h++;
$head[$h][0] = DOL_URL_ROOT.'/fichinter/info.php?id='.$object->id;
$head[$h][1] = $langs->trans('Info');
$head[$h][2] = 'info';
$head[$h][0] = DOL_URL_ROOT.'/fichinter/agenda.php?id='.$object->id;
$head[$h][1] = $langs->trans('Events');
if (isModEnabled('agenda')&& (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read))) {
$nbEvent = 0;
// Enable caching of thirdparty count actioncomm
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
$cachekey = 'count_events_fichinter_'.$object->id;
$dataretrieved = dol_getcache($cachekey);
if (!is_null($dataretrieved)) {
$nbEvent = $dataretrieved;
} else {
$sql = "SELECT COUNT(id) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm";
$sql .= " WHERE fk_element = ".((int) $object->id);
$sql .= " AND elementtype = 'fichinter'";
$resql = $db->query($sql);
if ($resql) {
$obj = $db->fetch_object($resql);
$nbEvent = $obj->nb;
} else {
dol_syslog('Failed to count actioncomm '.$db->lasterror(), LOG_ERR);
}
dol_setcache($cachekey, $nbEvent, 120); // If setting cache fails, this is not a problem, so we do not test result.
}
$head[$h][1] .= '/';
$head[$h][1] .= $langs->trans("Agenda");
if ($nbEvent > 0) {
$head[$h][1] .= '<span class="badge marginleftonlyshort">'.$nbEvent.'</span>';
}
}
$head[$h][2] = 'agenda';
$h++;
complete_head_from_modules($conf, $langs, $object, $head, $h, 'intervention', 'add', 'external');