From 6e10abe427e097e3a3f76e94fae3bc69e9e4c10e Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 27 May 2020 15:51:25 +0200 Subject: [PATCH] [NEW] Save filter of the project homepage Save the filter into the user parameters --- htdocs/projet/index.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index f4edfdea548..a3bf3be14a6 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -39,8 +39,10 @@ $hookmanager->initHooks(array('projectsindex')); // Load translation files required by the page $langs->loadLangs(array('projects', 'companies')); +$action = GETPOST('action', 'alpha'); $search_project_user = GETPOST('search_project_user', 'int'); $mine = GETPOST('mode', 'aZ09') == 'mine' ? 1 : 0; +if ($mine == 0 && $search_project_user === '') $search_project_user = $user->conf->MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX; if ($search_project_user == $user->id) $mine = 1; // Security check @@ -54,6 +56,24 @@ $sortorder = GETPOST("sortorder", 'alpha'); $max = 3; +/* + * Actions + */ + +$parameters = array(); +$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks +if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); +if (empty($reshook)) { + if ($action == 'refresh_search_project_user') { + $search_project_user = GETPOST('search_project_user', 'int'); + $tabparam = array("MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX" => $search_project_user); + + include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php'; + $result = dol_set_user_param($db, $conf, $user, $tabparam); + } +} + + /* * View */ @@ -81,6 +101,7 @@ else $titleall = $langs->trans("AllAllowedProjects").'

'; $morehtml = ''; $morehtml .= '
'; $morehtml .= ''; +$morehtml .= ''; $morehtml .= '