diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 0169f5ae811..80b618b8804 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -50,7 +50,7 @@ class FormContract * @param string $htmlname Nom de la zone html * @param int $maxlength Maximum length of label * @param int $showempty Show empty line - * @return int Nbre of project if OK, <0 if KO + * @return int Nbr of project if OK, <0 if KO */ function select_contract($socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) { @@ -137,4 +137,32 @@ class FormContract return -1; } } + + /** + * Show a form to select a contract + * + * @param int $page Page + * @param int $socid Id third party (-1=all, 0=only contracts not linked to a third party, id=contracts not linked or linked to third party id) + * @param int $selected Id contract preselected + * @param string $htmlname Nom de la zone html + * @param int $maxlength Maximum length of label + * @param int $showempty Show empty line + * @return int Nbr of project if OK, <0 if KO + */ + function formSelectContract($page, $socid=-1, $selected='', $htmlname='contrattid', $maxlength=16, $showempty=1) + { + global $langs; + + print "\n"; + print '
'; + } + } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index e05b1cde1a4..2a4ec4337f2 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -477,7 +477,7 @@ if (empty($reshook)) } // Set into a contract - else if ($action == 'setcontrat' && $user->rights->contrat->creer) + else if ($action == 'setcontract' && $user->rights->contrat->creer) { $result=$object->set_contrat($user,GETPOST('contratid','int')); if ($result < 0) dol_print_error($db,$object->error); @@ -1251,15 +1251,8 @@ else if ($id > 0 || ! empty($ref)) print '| '; - $htmlcontract= new Formcontract($db); - //print "$socid,$selected,$htmlname"; - $htmlcontract->select_contract($object->socid,$object->fk_contrat,'contratid'); - - print ' | '; - print ''; - print ' |