Merge pull request #14202 from pstructures/PSdevelop

Added Hook to showOptionals Function
This commit is contained in:
Laurent Destailleur 2020-07-10 02:54:05 +02:00 committed by GitHub
commit f2c84fba3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6711,10 +6711,14 @@ abstract class CommonObject
*/ */
public function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0) public function showOptionals($extrafields, $mode = 'view', $params = null, $keysuffix = '', $keyprefix = '', $onetrtd = 0)
{ {
global $db, $conf, $langs, $action, $form; global $db, $conf, $langs, $action, $form, $hookmanager;
if (!is_object($form)) $form = new Form($db); if (!is_object($form)) $form = new Form($db);
$parameters=array();
$reshook=$hookmanager->executeHooks('showOptionals',$parameters,$this,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook))
{
$out = ''; $out = '';
if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0) if (is_array($extrafields->attributes[$this->table_element]['label']) && count($extrafields->attributes[$this->table_element]['label']) > 0)
@ -6942,6 +6946,7 @@ abstract class CommonObject
} }
} }
return $out; return $out;
} // end of hook manager
} }