Add option to allow to filter list on project creation

This commit is contained in:
Laurent Destailleur 2015-04-14 12:32:19 +02:00
parent f323e89919
commit 75b3fd442e
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -431,9 +431,11 @@ if ($action == 'create' && $user->rights->projet->creer)
// Label
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td><td><input size="40" type="text" name="title" value="'.GETPOST("title").'"></td></tr>';
// Customer
// Thirdparty
print '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
$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 '<tr><td>'.$langs->trans("ThirdParty").'</td><td>';
$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 '</td></tr>';