Start to fix [ bug #1711 ] Projet cloturé toujours visible dans les

autres module pour affectation but it is a too important change.
This commit is contained in:
Laurent Destailleur 2014-11-20 15:32:10 +01:00
parent 0f5203b384
commit 95de38e102
2 changed files with 13 additions and 7 deletions

View File

@ -3102,7 +3102,7 @@ class Form
* @param string $htmlname Name of select field
* @return void
*/
function form_project($page, $socid, $selected='', $htmlname='projectid')
function form_project($page, $socid, $selected='', $htmlname='projectid', $discard_closed=0)
{
global $langs;
@ -3119,8 +3119,7 @@ class Form
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
//print "$socid,$selected,$htmlname";
$formproject->select_projects($socid,$selected,$htmlname);
$formproject->select_projects($socid,$selected,$htmlname,20,0,1,$discard_closed);
print '</td>';
print '<td align="left"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td>';
print '</tr></table></form>';
@ -4103,7 +4102,7 @@ class Form
if ($value_as_key) $array=array_combine($array, $array);
$out='';
// Add code for jquery to use multiselect
if (empty($conf->dol_use_jmobile) && (! empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')))
{
@ -4116,7 +4115,7 @@ class Form
});
</script>';
}
$out.='<select id="'.$htmlname.'" '.($disabled?'disabled="disabled" ':'').'class="flat'.($morecss?' '.$morecss:'').'" name="'.$htmlname.'" '.($moreparam?$moreparam:'').'>';
if ($show_empty)

View File

@ -49,11 +49,12 @@ class FormProjets
* @param int $selected Id project preselected
* @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label
* @param int $option_only Option only
* @param int $option_only Return only html options lines without the select tag
* @param int $show_empty Add an empty line
* @param int $discard_closed Discard closed projects
* @return int Nber of project if OK, <0 if KO
*/
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1)
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0)
{
global $user,$conf,$langs;
@ -104,6 +105,12 @@ class FormProjets
}
else
{
if ($discard_closed && $obj->fk_statut == 2)
{
$i++;
continue;
}
$labeltoshow=dol_trunc($obj->ref,18);
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';