New: Add hidden option PROJECT_HIDE_UNSELECTABLES
This commit is contained in:
parent
7d0a7f569e
commit
9f42438714
@ -24,6 +24,7 @@ For users:
|
|||||||
- New: Can search on part of barcode into POS module.
|
- New: Can search on part of barcode into POS module.
|
||||||
- New: Cheques into cheques receipts are ordered by operation date.
|
- New: Cheques into cheques receipts are ordered by operation date.
|
||||||
- New: Add hidden option MAIN_DISABLE_PDF_AUTOUPDATE to avoid generating pdf each time data change.
|
- New: Add hidden option MAIN_DISABLE_PDF_AUTOUPDATE to avoid generating pdf each time data change.
|
||||||
|
- New: Add hidden option PROJECT_HIDE_UNSELECTABLES to hide project you can't select into combo list.
|
||||||
- Fix: Can use POS module with several concurrent users.
|
- Fix: Can use POS module with several concurrent users.
|
||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
|
|||||||
@ -145,16 +145,20 @@ function task_prepare_head($object)
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Show a combo list with projects qualified for a third party
|
* Show a combo list with projects qualified for a third party
|
||||||
* \param socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
*
|
||||||
* \param selected Id project preselected
|
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
|
||||||
* \param htmlname Nom de la zone html
|
* @param int $selected Id project preselected
|
||||||
* \return int Nbre of project if OK, <0 if KO
|
* @param string $htmlname Nom de la zone html
|
||||||
|
* @return int Nbre of project if OK, <0 if KO
|
||||||
*/
|
*/
|
||||||
function select_projects($socid=-1, $selected='', $htmlname='projectid')
|
function select_projects($socid=-1, $selected='', $htmlname='projectid')
|
||||||
{
|
{
|
||||||
global $db,$user,$conf,$langs;
|
global $db,$user,$conf,$langs;
|
||||||
|
|
||||||
|
$hideunselectables = false;
|
||||||
|
if (! empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) $hideunselectables = true;
|
||||||
|
|
||||||
$projectstatic=new Project($db);
|
$projectstatic=new Project($db);
|
||||||
$projectsListId = '';
|
$projectsListId = '';
|
||||||
if (empty($user->rights->projet->all->lire))
|
if (empty($user->rights->projet->all->lire))
|
||||||
@ -203,7 +207,6 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$disabled=0;
|
$disabled=0;
|
||||||
print '<option value="'.$obj->rowid.'"';
|
|
||||||
if (! $obj->fk_statut > 0)
|
if (! $obj->fk_statut > 0)
|
||||||
{
|
{
|
||||||
$disabled=1;
|
$disabled=1;
|
||||||
@ -214,11 +217,22 @@ function select_projects($socid=-1, $selected='', $htmlname='projectid')
|
|||||||
$disabled=1;
|
$disabled=1;
|
||||||
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
|
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
|
||||||
}
|
}
|
||||||
if ($disabled==1) print ' disabled="disabled"';
|
|
||||||
else $labeltoshow.=' - '.dol_trunc($obj->title,12);
|
if ($hideunselectables && $disabled)
|
||||||
|
{
|
||||||
|
$resultat='';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$resultat='<option value="'.$obj->rowid.'"';
|
||||||
|
if ($disabled) $resultat.=' disabled="disabled"';
|
||||||
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
|
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
|
||||||
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
//else $labeltoshow.=' ('.$langs->trans("Private").')';
|
||||||
print '>'.$labeltoshow.'</option>';
|
$resultat.='>'.$labeltoshow;
|
||||||
|
if (! $disabled) $resultat.=' - '.dol_trunc($obj->title,12);
|
||||||
|
$resultat.='</option>';
|
||||||
|
}
|
||||||
|
print $resultat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user