mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-21 08:51:24 +01:00
NEW Can show the holidays on the agenda view.
This commit is contained in:
@@ -114,8 +114,7 @@ if ($status == '' && !GETPOSTISSET('search_status')) $status = (empty($conf->glo
|
|||||||
$defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
$defaultview = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW);
|
||||||
$defaultview = (empty($user->conf->AGENDA_DEFAULT_VIEW) ? $defaultview : $user->conf->AGENDA_DEFAULT_VIEW);
|
$defaultview = (empty($user->conf->AGENDA_DEFAULT_VIEW) ? $defaultview : $user->conf->AGENDA_DEFAULT_VIEW);
|
||||||
if (empty($action) && !GETPOSTISSET('action')) $action = $defaultview;
|
if (empty($action) && !GETPOSTISSET('action')) $action = $defaultview;
|
||||||
if ($action == 'default') // When action is default, we want a calendar view and not the list
|
if ($action == 'default') { // When action is default, we want a calendar view and not the list
|
||||||
{
|
|
||||||
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
|
$action = (($defaultview != 'show_list') ? $defaultview : 'show_month');
|
||||||
}
|
}
|
||||||
if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
|
if (GETPOST('viewcal', 'restricthtml') && GETPOST('action', 'alpha') != 'show_day' && GETPOST('action', 'alpha') != 'show_week') {
|
||||||
@@ -488,8 +487,8 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
|
|||||||
$s .= "\n".'<!-- Div to calendars selectors -->'."\n";
|
$s .= "\n".'<!-- Div to calendars selectors -->'."\n";
|
||||||
$s .= '<script type="text/javascript">'."\n";
|
$s .= '<script type="text/javascript">'."\n";
|
||||||
$s .= 'jQuery(document).ready(function () {'."\n";
|
$s .= 'jQuery(document).ready(function () {'."\n";
|
||||||
$s .= 'jQuery(".check_birthday").click(function() { console.log("Toggle birthday"); jQuery(".family_birthday").toggle(); });'."\n";
|
$s .= 'jQuery(".check_birthday").click(function() { console.log("Toggle birthdays"); jQuery(".family_birthday").toggle(); });'."\n";
|
||||||
$s .= 'jQuery(".family_birthday").toggle();'."\n";
|
$s .= 'jQuery(".check_holiday").click(function() { console.log("Toggle holidays"); jQuery(".family_holiday").toggle(); });'."\n";
|
||||||
if ($action == "show_week" || $action == "show_month" || empty($action))
|
if ($action == "show_week" || $action == "show_month" || empty($action))
|
||||||
{
|
{
|
||||||
// Code to enable drag and drop
|
// Code to enable drag and drop
|
||||||
@@ -511,6 +510,9 @@ if (!empty($conf->use_javascript_ajax)) // If javascript on
|
|||||||
// Local calendar
|
// Local calendar
|
||||||
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' </div>';
|
$s .= '<div class="nowrap inline-block minheight30"><input type="checkbox" id="check_mytasks" name="check_mytasks" checked disabled> '.$langs->trans("LocalAgenda").' </div>';
|
||||||
|
|
||||||
|
// Holiday calendar
|
||||||
|
$s .= '<div class="nowrap inline-block"><input type="checkbox" id="check_holiday" name="check_holiday" class="check_holiday"><label for="check_holiday"> <span class="check_holiday_text">'.$langs->trans("Holidays").'</span></label> </div>';
|
||||||
|
|
||||||
// External calendars
|
// External calendars
|
||||||
if (is_array($showextcals) && count($showextcals) > 0)
|
if (is_array($showextcals) && count($showextcals) > 0)
|
||||||
{
|
{
|
||||||
@@ -790,6 +792,7 @@ if ($showbirthday)
|
|||||||
while ($i < $num)
|
while ($i < $num)
|
||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$event = new ActionComm($db);
|
$event = new ActionComm($db);
|
||||||
|
|
||||||
$event->id = $obj->rowid; // We put contact id in action id for birthdays events
|
$event->id = $obj->rowid; // We put contact id in action id for birthdays events
|
||||||
@@ -811,23 +814,28 @@ if ($showbirthday)
|
|||||||
$event->percentage = 100;
|
$event->percentage = 100;
|
||||||
$event->fulldayevent = 1;
|
$event->fulldayevent = 1;
|
||||||
|
|
||||||
$event->date_start_in_calendar = $event->datep;
|
$event->date_start_in_calendar = $db->jdate($event->datep);
|
||||||
$event->date_end_in_calendar = $event->datef;
|
$event->date_end_in_calendar = $db->jdate($event->datef);
|
||||||
$event->ponctuel = 0;
|
$event->ponctuel = 0;
|
||||||
|
|
||||||
// Add an entry in actionarray for each day
|
// Add an entry in eventarray for each day
|
||||||
$daycursor = $event->date_start_in_calendar;
|
$daycursor = $event->datep;
|
||||||
$annee = dol_print_date($daycursor, '%Y');
|
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
|
||||||
$mois = dol_print_date($daycursor, '%m');
|
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
|
||||||
$jour = dol_print_date($daycursor, '%d');
|
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
|
||||||
|
|
||||||
$loop = true;
|
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
|
||||||
|
|
||||||
|
$eventarray[$daykey][] = $event;
|
||||||
|
|
||||||
|
/*$loop = true;
|
||||||
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
|
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
|
||||||
do {
|
do {
|
||||||
$eventarray[$daykey][] = $event;
|
$eventarray[$daykey][] = $event;
|
||||||
$daykey += 60 * 60 * 24;
|
$daykey += 60 * 60 * 24;
|
||||||
if ($daykey > $event->date_end_in_calendar) $loop = false;
|
if ($daykey > $event->date_end_in_calendar) $loop = false;
|
||||||
} while ($loop);
|
} while ($loop);
|
||||||
|
*/
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -835,30 +843,24 @@ if ($showbirthday)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// HOLIDAYS CALENDAR
|
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
|
||||||
//if ($conf->global->AGENDA_SHOW_HOLIDAYS)
|
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
|
||||||
//{
|
$sql .= " WHERE u.rowid = x.fk_user";
|
||||||
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
|
$sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
|
$sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
|
||||||
$sql .= " WHERE u.rowid = x.fk_user";
|
|
||||||
$sql .= " AND u.statut = '1'"; // Show only active users (0 = inactive user, 1 = active user)
|
|
||||||
$sql .= " AND (x.statut = '2' OR x.statut = '3')"; // Show only public leaves (2 = leave wait for approval, 3 = leave approved)
|
|
||||||
|
|
||||||
if ($action == 'show_day')
|
if ($action == 'show_day') {
|
||||||
{
|
|
||||||
// Request only leaves for the current selected day
|
// Request only leaves for the current selected day
|
||||||
$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin";
|
$sql .= " AND '".$db->escape($year)."-".$db->escape($month)."-".$db->escape($day)."' BETWEEN x.date_debut AND x.date_fin"; // date_debut and date_fin are date wihout time
|
||||||
} elseif ($action == 'show_week')
|
} elseif ($action == 'show_week') {
|
||||||
{
|
|
||||||
// TODO: Add filter to reduce database request
|
// TODO: Add filter to reduce database request
|
||||||
} elseif ($action == 'show_month')
|
} elseif ($action == 'show_month') {
|
||||||
{
|
|
||||||
// TODO: Add filter to reduce database request
|
// TODO: Add filter to reduce database request
|
||||||
}
|
}
|
||||||
|
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$num = $db->num_rows($resql);
|
$num = $db->num_rows($resql);
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
|
||||||
@@ -866,9 +868,6 @@ if ($showbirthday)
|
|||||||
{
|
{
|
||||||
$obj = $db->fetch_object($resql);
|
$obj = $db->fetch_object($resql);
|
||||||
|
|
||||||
$dateStartArray = dol_getdate(dol_stringtotime($obj->date_start, 1), true);
|
|
||||||
$dateEndArray = dol_getdate(dol_stringtotime($obj->date_end, 1), true);
|
|
||||||
|
|
||||||
$event = new ActionComm($db);
|
$event = new ActionComm($db);
|
||||||
|
|
||||||
// Need the id of the leave object for link to it
|
// Need the id of the leave object for link to it
|
||||||
@@ -881,8 +880,8 @@ if ($showbirthday)
|
|||||||
$event->type = 'holiday';
|
$event->type = 'holiday';
|
||||||
$event->type_picto = 'holiday';
|
$event->type_picto = 'holiday';
|
||||||
|
|
||||||
$event->datep = dol_mktime(0, 0, 0, $dateStartArray['mon'], $dateStartArray['mday'], $dateStartArray['year'], true);
|
$event->datep = $db->jdate($obj->date_start);
|
||||||
$event->datef = dol_mktime(0, 0, 0, $dateEndArray['mon'], $dateEndArray['mday'], $dateEndArray['year'], true);
|
$event->datef = $db->jdate($obj->date_end);
|
||||||
$event->date_start_in_calendar = $event->datep;
|
$event->date_start_in_calendar = $event->datep;
|
||||||
$event->date_end_in_calendar = $event->datef;
|
$event->date_end_in_calendar = $event->datef;
|
||||||
|
|
||||||
@@ -907,12 +906,11 @@ if ($showbirthday)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$daycursor = $event->date_start_in_calendar;
|
$daycursor = $event->date_start_in_calendar;
|
||||||
$annee = dol_print_date($daycursor, '%Y');
|
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
|
||||||
$mois = dol_print_date($daycursor, '%m');
|
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
|
||||||
$jour = dol_print_date($daycursor, '%d');
|
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
|
||||||
|
|
||||||
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee);
|
|
||||||
|
|
||||||
|
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
|
||||||
do {
|
do {
|
||||||
$eventarray[$daykey][] = $event;
|
$eventarray[$daykey][] = $event;
|
||||||
|
|
||||||
@@ -921,8 +919,7 @@ if ($showbirthday)
|
|||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
|
|
||||||
// EXTERNAL CALENDAR
|
// EXTERNAL CALENDAR
|
||||||
// Complete $eventarray with external import Ical
|
// Complete $eventarray with external import Ical
|
||||||
@@ -936,7 +933,7 @@ if (count($listofextcals))
|
|||||||
$offsettz = $extcal['offsettz'];
|
$offsettz = $extcal['offsettz'];
|
||||||
$colorcal = $extcal['color'];
|
$colorcal = $extcal['color'];
|
||||||
$buggedfile = $extcal['buggedfile'];
|
$buggedfile = $extcal['buggedfile'];
|
||||||
//print "url=".$url." namecal=".$namecal." colorcal=".$colorcal." buggedfile=".$buggedfile;
|
|
||||||
$ical = new ICal();
|
$ical = new ICal();
|
||||||
$ical->parse($url);
|
$ical->parse($url);
|
||||||
|
|
||||||
@@ -1177,15 +1174,15 @@ if (count($listofextcals))
|
|||||||
|
|
||||||
// Add an entry in actionarray for each day
|
// Add an entry in actionarray for each day
|
||||||
$daycursor = $event->date_start_in_calendar;
|
$daycursor = $event->date_start_in_calendar;
|
||||||
$annee = date('Y', $daycursor);
|
$annee = dol_print_date($daycursor, '%Y', 'tzuserrel');
|
||||||
$mois = date('m', $daycursor);
|
$mois = dol_print_date($daycursor, '%m', 'tzuserrel');
|
||||||
$jour = date('d', $daycursor);
|
$jour = dol_print_date($daycursor, '%d', 'tzuserrel');
|
||||||
|
|
||||||
// Loop on each day covered by action to prepare an index to show on calendar
|
// Loop on each day covered by action to prepare an index to show on calendar
|
||||||
$loop = true; $j = 0;
|
$loop = true; $j = 0;
|
||||||
// daykey must be date that represent day box in calendar so must be a user time
|
// 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);
|
$daykey = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
|
||||||
$daykeygmt = dol_mktime(0, 0, 0, $mois, $jour, $annee, true, 0);
|
$daykeygmt = dol_mktime(0, 0, 0, $mois, $jour, $annee, 'gmt');
|
||||||
do {
|
do {
|
||||||
//if ($event->fulldayevent) print dol_print_date($daykeygmt,'dayhour','gmt').'-'.dol_print_date($daykey,'dayhour','gmt').'-'.dol_print_date($event->date_end_in_calendar,'dayhour','gmt').' ';
|
//if ($event->fulldayevent) print dol_print_date($daykeygmt,'dayhour','gmt').'-'.dol_print_date($daykey,'dayhour','gmt').'-'.dol_print_date($event->date_end_in_calendar,'dayhour','gmt').' ';
|
||||||
$eventarray[$daykey][] = $event;
|
$eventarray[$daykey][] = $event;
|
||||||
@@ -1565,13 +1562,16 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
print '<div class="tagtd centpercent agendacell sortable">';
|
print '<div class="tagtd centpercent agendacell sortable">';
|
||||||
|
|
||||||
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
|
//$curtime = dol_mktime (0, 0, 0, $month, $day, $year);
|
||||||
$i = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array();
|
$i = 0; $ireallyshown = 0; $itoshow = 0; $numother = 0; $numbirthday = 0; $numical = 0; $numicals = array();
|
||||||
$ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
|
$ymd = sprintf("%04d", $year).sprintf("%02d", $month).sprintf("%02d", $day);
|
||||||
|
|
||||||
$colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0
|
$colorindexused[$user->id] = 0; // Color index for current user (user->id) is always 0
|
||||||
$nextindextouse = is_array($colorindexused) ?count($colorindexused) : 0; // At first run this is 0, so fist user has 0, next 1, ...
|
$nextindextouse = is_array($colorindexused) ?count($colorindexused) : 0; // At first run this is 0, so fist user has 0, next 1, ...
|
||||||
//var_dump($colorindexused);
|
//var_dump($colorindexused);
|
||||||
|
|
||||||
|
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
||||||
|
$tmpholiday = new Holiday($db);
|
||||||
|
|
||||||
foreach ($eventarray as $daykey => $notused)
|
foreach ($eventarray as $daykey => $notused)
|
||||||
{
|
{
|
||||||
$annee = dol_print_date($daykey, '%Y');
|
$annee = dol_print_date($daykey, '%Y');
|
||||||
@@ -1617,7 +1617,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
|
$cssclass = (!empty($event->icalname) ? 'family_ext'.md5($event->icalname) : 'family_other');
|
||||||
} elseif ($event->type_code == 'BIRTHDAY')
|
} elseif ($event->type_code == 'BIRTHDAY')
|
||||||
{
|
{
|
||||||
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday unmovable'; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
|
$numbirthday++; $colorindex = 2; $cssclass = 'family_birthday '; $color = sprintf("%02x%02x%02x", $theme_datacolor[$colorindex][0], $theme_datacolor[$colorindex][1], $theme_datacolor[$colorindex][2]);
|
||||||
} else {
|
} else {
|
||||||
$numother++;
|
$numother++;
|
||||||
$color = ($event->icalcolor ? $event->icalcolor : -1);
|
$color = ($event->icalcolor ? $event->icalcolor : -1);
|
||||||
@@ -1654,11 +1654,13 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$cssclass = $cssclass.' eventday_'.$ymd;
|
$cssclass = $cssclass.' eventday_'.$ymd;
|
||||||
|
|
||||||
// Defined style to disable drag and drop feature
|
// Defined style to disable drag and drop feature
|
||||||
if ($event->type_code == 'AC_OTH_AUTO')
|
if ($event->type_code == 'AC_OTH_AUTO') {
|
||||||
{
|
|
||||||
$cssclass .= " unmovable";
|
$cssclass .= " unmovable";
|
||||||
} elseif ($event->type_code == 'ICALEVENT')
|
} elseif ($event->type_code == 'HOLIDAY') {
|
||||||
{
|
$cssclass .= " unmovable";
|
||||||
|
} elseif ($event->type_code == 'BIRTHDAY') {
|
||||||
|
$cssclass .= " unmovable";
|
||||||
|
} elseif ($event->type_code == 'ICALEVENT') {
|
||||||
$cssclass .= " unmovable";
|
$cssclass .= " unmovable";
|
||||||
} elseif ($event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) {
|
} elseif ($event->date_end_in_calendar && date('Ymd', $event->date_start_in_calendar) != date('Ymd', $event->date_end_in_calendar)) {
|
||||||
$tmpyearend = date('Y', $event->date_end_in_calendar);
|
$tmpyearend = date('Y', $event->date_end_in_calendar);
|
||||||
@@ -1685,13 +1687,25 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
// Show event box
|
// Show event box
|
||||||
print "\n";
|
print "\n";
|
||||||
print '<!-- start event '.$i.' -->'."\n";
|
print '<!-- start event '.$i.' -->'."\n";
|
||||||
|
|
||||||
$morecss = '';
|
$morecss = '';
|
||||||
if ($maxprint && $i >= $maxprint) {
|
if ($maxprint && $ireallyshown >= $maxprint) {
|
||||||
$morecss = 'showifmore';
|
$morecss = 'showifmore';
|
||||||
}
|
}
|
||||||
if ($event->type == 'holiday' && !GETPOST('check_birthday')) {
|
if ($event->type == 'birthdate' && !GETPOST('check_birthday')) {
|
||||||
$morecss = 'hidden';
|
$morecss = 'hidden';
|
||||||
}
|
}
|
||||||
|
if ($event->type == 'holiday' && !GETPOST('check_holiday')) {
|
||||||
|
$morecss = 'hidden';
|
||||||
|
}
|
||||||
|
if ($morecss != 'hidden') {
|
||||||
|
$itoshow++;
|
||||||
|
}
|
||||||
|
if ($morecss != 'showifmore' && $morecss != 'hidden') {
|
||||||
|
$ireallyshown++;
|
||||||
|
}
|
||||||
|
//var_dump($event->type.' - '.$morecss.' - '.$cssclass.' - '.$i.' - '.$ireallyshown.' - '.$itoshow);
|
||||||
|
|
||||||
print '<div id="event_'.$ymd.'_'.$i.'" class="event family_'.$event->type.' '.$cssclass.($morecss ? ' '.$morecss : '').'"';
|
print '<div id="event_'.$ymd.'_'.$i.'" class="event family_'.$event->type.' '.$cssclass.($morecss ? ' '.$morecss : '').'"';
|
||||||
//print ' style="height: 100px;';
|
//print ' style="height: 100px;';
|
||||||
//print ' position: absolute; top: 40px; width: 50%;';
|
//print ' position: absolute; top: 40px; width: 50%;';
|
||||||
@@ -1730,7 +1744,19 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
if ($event->type_code == 'BIRTHDAY') { // It's birthday calendar
|
if ($event->type_code == 'BIRTHDAY') { // It's birthday calendar
|
||||||
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact');
|
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'birthday', 'contact');
|
||||||
} elseif ($event->type_code == 'HOLIDAY') { // It's holiday calendar
|
} elseif ($event->type_code == 'HOLIDAY') { // It's holiday calendar
|
||||||
print $event->getNomUrl(1, $maxnbofchar, 'cal_event', 'holiday', 'user');
|
$tmpholiday->fetch($event->id);
|
||||||
|
|
||||||
|
print $tmpholiday->getNomUrl(1);
|
||||||
|
|
||||||
|
$tmpid = $tmpholiday->fk_user;
|
||||||
|
if (empty($cacheusers[$tmpid])) {
|
||||||
|
$newuser = new User($db);
|
||||||
|
$newuser->fetch($tmpid);
|
||||||
|
$cacheusers[$tmpid] = $newuser;
|
||||||
|
}
|
||||||
|
|
||||||
|
$listofusertoshow .= '<br>'.$cacheusers[$tmpid]->getNomUrl(-3, '', 0, 0, 0, 0, '', 'paddingright valigntextbottom');
|
||||||
|
print $listofusertoshow;
|
||||||
} else { // Other calendar
|
} else { // Other calendar
|
||||||
// Picto
|
// Picto
|
||||||
if (empty($event->fulldayevent))
|
if (empty($event->fulldayevent))
|
||||||
@@ -1775,8 +1801,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel');
|
$daterange .= dol_print_date($event->date_end_in_calendar, 'hour', 'tzuserrel');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($showinfo)
|
if ($showinfo) {
|
||||||
{
|
|
||||||
print $langs->trans("EventOnFullDay")."<br>\n";
|
print $langs->trans("EventOnFullDay")."<br>\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1803,8 +1828,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
{
|
{
|
||||||
if (!$posuserassigned && $titletoshow) $listofusertoshow .= '<br>';
|
if (!$posuserassigned && $titletoshow) $listofusertoshow .= '<br>';
|
||||||
$posuserassigned++;
|
$posuserassigned++;
|
||||||
if (empty($cacheusers[$tmpid]))
|
if (empty($cacheusers[$tmpid])) {
|
||||||
{
|
|
||||||
$newuser = new User($db);
|
$newuser = new User($db);
|
||||||
$newuser->fetch($tmpid);
|
$newuser->fetch($tmpid);
|
||||||
$cacheusers[$tmpid] = $newuser;
|
$cacheusers[$tmpid] = $newuser;
|
||||||
@@ -1876,6 +1900,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
else print ' ';
|
else print ' ';
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
print '</div><!-- end event '.$i.' -->'."\n";
|
print '</div><!-- end event '.$i.' -->'."\n";
|
||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
} else {
|
} else {
|
||||||
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action='.$action.'&maxprint=0&month='.$monthshown.'&year='.$year;
|
print '<a href="'.DOL_URL_ROOT.'/comm/action/index.php?action='.$action.'&maxprint=0&month='.$monthshown.'&year='.$year;
|
||||||
@@ -1898,10 +1923,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
print ' ';
|
print ' ';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($conf->global->MAIN_JS_SWITCH_AGENDA) && $i > $maxprint && $maxprint)
|
if (!empty($conf->global->MAIN_JS_SWITCH_AGENDA) && $itoshow > $ireallyshown && $maxprint)
|
||||||
{
|
{
|
||||||
print '<div class="center cursorpointer" id="more_'.$ymd.'">'.img_picto("All", "angle-double-down", 'class="warning"').' +'.($i - $maxprint).'</div>';
|
print '<div class="center cursorpointer" id="more_'.$ymd.'">'.img_picto("All", "angle-double-down", 'class="warning"').' +'.($itoshow - $ireallyshown).'</div>';
|
||||||
//print ' +'.(count($eventarray[$daykey])-$maxprint);
|
//print ' +'.(count($eventarray[$daykey])-$maxprint);
|
||||||
|
|
||||||
print '<script type="text/javascript">'."\n";
|
print '<script type="text/javascript">'."\n";
|
||||||
print 'jQuery(document).ready(function () {'."\n";
|
print 'jQuery(document).ready(function () {'."\n";
|
||||||
print ' var open=0;'."\n";
|
print ' var open=0;'."\n";
|
||||||
@@ -1912,12 +1938,10 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
|
|||||||
print ' if (open) { ';
|
print ' if (open) { ';
|
||||||
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-up", 'class="warning"').'\');'."\n";
|
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-up", 'class="warning"').'\');'."\n";
|
||||||
print ' } else { ';
|
print ' } else { ';
|
||||||
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-down", 'class="warning"').' +'.($i - $maxprint).'\');'."\n";
|
print ' jQuery("#more_'.$ymd.'").html(\''.img_picto("All", "angle-double-down", 'class="warning"').' +'.($itoshow - $ireallyshown).'\');'."\n";
|
||||||
print ' }'."\n";
|
print ' }'."\n";
|
||||||
print ' }'."\n";
|
print ' }'."\n";
|
||||||
|
|
||||||
print '});'."\n";
|
print '});'."\n";
|
||||||
|
|
||||||
print '</script>'."\n";
|
print '</script>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1964,7 +1988,6 @@ function sort_events_by_date($a, $b)
|
|||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($b->type_code === 'HOLIDAY')
|
if ($b->type_code === 'HOLIDAY')
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@@ -3371,9 +3371,12 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
|
|||||||
$fakey = 'fa-'.$pictowithouttext;
|
$fakey = 'fa-'.$pictowithouttext;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($pictowithouttext, array('dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment'))) {
|
if (in_array($pictowithouttext, array('holiday', 'dollyrevert', 'member', 'members', 'contract', 'group', 'resource', 'shipment'))) {
|
||||||
$morecss = 'em092';
|
$morecss = 'em092';
|
||||||
}
|
}
|
||||||
|
if (in_array($pictowithouttext, array('holiday'))) {
|
||||||
|
$morecss = 'em088';
|
||||||
|
}
|
||||||
if (in_array($pictowithouttext, array('intervention', 'payment', 'loan', 'stock', 'technic'))) {
|
if (in_array($pictowithouttext, array('intervention', 'payment', 'loan', 'stock', 'technic'))) {
|
||||||
$morecss = 'em080';
|
$morecss = 'em080';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -203,6 +203,10 @@ div.mainmenu.generic4::before {
|
|||||||
font-size: 0.92em;
|
font-size: 0.92em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.menu_titre .em088 {
|
||||||
|
font-size: 0.88em;
|
||||||
|
}
|
||||||
|
|
||||||
.menu_titre .em080 {
|
.menu_titre .em080 {
|
||||||
font-size: 0.80em;
|
font-size: 0.80em;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user