Merge pull request #1248 from atm-maxime/develop

Minor fix + new hook
This commit is contained in:
Laurent Destailleur 2013-09-27 06:12:26 -07:00
commit d5eaaaaf3a
3 changed files with 22 additions and 4 deletions

View File

@ -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;

View File

@ -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 '</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook
print "</tr>\n";
@ -713,6 +720,10 @@ if (! GETPOST('action'))
print '<td>'.dol_print_date($db->jdate($objp->dp))."</td>\n";
print '<td>'.$objp->paiement_type.' '.$objp->num_paiement."</td>\n";
print '<td align="right">'.price($objp->amount).'</td><td>&nbsp;</td>';
$parameters=array();
$reshook=$hookmanager->executeHooks('printObjectLine',$parameters,$objp,$action); // Note that $action and $object may have been modified by hook
print '</tr>';
$i++;
}

View File

@ -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')
{