Merge branch 'marcosgdf-bug-1787' into 3.6

This commit is contained in:
Laurent Destailleur 2015-01-18 15:07:15 +01:00
commit abf961707d
15 changed files with 5485 additions and 5458 deletions

View File

@ -12,6 +12,7 @@ English Dolibarr ChangeLog
- Fix: [ bug #1785 ] Start date is lost in Project > Linked objects - Fix: [ bug #1785 ] Start date is lost in Project > Linked objects
- Fix: [ bug #1804 ] SQL error when sending email without addresee - Fix: [ bug #1804 ] SQL error when sending email without addresee
- Fix: [ bug #1803 ] AJAX company contact input is not aligned - Fix: [ bug #1803 ] AJAX company contact input is not aligned
- 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

@ -107,6 +107,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
@ -401,11 +402,12 @@ if (GETPOST('removedfile')) {
/* /*
* Send mail * Send mail
*/ */
if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel')) { if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! GETPOST('cancel'))
{
$langs->load('mails'); $langs->load('mails');
if ($object->id > 0) { if ($object->id > 0)
{
$receiver = GETPOST('receiver'); $receiver = GETPOST('receiver');
if ($_POST ['sendto']) { if ($_POST ['sendto']) {
@ -425,7 +427,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
} }
} }
if (dol_strlen($sendto)) { if (dol_strlen($sendto))
{
$langs->load("commercial"); $langs->load("commercial");
$from = $_POST ['fromname'] . ' <' . $_POST ['frommail'] . '>'; $from = $_POST ['fromname'] . ' <' . $_POST ['frommail'] . '>';
@ -1092,6 +1095,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

@ -82,6 +82,7 @@ if ($reshook < 0) {
setEventMessages($hookmanager->error, $hookmanager->errors, 'errors'); setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
} }
if (empty($reshook)) {
if ($action == 'remove_pf') if ($action == 'remove_pf')
{ {
$product = new ProductFournisseur($db); $product = new ProductFournisseur($db);
@ -198,8 +199,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