From 00cb2aa26cd5a073ce67520bbe32d1d8c12de8c5 Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Mon, 23 Sep 2013 10:55:44 +0200 Subject: [PATCH 1/2] Fix : wrong var used in bank account class --- htdocs/compta/bank/class/account.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index 17796b6b35f..5a71d365ed1 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1296,7 +1296,7 @@ class AccountLine extends CommonObject // No error check. Can fail if category already affected } - $bankline->rappro=1; + $this->rappro=1; $this->db->commit(); return 1; From 4a20a2952173210500b2431f5bea8421a0f1bfdd Mon Sep 17 00:00:00 2001 From: Maxime Kohlhaas Date: Fri, 27 Sep 2013 11:00:25 +0200 Subject: [PATCH 2/2] Add hook on paiementcard + fix hook on expedition --- htdocs/compta/paiement.php | 11 +++++++++++ htdocs/expedition/fiche.php | 13 ++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 26d61d35919..6faeb1fa951 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -57,7 +57,12 @@ if ($user->societe_id > 0) $socid = $user->societe_id; } +// Initialize technical object to manage hooks of paiements. Note that conf->hooks_modules contains array array +$hookmanager = new HookManager($db); +$hookmanager->initHooks(array('paiementcard')); +$parameters=array('socid'=>$socid); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks /* * Action add_paiement et confirm_paiement @@ -579,6 +584,8 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie } print ''; + $parameters=array(); + $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook print "\n"; @@ -713,6 +720,10 @@ if (! GETPOST('action')) print ''.dol_print_date($db->jdate($objp->dp))."\n"; print ''.$objp->paiement_type.' '.$objp->num_paiement."\n"; print ''.price($objp->amount).' '; + + $parameters=array(); + $reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook + print ''; $i++; } diff --git a/htdocs/expedition/fiche.php b/htdocs/expedition/fiche.php index 000bd9a5b81..c586329d4c9 100644 --- a/htdocs/expedition/fiche.php +++ b/htdocs/expedition/fiche.php @@ -61,9 +61,6 @@ $socid=''; if ($user->societe_id) $socid=$user->societe_id; $result=restrictedArea($user, $origin, $origin_id); -// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array -$hookmanager->initHooks(array('expeditioncard')); - $action = GETPOST('action','alpha'); $confirm = GETPOST('confirm','alpha'); @@ -73,6 +70,11 @@ $hidedesc = (GETPOST('hidedesc','int') ? GETPOST('hidedesc','int') : (! empty( $hideref = (GETPOST('hideref','int') ? GETPOST('hideref','int') : (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_HIDE_REF) ? 1 : 0)); $object = new Expedition($db); +// Load object +if ($id > 0 || ! empty($ref)) +{ + $ret=$object->fetch($id, $ref); +} // Load object if ($id > 0 || ! empty($ref)) @@ -80,9 +82,14 @@ if ($id > 0 || ! empty($ref)) $ret=$object->fetch($id, $ref); } +// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array +$hookmanager->initHooks(array('expeditioncard')); + /* * Actions */ +$parameters=array(); +$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks if ($action == 'add') {