mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Debug v21
This commit is contained in:
parent
34feedbb03
commit
0932c2e492
|
|
@ -1883,7 +1883,7 @@ class ActionComm extends CommonObject
|
|||
$color = 'style="color: #'.$this->type_color.' !important;"';
|
||||
}
|
||||
if ($this->type_picto) {
|
||||
$imgpicto = img_picto($titlealt.'rr', $this->type_picto, '', 0, 0, 0, '', ($morecss ? ' '.$morecss : ''));
|
||||
$imgpicto = img_picto($titlealt, $this->type_picto, '', 0, 0, 0, '', ($morecss ? ' '.$morecss : ''));
|
||||
} else {
|
||||
if ($this->type_code == 'AC_RDV') {
|
||||
$imgpicto = img_picto($titlealt, 'meeting', $color, 0, 0, 0, '', ($morecss ? ' '.$morecss : ''));
|
||||
|
|
|
|||
|
|
@ -33,14 +33,13 @@
|
|||
|
||||
// Load Dolibarr environment
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
|
||||
if (isModEnabled('project')) {
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
}
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
/**
|
||||
* @var Conf $conf
|
||||
|
|
@ -50,14 +49,7 @@ if (isModEnabled('project')) {
|
|||
* @var User $user
|
||||
*/
|
||||
|
||||
if (!isset($conf->global->AGENDA_MAX_EVENTS_DAY_VIEW)) {
|
||||
$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW = 3;
|
||||
}
|
||||
|
||||
if (!getDolGlobalString('AGENDA_EXT_NB')) {
|
||||
$conf->global->AGENDA_EXT_NB = 5;
|
||||
}
|
||||
$MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB');
|
||||
$MAXAGENDA = getDolGlobalString('AGENDA_EXT_NB', 5);
|
||||
$DELAYFORCACHE = 300; // 300 seconds
|
||||
|
||||
$disabledefaultvalues = GETPOSTINT('disabledefaultvalues');
|
||||
|
|
@ -122,10 +114,10 @@ $year = GETPOSTINT("year") ? GETPOSTINT("year") : date("Y");
|
|||
$month = GETPOSTINT("month") ? GETPOSTINT("month") : date("m");
|
||||
$week = GETPOSTINT("week") ? GETPOSTINT("week") : date("W");
|
||||
$day = GETPOSTINT("day") ? GETPOSTINT("day") : date("d");
|
||||
$pid = GETPOSTINT("search_projectid", 3) ? GETPOSTINT("search_projectid", 3) : GETPOSTINT("projectid", 3);
|
||||
$pid = GETPOSTISSET("search_projectid") ? GETPOSTINT("search_projectid", 3) : GETPOSTINT("projectid", 3);
|
||||
$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'aZ09') : GETPOST("status", 'aZ09'); // status may be 0, 50, 100, 'todo', 'na' or -1
|
||||
$type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'aZ09') : GETPOST("type", 'aZ09');
|
||||
$maxprint = GETPOSTISSET("maxprint") ? GETPOSTINT("maxprint") : getDolGlobalInt('AGENDA_MAX_EVENTS_DAY_VIEW');
|
||||
$maxprint = GETPOSTISSET("maxprint") ? GETPOSTINT("maxprint") : getDolGlobalInt('AGENDA_MAX_EVENTS_DAY_VIEW', 3);
|
||||
$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
|
||||
|
||||
$dateselect = dol_mktime(0, 0, 0, GETPOSTINT('dateselectmonth'), GETPOSTINT('dateselectday'), GETPOSTINT('dateselectyear'));
|
||||
|
|
@ -149,7 +141,7 @@ if (is_scalar($actioncode) && $actioncode == '-1') {
|
|||
}
|
||||
|
||||
if ($status == '' && !GETPOSTISSET('search_status')) {
|
||||
$status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS);
|
||||
$status = ((!getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS') || $disabledefaultvalues) ? '' : getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS'));
|
||||
}
|
||||
|
||||
$defaultview = getDolGlobalString('AGENDA_DEFAULT_VIEW', 'show_month'); // default for app
|
||||
|
|
@ -253,14 +245,14 @@ if ($reshook < 0) {
|
|||
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
}
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("Agenda"), $help_url);
|
||||
|
||||
$form = new Form($db);
|
||||
$companystatic = new Societe($db);
|
||||
$contactstatic = new Contact($db);
|
||||
$userstatic = new User($db);
|
||||
|
||||
$help_url = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
|
||||
llxHeader('', $langs->trans("Agenda"), $help_url);
|
||||
|
||||
$now = dol_now();
|
||||
$nowarray = dol_getdate($now);
|
||||
$nowyear = $nowarray['year'];
|
||||
|
|
@ -407,9 +399,13 @@ if ($mode == 'show_day') {
|
|||
//print dol_print_date($firstdaytoshow,'dayhour').' '.dol_print_date($lastdaytoshow,'dayhour');
|
||||
|
||||
/*$title = $langs->trans("DoneAndToDoActions");
|
||||
if ($status == 'done') $title = $langs->trans("DoneActions");
|
||||
if ($status == 'todo') $title = $langs->trans("ToDoActions");
|
||||
*/
|
||||
if ($status == 'done') {
|
||||
$title = $langs->trans("DoneActions");
|
||||
}
|
||||
if ($status == 'todo') {
|
||||
$title = $langs->trans("ToDoActions");
|
||||
}
|
||||
*/
|
||||
|
||||
$param = '';
|
||||
if ($actioncode || GETPOSTISSET('search_actioncode')) {
|
||||
|
|
@ -428,10 +424,10 @@ if ($status || GETPOSTISSET('status') || GETPOSTISSET('search_status')) {
|
|||
$param .= "&search_status=".urlencode($status);
|
||||
}
|
||||
if ($filter) {
|
||||
$param .= "&search_filter=".urlencode($filter);
|
||||
$param .= "&search_filter=".urlencode((string) $filter);
|
||||
}
|
||||
if ($filtert) {
|
||||
$param .= "&search_filtert=".urlencode($filtert);
|
||||
$param .= "&search_filtert=".urlencode((string) $filtert);
|
||||
}
|
||||
if ($usergroup > 0) {
|
||||
$param .= "&search_usergroup=".urlencode((string) ($usergroup));
|
||||
|
|
@ -771,10 +767,14 @@ if ($resourceid > 0) {
|
|||
}
|
||||
// We must filter on assignment table
|
||||
if ($filtert > 0 || $usergroup > 0) {
|
||||
$sql .= ", ".MAIN_DB_PREFIX."actioncomm_resources as ar";
|
||||
}
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element";
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."actioncomm_resources as ar";
|
||||
$sql .= " ON ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
if ($filtert > 0) {
|
||||
$sql .= " AND ar.fk_element = ".((int) $filtert);
|
||||
}
|
||||
if ($usergroup > 0) {
|
||||
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element AND ugu.fk_usergroup = ".((int) $usergroup);
|
||||
}
|
||||
}
|
||||
$sql .= ' WHERE a.fk_action = ca.id';
|
||||
$sql .= ' AND a.entity IN ('.getEntity('agenda').')'; // bookcal is a "virtual view" of agenda
|
||||
|
|
@ -830,10 +830,6 @@ if ($search_sale && $search_sale != '-1') {
|
|||
if ($socid) {
|
||||
$sql .= " AND a.fk_soc = ".((int) $socid);
|
||||
}
|
||||
// We must filter on assignment table
|
||||
if ($filtert > 0 || $usergroup > 0) {
|
||||
$sql .= " AND ar.fk_actioncomm = a.id AND ar.element_type='user'";
|
||||
}
|
||||
//var_dump($day.' '.$month.' '.$year);
|
||||
if ($mode == 'show_day') {
|
||||
$sql .= " AND (";
|
||||
|
|
@ -866,7 +862,7 @@ if ($status == '0') {
|
|||
// To do (not started)
|
||||
$sql .= " AND a.percent = 0";
|
||||
}
|
||||
if ($status == 'na') {
|
||||
if ($status === 'na') {
|
||||
// Not applicable
|
||||
$sql .= " AND a.percent = -1";
|
||||
}
|
||||
|
|
@ -902,7 +898,7 @@ if ($search_categ_cus != -1) {
|
|||
}
|
||||
|
||||
// Sort on date
|
||||
$sql .= ' ORDER BY datep';
|
||||
$sql .= $db->order("datep");
|
||||
//print $sql;
|
||||
|
||||
dol_syslog("comm/action/index.php", LOG_DEBUG);
|
||||
|
|
@ -1170,8 +1166,8 @@ if ($user->hasRight("holiday", "read")) {
|
|||
$event->type = 'holiday';
|
||||
$event->type_picto = 'holiday';
|
||||
|
||||
$event->datep = $db->jdate($obj->date_start) + (empty($halfday) || $halfday == 1 ? 0 : 12 * 60 * 60 - 1);
|
||||
$event->datef = $db->jdate($obj->date_end) + (empty($halfday) || $halfday == -1 ? 24 : 12) * 60 * 60 - 1;
|
||||
$event->datep = $db->jdate($obj->date_start) + (empty($obj->halfday) || $obj->halfday == 1 ? 0 : 12 * 60 * 60 - 1);
|
||||
$event->datef = $db->jdate($obj->date_end) + (empty($obj->halfday) || $obj->halfday == -1 ? 24 : 12) * 60 * 60 - 1;
|
||||
$event->date_start_in_calendar = $event->datep;
|
||||
$event->date_end_in_calendar = $event->datef;
|
||||
|
||||
|
|
@ -1183,24 +1179,50 @@ if ($user->hasRight("holiday", "read")) {
|
|||
$event->percentage = 0;
|
||||
}
|
||||
|
||||
if ($obj->halfday == 1) {
|
||||
$event->label = $obj->lastname.' ('.$langs->trans("Morning").')';
|
||||
} elseif ($obj->halfday == -1) {
|
||||
$event->label = $obj->lastname.' ('.$langs->trans("Afternoon").')';
|
||||
} else {
|
||||
$event->label = $obj->lastname;
|
||||
}
|
||||
$event->label = $langs->trans("Holiday");
|
||||
|
||||
$daycursor = $event->date_start_in_calendar;
|
||||
$annee = (int) dol_print_date($daycursor, '%Y', 'tzuserrel');
|
||||
$mois = (int) dol_print_date($daycursor, '%m', 'tzuserrel');
|
||||
$jour = (int) dol_print_date($daycursor, '%d', 'tzuserrel');
|
||||
|
||||
$daycursorend = $event->date_end_in_calendar;
|
||||
$anneeend = (int) dol_print_date($daycursorend, '%Y', 'tzuserrel');
|
||||
$moisend = (int) dol_print_date($daycursorend, '%m', 'tzuserrel');
|
||||
$jourend = (int) dol_print_date($daycursorend, '%d', 'tzuserrel');
|
||||
|
||||
// daykey must be date that represent day box in calendar so must be a user time
|
||||
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
|
||||
$daykeygmt = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
|
||||
$ifornbofdays = 0;
|
||||
do {
|
||||
$eventarray[$daykey][] = $event;
|
||||
$ifornbofdays++;
|
||||
|
||||
$firstdayofholiday = ($ifornbofdays == 1);
|
||||
$lastdayofholiday = ($daykeygmt == dol_get_first_hour($event->date_end_in_calendar, 'gmt'));
|
||||
|
||||
/*
|
||||
var_dump(dol_print_date($daykeygmt, 'dayhour', 'gmt'));
|
||||
var_dump(dol_print_date(dol_get_first_hour($event->date_end_in_calendar, 'gmt'), 'dayhour', 'gmt'));
|
||||
var_dump($lastdayofholiday);
|
||||
var_dump($obj->halfday);
|
||||
*/
|
||||
|
||||
if ((in_array($obj->halfday, array(1, 2)) == 1 && $lastdayofholiday) || (in_array($obj->halfday, array(-1, 2)) && $firstdayofholiday)) {
|
||||
// We create a copy of event because we want tochange the label
|
||||
$newevent = dol_clone($event, 1);
|
||||
if (in_array($obj->halfday, array(1, 2)) && $lastdayofholiday) {
|
||||
$newevent->label .= ' ('.$langs->trans("Morning").')';
|
||||
} elseif (in_array($obj->halfday, array(-1, 2)) && $firstdayofholiday) {
|
||||
$newevent->label .= ' ('.$langs->trans("Afternoon").')';
|
||||
}
|
||||
$eventarray[$daykey][] = $newevent; // We need to use ->gtTypePicto, getXXXon object, so clone must be PHP clone.
|
||||
} else {
|
||||
$eventarray[$daykey][] = $event; // We can use the event unchanged
|
||||
}
|
||||
|
||||
$daykey += 60 * 60 * 24;
|
||||
$daykeygmt += 60 * 60 * 24;
|
||||
} while ($daykey <= $event->date_end_in_calendar);
|
||||
|
||||
$i++;
|
||||
|
|
@ -1951,6 +1973,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
if (!empty($cacheusers[$event->userownerid]->color)) {
|
||||
$color = $cacheusers[$event->userownerid]->color;
|
||||
}
|
||||
|
||||
/* May be we need this: if (getDolGlobalString('AGENDA_USE_COLOR_PER_EVENT_TYPE')) {
|
||||
$color = $event->type_color;
|
||||
}*/
|
||||
} elseif ($event->type_code == 'ICALEVENT') { // Event come from external ical file
|
||||
$numical++;
|
||||
if (!empty($event->icalname)) {
|
||||
|
|
@ -2092,7 +2118,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
//var_dump($event->userassigned);
|
||||
//var_dump($event->transparency);
|
||||
print '<table class="centpercent cal_event';
|
||||
print(empty($event->transparency) ? ' cal_event_notbusy' : ' cal_event_busy');
|
||||
print (empty($event->transparency) ? ' cal_event_notbusy' : ' cal_event_busy');
|
||||
//if (empty($event->transparency) && empty($conf->global->AGENDA_NO_TRANSPARENT_ON_NOT_BUSY)) print ' opacitymedium'; // Not busy
|
||||
print '" style="'.$h;
|
||||
$colortouse = $color;
|
||||
|
|
@ -2112,54 +2138,14 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
//print ' -moz-border-radius:4px;"';
|
||||
//print 'border: 1px solid #ccc" width="100%"';
|
||||
print '">';
|
||||
|
||||
// First the tr of the event (only one tr for event is used, but several td)
|
||||
print '<tr>';
|
||||
print '<td class="tdoverflow nobottom small centpercent '.($nowrapontd ? 'nowrap ' : '').'cal_event'.($event->type_code == 'BIRTHDAY' ? ' cal_event_birthday' : '').'">';
|
||||
print '<!-- left section of event -->';
|
||||
|
||||
$daterange = '';
|
||||
|
||||
if ($event->type_code == 'BIRTHDAY') {
|
||||
// It's birthday calendar
|
||||
$picb = '<i class="fas fa-birthday-cake inline-block valignmiddle"></i>';
|
||||
//$pice = '<i class="fas fa-briefcase inline-block"></i>';
|
||||
//$typea = ($objp->typea == 'birth') ? $picb : $pice;
|
||||
//var_dump($event);
|
||||
print $picb.' '.$langs->trans("Birthday").'<br>';
|
||||
//print img_picto($langs->trans("Birthday"), 'birthday-cake').' ';
|
||||
|
||||
$tmpid = $event->id;
|
||||
|
||||
if (empty($cachecontacts[$tmpid])) {
|
||||
$newcontact = new Contact($db);
|
||||
$newcontact->fetch($tmpid);
|
||||
$cachecontacts[$tmpid] = $newcontact;
|
||||
}
|
||||
print $cachecontacts[$tmpid]->getNomUrl(1, '', 0, '', -1, 0, 'valignmiddle inline-block');
|
||||
|
||||
//$event->picto = 'birthday-cake';
|
||||
//print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact');
|
||||
/*$listofcontacttoshow = '';
|
||||
$listofcontacttoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valignmiddle');
|
||||
print $listofcontacttoshow;
|
||||
*/
|
||||
} elseif ($event->type_code == 'HOLIDAY') {
|
||||
// It's holiday calendar
|
||||
$tmpholiday->fetch($event->id);
|
||||
|
||||
print $tmpholiday->getNomUrl(1, -1, 0, 'valignmiddle inline-block');
|
||||
|
||||
$tmpid = $tmpholiday->fk_user;
|
||||
if (empty($cacheusers[$tmpid])) {
|
||||
$newuser = new User($db);
|
||||
$newuser->fetch($tmpid);
|
||||
$cacheusers[$tmpid] = $newuser;
|
||||
}
|
||||
|
||||
$listofusertoshow = '';
|
||||
$listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valignmiddle inline-block');
|
||||
print $listofusertoshow;
|
||||
}
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('eventOptions', $parameters, $event, $action); // Note that $action and $object may have been modified by some hooks
|
||||
if ($reshook < 0) {
|
||||
|
|
@ -2174,41 +2160,49 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
}
|
||||
*/
|
||||
|
||||
// Date
|
||||
if (empty($event->fulldayevent)) {
|
||||
// Show hours (start ... end)
|
||||
$tmpyearstart = dol_print_date($event->date_start_in_calendar, '%Y', 'tzuserrel');
|
||||
$tmpmonthstart = dol_print_date($event->date_start_in_calendar, '%m', 'tzuserrel');
|
||||
$tmpdaystart = dol_print_date($event->date_start_in_calendar, '%d', 'tzuserrel');
|
||||
$tmpyearend = dol_print_date($event->date_end_in_calendar, '%Y', 'tzuserrel');
|
||||
$tmpmonthend = dol_print_date($event->date_end_in_calendar, '%m', 'tzuserrel');
|
||||
$tmpdayend = dol_print_date($event->date_end_in_calendar, '%d', 'tzuserrel');
|
||||
if ($event->type_code == 'BIRTHDAY') {
|
||||
// It's birthday calendar
|
||||
$picb = img_picto('', 'birthday-cake', 'class="pictofixedwidth"');
|
||||
print $picb.$langs->trans("Birthday").'<br>';
|
||||
}
|
||||
|
||||
// Hour start
|
||||
if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) {
|
||||
$daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuserrel');
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) {
|
||||
if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) {
|
||||
$daterange .= '-';
|
||||
// Date
|
||||
if ($event->type_code != 'HOLIDAY' && $event->type_code != 'BIRTHDAY') {
|
||||
if (empty($event->fulldayevent)) {
|
||||
// Show hours (start ... end)
|
||||
$tmpyearstart = dol_print_date($event->date_start_in_calendar, '%Y', 'tzuserrel');
|
||||
$tmpmonthstart = dol_print_date($event->date_start_in_calendar, '%m', 'tzuserrel');
|
||||
$tmpdaystart = dol_print_date($event->date_start_in_calendar, '%d', 'tzuserrel');
|
||||
$tmpyearend = dol_print_date($event->date_end_in_calendar, '%Y', 'tzuserrel');
|
||||
$tmpmonthend = dol_print_date($event->date_end_in_calendar, '%m', 'tzuserrel');
|
||||
$tmpdayend = dol_print_date($event->date_end_in_calendar, '%d', 'tzuserrel');
|
||||
|
||||
// Hour start
|
||||
if ($tmpyearstart == $annee && $tmpmonthstart == $mois && $tmpdaystart == $jour) {
|
||||
$daterange .= dol_print_date($event->date_start_in_calendar, 'hour', 'tzuserrel');
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) {
|
||||
if ($tmpyearstart == $tmpyearend && $tmpmonthstart == $tmpmonthend && $tmpdaystart == $tmpdayend) {
|
||||
$daterange .= '-';
|
||||
}
|
||||
//else
|
||||
//print '...';
|
||||
}
|
||||
//else
|
||||
//print '...';
|
||||
}
|
||||
}
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) {
|
||||
if ($tmpyearstart != $tmpyearend || $tmpmonthstart != $tmpmonthend || $tmpdaystart != $tmpdayend) {
|
||||
$daterange .= '...';
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) {
|
||||
if ($tmpyearstart != $tmpyearend || $tmpmonthstart != $tmpmonthend || $tmpdaystart != $tmpdayend) {
|
||||
$daterange .= '...';
|
||||
}
|
||||
}
|
||||
}
|
||||
// Hour end
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) {
|
||||
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) {
|
||||
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel');
|
||||
// Hour end
|
||||
if ($event->date_end_in_calendar && $event->date_start_in_calendar != $event->date_end_in_calendar) {
|
||||
if ($tmpyearend == $annee && $tmpmonthend == $mois && $tmpdayend == $jour) {
|
||||
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($showinfo) {
|
||||
print $langs->trans("EventOnFullDay")."<br>\n";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ($showinfo) {
|
||||
print $langs->trans("EventOnFullDay")."<br>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2216,7 +2210,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
$titletoshow = $daterange;
|
||||
$titletoshow .= ($titletoshow ? ' ' : '').dol_escape_htmltag($event->label);
|
||||
|
||||
if ($event->type_code != 'ICALEVENT') {
|
||||
if ($event->type_code != 'ICALEVENT' && $event->type_code != 'BIRTHDAY') {
|
||||
$savlabel = $event->label;
|
||||
$event->label = $titletoshow;
|
||||
// Note: List of users are inside $event->userassigned. Link may be clickable depending on permissions of user.
|
||||
|
|
@ -2242,8 +2236,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
$listofusertoshow .= $cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'valignmiddle inline-block');
|
||||
}
|
||||
|
||||
print $titletoshow;
|
||||
print $listofusertoshow.' ';
|
||||
if ($event->type_code != 'BIRTHDAY') {
|
||||
print $titletoshow;
|
||||
print $listofusertoshow.' ';
|
||||
}
|
||||
|
||||
if ($event->type_code == 'ICALEVENT') {
|
||||
print '<br>('.dol_trunc($event->icalname, $maxnbofchar).')';
|
||||
|
|
@ -2263,7 +2259,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
$thirdparty = $cachethirdparties[$thirdparty_id];
|
||||
}
|
||||
if (!empty($thirdparty->id)) {
|
||||
$linerelatedto .= $thirdparty->getNomUrl(1, '', 0, 0, -1, 0, '', 'valignmiddle inline-block');
|
||||
$linerelatedto .= $thirdparty->getNomUrl(1, '', 0, 0, -1, 0, '', 'valignmiddle inline'); // using inline-block make the content completely replace with ... when too large
|
||||
}
|
||||
}
|
||||
if (!empty($contact_id) && $contact_id > 0) {
|
||||
|
|
@ -2278,7 +2274,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
$linerelatedto .= ' ';
|
||||
}
|
||||
if (!empty($contact->id)) {
|
||||
$linerelatedto .= $contact->getNomUrl(1, '', 0, '', -1, 0, 'valignmiddle inline-block');
|
||||
$linerelatedto .= $contact->getNomUrl(1, '', 0, '', -1, 0, 'valignmiddle inline'); // using inline-block make the content completely replace with ... when too large
|
||||
}
|
||||
}
|
||||
if (!empty($event->fk_element) && $event->fk_element > 0 && !empty($event->elementtype) && getDolGlobalString('AGENDA_SHOW_LINKED_OBJECT')) {
|
||||
|
|
@ -2296,6 +2292,24 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
}
|
||||
}
|
||||
|
||||
if ($event->type_code == 'HOLIDAY') {
|
||||
// It's holiday calendar
|
||||
$tmpholiday->fetch($event->id);
|
||||
|
||||
//print $tmpholiday->getNomUrl(1, -1, 0, 'valignmiddle inline-block');
|
||||
|
||||
$tmpid = $tmpholiday->fk_user;
|
||||
if (empty($cacheusers[$tmpid])) {
|
||||
$newuser = new User($db);
|
||||
$newuser->fetch($tmpid);
|
||||
$cacheusers[$tmpid] = $newuser;
|
||||
}
|
||||
|
||||
$listofusertoshow = '';
|
||||
$listofusertoshow .= "\n".'<br>'.$cacheusers[$tmpid]->getNomUrl(-1, '', 0, 0, 0, 0, '', 'paddingright valignmiddle inline-block')."\n";
|
||||
print $listofusertoshow;
|
||||
}
|
||||
|
||||
// Show location
|
||||
if ($showinfo) {
|
||||
if ($event->location) {
|
||||
|
|
@ -2305,9 +2319,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||
}
|
||||
|
||||
print '</td>';
|
||||
|
||||
// Status - Percent
|
||||
$withstatus = 0;
|
||||
if ($event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') {
|
||||
if ($event->type_code != 'HOLIDAY' && $event->type_code != 'BIRTHDAY' && $event->type_code != 'ICALEVENT') {
|
||||
$withstatus = 1;
|
||||
if ($event->percentage >= 0) {
|
||||
$withstatus = 2;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -924,16 +924,15 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
|
|||
print '<table class="border centpercent">';
|
||||
|
||||
// Date To Birth
|
||||
print '<tr><td><label for="birthday">'.$langs->trans("DateOfBirth").'</label></td><td>';
|
||||
print '<tr><td class="titlefieldcreate"><label for="birthday">'.$langs->trans("DateOfBirth").'</label></td><td colspan="3">';
|
||||
$form = new Form($db);
|
||||
if ($object->birthday) {
|
||||
print $form->selectDate($object->birthday, 'birthday', 0, 0, 0, "perso", 1, 0);
|
||||
} else {
|
||||
print $form->selectDate('', 'birthday', 0, 0, 1, "perso", 1, 0);
|
||||
}
|
||||
print '</td>';
|
||||
|
||||
print '<td><label for="birthday_alert">'.$langs->trans("Alert").'</label>: ';
|
||||
print ' <label for="birthday_alert">'.$langs->trans("Alert").'</label> ';
|
||||
if (!empty($object->birthday_alert)) {
|
||||
print '<input type="checkbox" name="birthday_alert" id="birthday_alert" checked>';
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ $holidaystatic = new Holiday($db);
|
|||
// Update sold
|
||||
$result = $object->updateBalance();
|
||||
|
||||
$title = $langs->trans('CPTitreMenu');
|
||||
$title = $langs->trans('Holidays');
|
||||
$help_url = 'EN:Module_Holiday';
|
||||
|
||||
llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-holiday page-list');
|
||||
|
|
@ -542,9 +542,6 @@ if ($id > 0) { // For user tab
|
|||
|
||||
print '</div>';
|
||||
} else {
|
||||
$title = $langs->trans("ListeCP");
|
||||
|
||||
|
||||
$newcardbutton = '';
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
|
||||
$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# Dolibarr language file - Source file is en_US - holiday
|
||||
HRM=GRH
|
||||
Holidays=Congés
|
||||
Holiday=Demande de congés
|
||||
Holiday=Congés
|
||||
CPTitreMenu=Demande de congés
|
||||
MenuReportMonth=État mensuel
|
||||
MenuAddCP=Créer demande de congés
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user