From 977e7a18e2faa14c5ce2617af107d79f71489d49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sun, 30 Jun 2024 19:38:43 +0200 Subject: [PATCH 1/3] fix phpstan for 20.0 (#30205) --- .../stock/stocktransfer/class/stocktransfer.class.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php index dad116c1d0e..463b65ad548 100644 --- a/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php +++ b/htdocs/product/stock/stocktransfer/class/stocktransfer.class.php @@ -52,17 +52,6 @@ class StockTransfer extends CommonObject */ public $table_element_line = 'stocktransfer_stocktransferline'; - /** - * @var int Does this object support multicompany module ? - * 0=No test on entity, 1=Test with field entity, 'field@table'=Test with link by field@table - */ - public $ismultientitymanaged = 0; - - /** - * @var int Does object support extrafields ? 0=No, 1=Yes - */ - public $isextrafieldmanaged = 1; - /** * @var string Field with ID of parent key if this object has a parent */ From 90918f0687dd45f42a9c5df3999e25ddfa62298b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Jul 2024 00:42:46 +0200 Subject: [PATCH 2/3] Fix fatal error --- htdocs/projet/activity/index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index 2e257cf79bd..bb9ef4a29c5 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -66,6 +66,7 @@ $day = $tmp['mday']; $month = $tmp['mon']; $year = $tmp['year']; +$form = new Form($db); $projectstatic = new Project($db); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1); // Return all projects I have permission on because I want my tasks and some of my task may be on a public projet that is not my project $taskstatic = new Task($db); From 07c6e36a3a34cdd0da62a8c9a9ba450d288ee965 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 1 Jul 2024 01:22:04 +0200 Subject: [PATCH 3/3] Fix for #30170 --- htdocs/projet/activity/index.php | 47 +++++++++++++++++++++++++------- htdocs/projet/index.php | 15 +++++----- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/htdocs/projet/activity/index.php b/htdocs/projet/activity/index.php index bb9ef4a29c5..7c3e8fade96 100644 --- a/htdocs/projet/activity/index.php +++ b/htdocs/projet/activity/index.php @@ -31,17 +31,24 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; -$search_project_user = GETPOSTINT('search_project_user'); -$mine = GETPOST('mode', 'aZ09') == 'mine' ? 1 : 0; -if ($search_project_user == $user->id) { - $mine = 1; -} +// Load translation files required by the page +$langs->loadLangs(array('projects', 'companies')); $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('activityindex')); +$action = GETPOST('action', 'aZ09'); +$search_project_user = GETPOST('search_project_user'); +$mine = (GETPOST('mode', 'aZ09') == 'mine' || $search_project_user == $user->id) ? 1 : 0; +if ($mine == 0 && $search_project_user === '') { + $search_project_user = getDolGlobalString('MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX'); +} +if ($search_project_user == $user->id) { + $mine = 1; +} + // Security check $socid = 0; if ($user->socid > 0) { @@ -52,8 +59,25 @@ if (!$user->hasRight('projet', 'lire')) { accessforbidden(); } -// Load translation files required by the page -$langs->load("projects"); + +/* + * 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 = GETPOSTINT('search_project_user'); + $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); + } +} /* @@ -88,9 +112,12 @@ if ($user->hasRight('projet', 'all', 'lire') && !$socid) { $morehtml = ''; -$morehtml .= '
'; -$morehtml .= ''; +$morehtml .= ''; + +$morehtml .= ''; $morehtml .= ajax_combobox("search_project_user", array(), 0, 0, 'resolve', '-1', 'small'); diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php index 0a1d665780f..2795ec7988d 100644 --- a/htdocs/projet/index.php +++ b/htdocs/projet/index.php @@ -32,19 +32,19 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +// Load translation files required by the page +$langs->loadLangs(array('projects', 'companies')); + $hookmanager = new HookManager($db); // Initialize technical object to manage hooks. Note that conf->hooks_modules contains array $hookmanager->initHooks(array('projectsindex')); -// Load translation files required by the page -$langs->loadLangs(array('projects', 'companies')); - $action = GETPOST('action', 'aZ09'); -$search_project_user = GETPOSTINT('search_project_user'); -$mine = GETPOST('mode', 'aZ09') == 'mine' ? 1 : 0; +$search_project_user = GETPOST('search_project_user'); +$mine = (GETPOST('mode', 'aZ09') == 'mine' || $search_project_user == $user->id) ? 1 : 0; if ($mine == 0 && $search_project_user === '') { - $search_project_user = (empty($user->conf->MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX) ? '' : $user->conf->MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX); + $search_project_user = getDolGlobalString('MAIN_SEARCH_PROJECT_USER_PROJECTSINDEX'); } if ($search_project_user == $user->id) { $mine = 1; @@ -116,9 +116,10 @@ if ($user->hasRight('projet', 'all', 'lire') && !$socid) { } $morehtml = ''; -$morehtml .= ''; +$morehtml .= ''; $morehtml .= ''; $morehtml .= ''; + $morehtml .= '