diff --git a/htdocs/admin/agenda.php b/htdocs/admin/agenda.php index cd07b4db587..57edea39a32 100644 --- a/htdocs/admin/agenda.php +++ b/htdocs/admin/agenda.php @@ -38,6 +38,7 @@ $langs->load("agenda"); $action = GETPOST('action','alpha'); $cancel = GETPOST('cancel','alpha'); +$search_event = GETPOST('search_event', 'alpha'); // Get list of triggers available $sql = "SELECT a.rowid, a.code, a.label, a.elementtype"; @@ -70,6 +71,12 @@ else * Actions */ +// Purge search criteria +if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x','alpha') ||GETPOST('button_removefilter','alpha')) // All tests are required to be compatible with all browsers +{ + $search_event = ''; +} + if ($action == "save" && empty($cancel)) { $i=0; @@ -78,10 +85,13 @@ if ($action == "save" && empty($cancel)) foreach ($triggers as $trigger) { - $param='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; + $keyparam='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; //print "param=".$param." - ".$_POST[$param]; - $res = dolibarr_set_const($db,$param,(GETPOST($param,'alpha')?GETPOST($param,'alpha'):''),'chaine',0,'',$conf->entity); - if (! $res > 0) $error++; + if ($search_event === '' || preg_match('/'.preg_quote($search_event,'/').'/i', $keyparam)) + { + $res = dolibarr_set_const($db,$keyparam,(GETPOST($keyparam,'alpha')?GETPOST($keyparam,'alpha'):''),'chaine',0,'',$conf->entity); + if (! $res > 0) $error++; + } } if (! $error) @@ -140,6 +150,8 @@ print '
'; print ''; print ''; +$param = ''; +$param.= '&search_event='.urlencode($search_event); $head=agenda_prepare_head(); @@ -151,8 +163,19 @@ print "
\n"; print ''; print ''; -print ''; -print ''; +print ''; +// Action column +print ''; +print ''; +print ''."\n"; +print ''; +print ''; +print ''; +print ''; print ''."\n"; // Show each trigger (list is in c_action_trigger) if (! empty($triggers)) @@ -173,15 +196,17 @@ if (! empty($triggers)) if ($trigger['code'] == 'FICHINTER_CLASSIFY_BILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue; if ($trigger['code'] == 'FICHINTER_CLASSIFY_UNBILLED' && empty($conf->global->FICHINTER_CLASSIFY_BILLED)) continue; - - print ''; - print ''; - print ''; - print ''."\n"; + if ($search_event === '' || preg_match('/'.preg_quote($search_event,'/').'/i', $trigger['code'])) + { + print ''; + print ''; + print ''; + print ''."\n"; + } } } } diff --git a/htdocs/admin/agenda_other.php b/htdocs/admin/agenda_other.php index a999db51857..ab53bfb937f 100644 --- a/htdocs/admin/agenda_other.php +++ b/htdocs/admin/agenda_other.php @@ -352,6 +352,15 @@ else } print ''."\n"; +// AGENDA_DEFAULT_VIEW +print ''."\n"; +print ''."\n"; +print ''."\n"; +print ''."\n"; + if (! empty($conf->global->AGENDA_USE_EVENT_TYPE)) { @@ -381,15 +390,6 @@ print ''."\n"; -// AGENDA_DEFAULT_VIEW -print ''."\n"; -print ''."\n"; -print ''."\n"; -print ''."\n"; - print '
'.$langs->trans("ActionsEvents").''.$langs->trans("All").'/'.$langs->trans("None").''; +print ''; +$searchpicto=$form->showFilterButtons(); +print $searchpicto; +print '
'.$langs->trans("ActionsEvents").''.$langs->trans("All").'/'.$langs->trans("None").'
'.$trigger['code'].''.$trigger['label'].''; - $key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; - $value=$conf->global->$key; - print ''; - print '
'.$trigger['code'].''.$trigger['label'].''; + $key='MAIN_AGENDA_ACTIONAUTO_'.$trigger['code']; + $value=$conf->global->$key; + print ''; + print '
'.$langs->trans("AGENDA_DEFAULT_VIEW").' '."\n"; +$tmplist=array('show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); +print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); +print '
'."\n"; $formactions->form_select_status_action('agenda', $conf->global->AGENDA_DEFAULT_FILTER_STATUS, 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100'); print '
'.$langs->trans("AGENDA_DEFAULT_VIEW").' '."\n"; -$tmplist=array('show_list'=>$langs->trans("ViewList"), 'show_month'=>$langs->trans("ViewCal"), 'show_week'=>$langs->trans("ViewWeek"), 'show_day'=>$langs->trans("ViewDay"), 'show_peruser'=>$langs->trans("ViewPerUser")); -print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, $conf->global->AGENDA_DEFAULT_VIEW); -print '
'; dol_fiche_end();