Merge pull request #3096 from GPCsolutions/replaceaddress

Allow replacing the address block
This commit is contained in:
Juanjo Menent 2015-06-25 20:45:26 +02:00
commit ba984254a5

View File

@ -130,24 +130,25 @@ class HookManager
// Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated). // Define type of hook ('output' or 'addreplace'. 'returnvalue' is deprecated).
$hooktype='output'; $hooktype='output';
if (in_array( if (in_array(
$method, $method,
array( array(
'addMoreActionsButtons', 'addMoreActionsButtons',
'addStatisticLine', 'addStatisticLine',
'deleteFile', 'deleteFile',
'doActions', 'doActions',
'formCreateThirdpartyOptions', 'formCreateThirdpartyOptions',
'formObjectOptions', 'formObjectOptions',
'formattachOptions', 'formattachOptions',
'formBuilddocLineOptions', 'formBuilddocLineOptions',
'moveUploadedFile', 'moveUploadedFile',
'pdf_writelinedesc', 'pdf_writelinedesc',
'paymentsupplierinvoices', 'paymentsupplierinvoices',
'printSearchForm', 'printAddress',
'formatEvent' 'printSearchForm',
) 'formatEvent'
)) $hooktype='addreplace'; )
)) $hooktype='addreplace';
// Deprecated hook types ('returnvalue') // 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 (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') if ($method == 'insertExtraFields')