Skip to content

Commit

Permalink
Merge pull request #3096 from GPCsolutions/replaceaddress
Browse files Browse the repository at this point in the history
Allow replacing the address block
  • Loading branch information
Juanjo Menent committed Jun 25, 2015
2 parents 0f6aaf1 + d6e4867 commit ba98425
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions htdocs/core/class/hookmanager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,24 +130,25 @@ function executeHooks($method, $parameters=false, &$object='', &$action='')

// Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated).
$hooktype='output';
if (in_array(
$method,
array(
'addMoreActionsButtons',
'addStatisticLine',
'deleteFile',
'doActions',
'formCreateThirdpartyOptions',
'formObjectOptions',
'formattachOptions',
'formBuilddocLineOptions',
'moveUploadedFile',
'pdf_writelinedesc',
'paymentsupplierinvoices',
'printSearchForm',
'formatEvent'
)
)) $hooktype='addreplace';
if (in_array(
$method,
array(
'addMoreActionsButtons',
'addStatisticLine',
'deleteFile',
'doActions',
'formCreateThirdpartyOptions',
'formObjectOptions',
'formattachOptions',
'formBuilddocLineOptions',
'moveUploadedFile',
'pdf_writelinedesc',
'paymentsupplierinvoices',
'printAddress',
'printSearchForm',
'formatEvent'
)
)) $hooktype='addreplace';
// Deprecated hook types ('returnvalue')
if (preg_match('/^pdf_/',$method) && $method != 'pdf_writelinedesc') $hooktype='returnvalue'; // pdf_xxx except pdf_writelinedesc are 'returnvalue' hooks. When there is 2 hooks of this type, only last one win. TODO Move them into 'output' or 'addreplace' hooks.
if ($method == 'insertExtraFields')
Expand Down

0 comments on commit ba98425

Please sign in to comment.