From 75b3fd442e00184292570fb565d7938aab945fae Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 14 Apr 2015 12:32:19 +0200 Subject: [PATCH] Add option to allow to filter list on project creation --- htdocs/core/class/html.form.class.php | 2 +- htdocs/projet/card.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index c661a3d7bda..63c4c1c8fe9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -868,7 +868,7 @@ class Form * * @param string $selected Preselected type * @param string $htmlname Name of field in form - * @param string $filter optional filters criteras (example: 's.rowid <> x') + * @param string $filter optional filters criteras (example: 's.rowid <> x', 's.client in (1,3)') * @param int $showempty Add an empty field * @param int $showtype Show third party type in combolist (customer, prospect or supplier) * @param int $forcecombo Force to use combo box diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index a971f9b51dd..4e5b182ada8 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -431,9 +431,11 @@ if ($action == 'create' && $user->rights->projet->creer) // Label print ''.$langs->trans("Label").''; - // Customer + // Thirdparty print ''.$langs->trans("ThirdParty").''; - $text=$form->select_company(GETPOST('socid','int'),'socid','',1,1); + $filteronlist=''; + if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; + $text=$form->select_thirdparty_list(GETPOST('socid','int'),'socid',$filteronlist,1,1); if (empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) && empty($conf->dol_use_jmobile)) { $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); @@ -576,7 +578,9 @@ else // Customer print ''.$langs->trans("ThirdParty").''; - $text=$form->select_company($object->thirdparty->id,'socid','',1,1); + $filteronlist=''; + if (! empty($conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST)) $filteronlist=$conf->global->PROJECT_FILTER_FOR_THIRDPARTY_LIST; + $text=$form->select_thirdparty_list($object->thirdparty->id,'socid',$filteronlist,1,1); $texthelp=$langs->trans("IfNeedToUseOhterObjectKeepEmpty"); print $form->textwithtooltip($text.' '.img_help(),$texthelp,1); print '';