Merge pull request #9612 from atm-greg/Hook_on_commonGenerateDocument

NEW add hook on commongeneratedocument
This commit is contained in:
Laurent Destailleur 2019-09-07 10:27:06 +02:00 committed by GitHub
commit 131c3d8f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4511,10 +4511,15 @@ abstract class CommonObject
*/
protected function commonGenerateDocument($modelspath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref, $moreparams = null)
{
global $conf, $langs, $user;
global $conf, $langs, $user, $hookmanager;
$srctemplatepath='';
$parameters = array('modelspath'=>$modelspath,'modele'=>$modele,'outputlangs'=>$outputlangs,'hidedetails'=>$hidedetails,'hidedesc'=>$hidedesc,'hideref'=>$hideref, 'moreparams'=>$moreparams);
$reshook = $hookmanager->executeHooks('commonGenerateDocument', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if(empty($reshook))
{
dol_syslog("commonGenerateDocument modele=".$modele." outputlangs->defaultlang=".(is_object($outputlangs)?$outputlangs->defaultlang:'null'));
// Increase limit for PDF build
@ -4759,6 +4764,8 @@ abstract class CommonObject
dol_print_error('', $this->error);
return -1;
}
}
else return $reshook;
}
/**