From 68cbd4699bc28b9f4d6b1418bc293b59ed4deb17 Mon Sep 17 00:00:00 2001 From: Alexis Algoud Date: Mon, 9 Nov 2015 17:18:23 +0100 Subject: [PATCH] NEW multi event type for filter and get form in order to allow bookmark --- htdocs/comm/action/index.php | 6 ++++-- htdocs/core/class/html.form.class.php | 2 +- htdocs/core/class/html.formactions.class.php | 13 +++++++++++-- htdocs/core/lib/agenda.lib.php | 5 +++-- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index dd2bd1dd9c3..9b466e3d9b7 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -87,7 +87,9 @@ $pid=GETPOST("projectid","int",3); $status=GETPOST("status"); $type=GETPOST("type"); $maxprint=(isset($_GET["maxprint"])?GETPOST("maxprint"):$conf->global->AGENDA_MAX_EVENTS_DAY_VIEW); -$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':''); +$actioncode=GETPOST("actioncode","array",3) ? GETPOST("actioncode","array",3):(GETPOST("actioncode")=='0'?'0':''); +if(is_array($actioncode))$actioncode =implode(',', $actioncode); + if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); @@ -437,7 +439,7 @@ if ($filtert > 0 || $usergroup > 0) $sql.=", ".MAIN_DB_PREFIX."actioncomm_resour if ($usergroup > 0) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; $sql.= ' WHERE a.fk_action = ca.id'; $sql.= ' AND a.entity IN ('.getEntity('agenda', 1).')'; -if ($actioncode) $sql.=" AND ca.code='".$db->escape($actioncode)."'"; +if ($actioncode) $sql.=" AND ca.code IN ('".implode("','", explode(',',$actioncode))."')"; if ($pid) $sql.=" AND a.fk_project=".$db->escape($pid); if (! $user->rights->societe->client->voir && ! $socid) $sql.= " AND (a.fk_soc IS NULL OR sc.fk_user = " .$user->id . ")"; if ($socid > 0) $sql.= ' AND a.fk_soc = '.$socid; diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 10f5fc25695..9c7e0ab1823 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -4670,7 +4670,7 @@ class Form foreach ($array as $key => $value) { $out.= '