NEW Add getFormatedCustomerRef and getFormatedSupplierRef methods
This commit is contained in:
parent
4b3876d8e8
commit
8950720fb5
@ -1409,11 +1409,11 @@ else
|
|||||||
$morehtmlref.='<div class="refidno">';
|
$morehtmlref.='<div class="refidno">';
|
||||||
// Ref customer
|
// Ref customer
|
||||||
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefCustomer", 'ref_customer', $object->ref_customer, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedCustomerRef');
|
||||||
// Ref supplier
|
// Ref supplier
|
||||||
$morehtmlref.='<br>';
|
$morehtmlref.='<br>';
|
||||||
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
|
$morehtmlref.=$form->editfieldkey("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', 0, 1);
|
||||||
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1);
|
$morehtmlref.=$form->editfieldval("RefSupplier", 'ref_supplier', $object->ref_supplier, $object, $user->rights->contrat->creer, 'string', '', null, null, '', 1, 'getFormatedSupplierRef');
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
$morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . $object->thirdparty->getNomUrl(1);
|
||||||
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
|
if (empty($conf->global->MAIN_DISABLE_OTHER_LINK) && $object->thirdparty->id > 0) $morehtmlref.=' (<a href="'.DOL_URL_ROOT.'/contrat/list.php?socid='.$object->thirdparty->id.'&search_name='.urlencode($object->thirdparty->name).'">'.$langs->trans("OtherContracts").'</a>)';
|
||||||
|
|||||||
@ -457,6 +457,46 @@ abstract class CommonObject
|
|||||||
return $this->error.(is_array($this->errors)?(($this->error!=''?', ':'').join(', ',$this->errors)):'');
|
return $this->error.(is_array($this->errors)?(($this->error!=''?', ':'').join(', ',$this->errors)):'');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return customer ref for screen output.
|
||||||
|
*
|
||||||
|
* @param string $objref Customer ref
|
||||||
|
* @return string Customer ref formated
|
||||||
|
*/
|
||||||
|
function getFormatedCustomerRef($objref)
|
||||||
|
{
|
||||||
|
global $hookmanager;
|
||||||
|
|
||||||
|
$parameters=array('objref'=>$objref);
|
||||||
|
$action='';
|
||||||
|
$reshook = $hookmanager->executeHooks('getFormatedCustomerRef', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook > 0)
|
||||||
|
{
|
||||||
|
return $hookmanager->resArray['objref'];
|
||||||
|
}
|
||||||
|
return $objref.(isset($hookmanager->resArray['objref'])?$hookmanager->resArray['objref']:'');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return supplier ref for screen output.
|
||||||
|
*
|
||||||
|
* @param string $objref Supplier ref
|
||||||
|
* @return string Supplier ref formated
|
||||||
|
*/
|
||||||
|
function getFormatedSupplierRef($objref)
|
||||||
|
{
|
||||||
|
global $hookmanager;
|
||||||
|
|
||||||
|
$parameters=array('objref'=>$objref);
|
||||||
|
$action='';
|
||||||
|
$reshook = $hookmanager->executeHooks('getFormatedSupplierRef', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook > 0)
|
||||||
|
{
|
||||||
|
return $hookmanager->resArray['objref'];
|
||||||
|
}
|
||||||
|
return $objref.(isset($hookmanager->resArray['objref'])?$hookmanager->resArray['objref']:'');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return full name (civility+' '+name+' '+lastname)
|
* Return full name (civility+' '+name+' '+lastname)
|
||||||
*
|
*
|
||||||
|
|||||||
@ -33,7 +33,7 @@ class HookManager
|
|||||||
* @var DoliDB Database handler.
|
* @var DoliDB Database handler.
|
||||||
*/
|
*/
|
||||||
public $db;
|
public $db;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var string Error code (or message)
|
* @var string Error code (or message)
|
||||||
*/
|
*/
|
||||||
@ -168,6 +168,8 @@ class HookManager
|
|||||||
'getFormMail',
|
'getFormMail',
|
||||||
'getIdProfUrl',
|
'getIdProfUrl',
|
||||||
'getDirList',
|
'getDirList',
|
||||||
|
'getFormatedCustomerRef',
|
||||||
|
'getFormatedSupplierRef',
|
||||||
'moveUploadedFile',
|
'moveUploadedFile',
|
||||||
'moreHtmlStatus',
|
'moreHtmlStatus',
|
||||||
'pdf_build_address',
|
'pdf_build_address',
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user