diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 413de33db1f..38a316f4357 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -470,6 +470,9 @@ $newcardbutton = ''; if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { $tmpforcreatebutton = dol_getdate(dol_now(), true); + if(empty($newparam)) { + $newparam = ''; + } $newparam .= '&month='.urlencode(str_pad($month, 2, "0", STR_PAD_LEFT)).'&year='.urlencode($tmpforcreatebutton['year']); if ($begin_h !== '') { $newparam .= '&begin_h='.urlencode($begin_h); @@ -489,6 +492,9 @@ if ($user->rights->agenda->myactions->create || $user->rights->agenda->allaction $newcardbutton .= dolGetButtonTitle($langs->trans("AddAction"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : ''))); } +if(empty($num)) { + $num = ''; +} print_barre_liste($langs->trans("Agenda"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, -1, 'object_action', 0, $nav.''.$newcardbutton, '', $limit, 1, 0, 1, $viewmode); $link = ''; @@ -505,6 +511,9 @@ $s = $newtitle; print $s; print '
'; +if(empty($search_status)) { + $search_status = ''; +} print_actions_filter($form, $canedit, $search_status, $year, $month, $day, $showbirthday, 0, $filtert, 0, $pid, $socid, $action, -1, $actioncode, $usergroup, '', $resourceid); print '
'; @@ -1378,10 +1387,10 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & $ids1 = ''; $ids2 = ''; - if (is_array($cases1[$h]) && count($cases1[$h]) && array_keys($cases1[$h])) { + if (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) && array_keys($cases1[$h])) { $ids1 = join(',', array_keys($cases1[$h])); } - if (is_array($cases2[$h]) && count($cases2[$h]) && array_keys($cases2[$h])) { + if (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) && array_keys($cases2[$h])) { $ids2 = join(',', array_keys($cases2[$h])); } @@ -1390,7 +1399,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & } else { echo ''; } - if (is_array($cases1[$h]) && count($cases1[$h]) == 1) { // only 1 event + if (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) == 1) { // only 1 event $output = array_slice($cases1[$h], 0, 1); $title1 = $langs->trans("Ref").' '.$ids1.($title1 ? ' - '.$title1 : ''); if ($output[0]['string']) { @@ -1399,12 +1408,12 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if ($output[0]['color']) { $color1 = $output[0]['color']; } - } elseif (is_array($cases1[$h]) && count($cases1[$h]) > 1) { + } elseif (!empty($cases1[$h]) && is_array($cases1[$h]) && count($cases1[$h]) > 1) { $title1 = $langs->trans("Ref").' '.$ids1.($title1 ? ' - '.$title1 : ''); $color1 = '222222'; } - if (is_array($cases2[$h]) && count($cases2[$h]) == 1) { // only 1 event + if (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) == 1) { // only 1 event $output = array_slice($cases2[$h], 0, 1); $title2 = $langs->trans("Ref").' '.$ids2.($title2 ? ' - '.$title2 : ''); if ($output[0]['string']) { @@ -1413,7 +1422,7 @@ function show_day_events2($username, $day, $month, $year, $monthshown, $style, & if ($output[0]['color']) { $color2 = $output[0]['color']; } - } elseif (is_array($cases2[$h]) && count($cases2[$h]) > 1) { + } elseif (!empty($cases2[$h]) && is_array($cases2[$h]) && count($cases2[$h]) > 1) { $title2 = $langs->trans("Ref").' '.$ids2.($title2 ? ' - '.$title2 : ''); $color2 = '222222'; }