New: Add param to show title

This commit is contained in:
Laurent Destailleur 2013-02-11 20:26:01 +01:00
parent 49f40ee429
commit d2275a0bbd

View File

@ -135,9 +135,10 @@ class FormActions
* @param Object $object Object
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
* @param int $socid socid of user
* @param int $forceshowtitle Show title even if there is no actions to show
* @return int <0 if KO, >=0 if OK
*/
function showactions($object,$typeelement,$socid=0)
function showactions($object,$typeelement,$socid=0,$forceshowtitle=0)
{
global $langs,$conf,$user;
global $bc;
@ -148,7 +149,7 @@ class FormActions
if (! is_array($listofactions)) dol_print_error($this->db,'FailedToGetActions');
$num = count($listofactions);
if ($num)
if ($num || $forceshowtitle)
{
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');