Merge pull request #1153 from csalvador/print_address_hook

added hook to the print address function
This commit is contained in:
Laurent Destailleur 2013-08-05 11:51:08 -07:00
commit 8d90289bfc

View File

@ -1354,10 +1354,16 @@ function dol_user_country()
*/ */
function dol_print_address($address, $htmlid, $mode, $id) function dol_print_address($address, $htmlid, $mode, $id)
{ {
global $conf,$user,$langs; global $conf, $user, $langs, $hookmanager;
if ($address) if ($address)
{ {
if ($hookmanager) {
$parameters = array('element' => $mode, 'id' => $id);
$reshook = $hookmanager->executeHooks('printAddress', $parameters, $address, $action);
print $hookmanager->resPrint;
}
if (empty($reshook)) {
print nl2br($address); print nl2br($address);
$showgmap=$showomap=0; $showgmap=$showomap=0;
if ($mode=='thirdparty' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS)) $showgmap=1; if ($mode=='thirdparty' && ! empty($conf->google->enabled) && ! empty($conf->global->GOOGLE_ENABLE_GMAPS)) $showgmap=1;
@ -1380,6 +1386,7 @@ function dol_print_address($address, $htmlid, $mode, $id)
} }
} }
} }
}
/** /**