diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index f08210d3fc9..4f8b8509f4e 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -397,7 +397,7 @@ if ($actioncode || GETPOSTISSET('search_actioncode')) { if ($resourceid > 0) { $param .= "&search_resourceid=".urlencode($resourceid); } -if ($status || GETPOSTISSET('status')) { +if ($status || GETPOSTISSET('status') || GETPOSTISSET('search_status')) { $param .= "&search_status=".urlencode($status); } if ($filter) { @@ -622,7 +622,7 @@ if (!empty($conf->use_javascript_ajax)) { // If javascript on $s .= '
 
'; // Calendars from hooks - $parameters = array(); $object = null; + $parameters = array(); $reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action); if (empty($reshook)) { $s .= $hookmanager->resPrint; @@ -1213,7 +1213,7 @@ if (count($listofextcals)) { $addevent = true; } elseif (!is_array($icalevent['DTSTART'])) { // not fullday event (DTSTART is not array. It is a value like '19700101T000000Z' for 00:00 in greenwitch) $datestart = $icalevent['DTSTART']; - $dateend = $icalevent['DTEND']; + $dateend = empty($icalevent['DTEND']) ? $datestart : $icalevent['DTEND']; $datestart += +($offsettz * 3600); $dateend += +($offsettz * 3600); diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index eee8baa2b20..9869bd2d305 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -93,15 +93,15 @@ if (empty($user->rights->agenda->allactions->read) || $filter == 'mine') { // I } $mode = 'show_pertype'; -$resourceid = GETPOST("search_resourceid", "int") ?GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); -$year = GETPOST("year", "int") ?GETPOST("year", "int") : date("Y"); -$month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m"); -$week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); -$day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); -$pid = GETPOST("search_projectid", "int", 3) ?GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); -$status = GETPOST("search_status", 'alpha') ?GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha'); -$type = GETPOST("search_type", 'alpha') ?GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); -$maxprint = ((GETPOST("maxprint", 'int') != '') ?GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); +$resourceid = GETPOST("search_resourceid", "int") ? GETPOST("search_resourceid", "int") : GETPOST("resourceid", "int"); +$year = GETPOST("year", "int") ? GETPOST("year", "int") : date("Y"); +$month = GETPOST("month", "int") ? GETPOST("month", "int") : date("m"); +$week = GETPOST("week", "int") ? GETPOST("week", "int") : date("W"); +$day = GETPOST("day", "int") ? GETPOST("day", "int") : date("d"); +$pid = GETPOSTISSET("search_projectid") ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); +$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha'); +$type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); +$maxprint = ((GETPOST("maxprint", 'int') != '') ? GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) if (GETPOST('search_actioncode', 'array')) { @@ -144,7 +144,7 @@ $tmparray = explode('-', $tmp); $begin_d = 1; $end_d = 53; -if ($status == '' && !GETPOSTISSET('status')) { +if ($status == '' && !GETPOSTISSET('search_status')) { $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } if (empty($mode) && !GETPOSTISSET('mode')) { @@ -164,6 +164,8 @@ if (GETPOST('viewyear', 'alpha') || $mode == 'show_year') { $mode = 'show_year'; } // View by year +$object = new ActionComm($db); + // Load translation files required by the page $langs->loadLangs(array('users', 'agenda', 'other', 'commercial')); @@ -175,6 +177,8 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } +$search_status = $status; + /* * Actions @@ -276,7 +280,7 @@ if ($actioncode || GETPOSTISSET('search_actioncode')) { if ($resourceid > 0) { $param .= "&search_resourceid=".urlencode($resourceid); } -if ($status || GETPOSTISSET('status')) { +if ($status || GETPOSTISSET('status') || GETPOSTISSET('search_status')) { $param .= "&search_status=".urlencode($status); } if ($filter) { @@ -402,7 +406,7 @@ if ($conf->use_javascript_ajax) { //$s.='
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; // Calendars from hooks - $parameters = array(); $object = null; + $parameters = array(); $reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action); if (empty($reshook)) { $s .= $hookmanager->resPrint; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 957ccd6e361..68c9088815d 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -98,9 +98,9 @@ $year = GETPOST("year", "int") ?GETPOST("year", "int") : date("Y"); $month = GETPOST("month", "int") ?GETPOST("month", "int") : date("m"); $week = GETPOST("week", "int") ?GETPOST("week", "int") : date("W"); $day = GETPOST("day", "int") ?GETPOST("day", "int") : date("d"); -$pid = GETPOST("search_projectid", "int", 3) ?GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); -$status = GETPOST("search_status", 'alpha') ?GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha'); -$type = GETPOST("search_type", 'alpha') ?GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); +$pid = GETPOSTISSET("search_projectid") ? GETPOST("search_projectid", "int", 3) : GETPOST("projectid", "int", 3); +$status = GETPOSTISSET("search_status") ? GETPOST("search_status", 'alpha') : GETPOST("status", 'alpha'); +$type = GETPOSTISSET("search_type") ? GETPOST("search_type", 'alpha') : GETPOST("type", 'alpha'); $maxprint = ((GETPOST("maxprint", 'int') != '') ?GETPOST("maxprint", 'int') : $conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print') // Set actioncode (this code must be same for setting actioncode into peruser, listacton and index) @@ -153,9 +153,10 @@ if ($end_d < $begin_d) { $end_d = $begin_d + 1; } -if ($status == '' && !GETPOSTISSET('status')) { +if ($status == '' && !GETPOSTISSET('search_status')) { $status = (empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_STATUS); } + if (empty($mode) && !GETPOSTISSET('mode')) { $mode = (empty($conf->global->AGENDA_DEFAULT_VIEW) ? 'show_month' : $conf->global->AGENDA_DEFAULT_VIEW); } @@ -170,6 +171,8 @@ if (GETPOST('viewday', 'alpha') || $mode == 'show_day') { $mode = 'show_day'; $day = ($day ? $day : date("d")); } // View by day +$object = new ActionComm($db); + // Load translation files required by the page $langs->loadLangs(array('users', 'agenda', 'other', 'commercial')); @@ -181,6 +184,8 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } +$search_status = $status; + /* * Actions @@ -282,7 +287,8 @@ if ($actioncode || GETPOSTISSET('search_actioncode')) { if ($resourceid > 0) { $param .= "&search_resourceid=".urlencode($resourceid); } -if ($status || GETPOSTISSET('status')) { + +if ($status || GETPOSTISSET('status') || GETPOSTISSET('search_status')) { $param .= "&search_status=".urlencode($status); } if ($filter) { @@ -412,7 +418,7 @@ if ($conf->use_javascript_ajax) { //$s.='
'.$langs->trans("AgendaShowBirthdayEvents").'  
'; // Calendars from hooks - $parameters = array(); $object = null; + $parameters = array(); $reshook = $hookmanager->executeHooks('addCalendarChoice', $parameters, $object, $action); if (empty($reshook)) { $s .= $hookmanager->resPrint; @@ -509,9 +515,7 @@ $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 '
'; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fce76bff178..d6f3e57cb07 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -7792,7 +7792,7 @@ class Form if (is_array($tmpvalue)) { $value = $tmpvalue['label']; $disabled = empty($tmpvalue['disabled']) ? '' : ' disabled'; - $style = empty($tmpvalue['css']) ? ' class="'.$tmpvalue['css'].'"' : ''; + $style = empty($tmpvalue['css']) ? '' : ' class="'.$tmpvalue['css'].'"'; } else { $value = $tmpvalue; $disabled = ''; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 6f10ada3267..9e50dd2c47d 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -3748,7 +3748,7 @@ class User extends CommonObject */ public function findUserIdByEmail($email) { - if ($this->findUserIdByEmailCache[$email]) { + if (isset($this->findUserIdByEmailCache[$email])) { return $this->findUserIdByEmailCache[$email]; }