Fix: [ bug #1787 ] Incorrect behaviour of doActions hook

This commit is contained in:
Marcos García de La Fuente 2015-01-17 19:28:27 +01:00
parent fe5533d1c3
commit 7f59cf9194
15 changed files with 5480 additions and 5455 deletions

View File

@ -7,6 +7,7 @@ English Dolibarr ChangeLog
- Fix: amarok is a bugged theme making dolidroid failed. We swith to eldy automatically with dolidroid. - Fix: amarok is a bugged theme making dolidroid failed. We swith to eldy automatically with dolidroid.
- Fix: withdrawal create error if in the same month are deleted previus withdrawals. - Fix: withdrawal create error if in the same month are deleted previus withdrawals.
- Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules - Fix: [ bug #1801 ] FAC_FORCE_DATE_VALIDATION constant alters supplier invoice date given to numeration modules
- Fix: [ bug #1787 ] Incorrect behaviour of doActions hook
***** ChangeLog for 3.6.2 compared to 3.6.1 ***** ***** ChangeLog for 3.6.2 compared to 3.6.1 *****
- Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice. - Fix: fix ErrorBadValueForParamNotAString error message in price customer multiprice.

View File

@ -121,6 +121,8 @@ $hookmanager->initHooks(array('membercard'));
$parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas); $parameters=array('rowid'=>$rowid, 'objcanvas'=>$objcanvas);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer)) if ($action == 'setuserid' && ($user->rights->user->self->creer || $user->rights->user->user->creer))
{ {
$error=0; $error=0;
@ -669,7 +671,7 @@ if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm
} }
} }
} }
}
/* /*

View File

@ -79,6 +79,7 @@ $object = new Societe($db);
$parameters = array('socid' => $id); $parameters = array('socid' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
if (empty($reshook)) {
//Some actions show a "cancel" input submit button with name="cancel" //Some actions show a "cancel" input submit button with name="cancel"
$cancelbutton = GETPOST('cancel'); $cancelbutton = GETPOST('cancel');
@ -152,6 +153,7 @@ if ($action == 'setOutstandingBill')
} }
} }
} }
}
/* /*

View File

@ -102,6 +102,8 @@ $object->substitutionarrayfortest=array(
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
// Action clone object // Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes') if ($action == 'confirm_clone' && $confirm == 'yes')
{ {
@ -623,7 +625,7 @@ if (! empty($_POST["cancel"]))
{ {
$action = ''; $action = '';
} }
}
/* /*

View File

@ -106,6 +106,7 @@ $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some
// hooks // hooks
if (empty($reshook)) {
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
// Action clone object // Action clone object
@ -1088,6 +1089,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->
} }
} }
} }
}
/* /*
* View * View

View File

@ -162,12 +162,14 @@ $hookmanager->initHooks(array('prospectlist'));
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
if ($action == 'cstc') if ($action == 'cstc')
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$_GET["pstcomm"]; $sql = "UPDATE ".MAIN_DB_PREFIX."societe SET fk_stcomm = ".$_GET["pstcomm"];
$sql .= " WHERE rowid = ".$_GET["socid"]; $sql .= " WHERE rowid = ".$_GET["socid"];
$result=$db->query($sql); $result=$db->query($sql);
} }
}
/* /*

View File

@ -101,6 +101,8 @@ $permissionnote = $user->rights->commande->creer; // Used by the include of acti
$parameters = array('socid' => $socid); $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
// Action clone object // Action clone object
@ -1336,6 +1338,7 @@ if (! $error && ! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->righ
} }
} }
} }
}
/* /*
* View * View

View File

@ -111,6 +111,8 @@ $permissionnote = $user->rights->facture->creer; // Used by the include of actio
$parameters = array('socid' => $socid); $parameters = array('socid' => $socid);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once include DOL_DOCUMENT_ROOT . '/core/actions_setnotes.inc.php'; // Must be include, not includ_once
// Action clone object // Action clone object
@ -1808,6 +1810,7 @@ if ($action == 'update_extras') {
if ($error) if ($error)
$action = 'edit_extras'; $action = 'edit_extras';
} }
}

View File

@ -71,6 +71,8 @@ $hookmanager->initHooks(array('paiementcard'));
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
/* /*
* Actions * Actions
*/ */
@ -245,7 +247,7 @@ if ($action == 'confirm_paiement' && $confirm == 'yes')
$db->rollback(); $db->rollback();
} }
} }
}
/* /*
* View * View

View File

@ -89,6 +89,8 @@ $hookmanager->initHooks(array('expeditioncard'));
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
if ($action == 'add') if ($action == 'add')
{ {
$error=0; $error=0;
@ -555,7 +557,7 @@ else if ($action == 'classifybilled')
$object->fetch($id); $object->fetch($id);
$object->set_billed(); $object->set_billed();
} }
}
/* /*
* View * View

View File

@ -68,6 +68,8 @@ $hookmanager->initHooks(array('paymentsupplier'));
$parameters=array('socid'=>$socid); $parameters=array('socid'=>$socid);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
/* /*
* Actions * Actions
*/ */
@ -223,7 +225,7 @@ if ($action == 'confirm_paiement' && $confirm == 'yes')
} }
} }
} }
}
/* /*

View File

@ -54,6 +54,7 @@ $hookmanager->initHooks(array('suppliercard'));
$parameters = array('id' => $id); $parameters = array('id' => $id);
$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
/* /*
* Action * Action
*/ */
@ -87,7 +88,7 @@ if ($action == 'setmode' && $user->rights->societe->creer)
$result=$object->setPaymentMethods(GETPOST('mode_reglement_supplier_id','int')); $result=$object->setPaymentMethods(GETPOST('mode_reglement_supplier_id','int'));
if ($result < 0) dol_print_error($db,$object->error); if ($result < 0) dol_print_error($db,$object->error);
} }
}
/* /*
* View * View

View File

@ -76,13 +76,13 @@ $modulepart='produit';
$parameters=array('id'=>$id); $parameters=array('id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
/* /*
* Action envoie fichier * Action envoie fichier
*/ */
include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_pre_headers.tpl.php'; include_once DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_pre_headers.tpl.php';
}
/* /*
* View * View

View File

@ -83,6 +83,7 @@ $parameters=array('socid'=>$socid, 'id_prod'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
$error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors); $error=$hookmanager->error; $errors=array_merge($errors, (array) $hookmanager->errors);
if (empty($reshook)) {
if ($action == 'remove_pf') if ($action == 'remove_pf')
{ {
$product = new ProductFournisseur($db); $product = new ProductFournisseur($db);
@ -199,8 +200,7 @@ if (GETPOST('cancel') == $langs->trans("Cancel"))
header("Location: fournisseurs.php?id=".$_GET["id"]); header("Location: fournisseurs.php?id=".$_GET["id"]);
exit; exit;
} }
}
/* /*
* view * view

View File

@ -61,6 +61,7 @@ $hookmanager->initHooks(array('resource_card'));
$parameters=array('resource_id'=>$id); $parameters=array('resource_id'=>$id);
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) {
/******************************************************************* /*******************************************************************
* ACTIONS * ACTIONS
@ -111,7 +112,7 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->resource->write
$action='edit'; $action='edit';
} }
} }
}
/*************************************************** /***************************************************
* VIEW * VIEW