Skip to content

Commit

Permalink
Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 18.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Feb 12, 2024
2 parents 6553336 + 6ef86d2 commit 2e620c9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
4 changes: 2 additions & 2 deletions htdocs/comm/propal/card.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@

// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
if (!GETPOST('socid', 3)) {
setEventMessages($langs->trans("NoCloneOptionsSpecified"), null, 'errors');
if (!($socid > 0)) {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('IdThirdParty')), null, 'errors');
} else {
if ($object->id > 0) {
if (!empty($conf->global->PROPAL_CLONE_DATE_DELIVERY)) {
Expand Down
12 changes: 7 additions & 5 deletions htdocs/core/class/hookmanager.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public function executeHooks($method, $parameters = array(), &$object = '', &$ac
}

// Init return properties
$this->resPrint = '';
$localResPrint = '';
$this->resArray = array();
$this->resNbOfHooks = 0;

Expand Down Expand Up @@ -270,9 +270,9 @@ public function executeHooks($method, $parameters = array(), &$object = '', &$ac
}
if (!empty($actionclassinstance->resprints)) {
if ($resactiontmp > 0) {
$this->resPrint = $actionclassinstance->resprints;
$localResPrint = $actionclassinstance->resprints;
} else {
$this->resPrint .= $actionclassinstance->resprints;
$localResPrint .= $actionclassinstance->resprints;
}
}
} else {
Expand All @@ -294,7 +294,7 @@ public function executeHooks($method, $parameters = array(), &$object = '', &$ac
$this->resArray = array_merge($this->resArray, $actionclassinstance->results);
}
if (!empty($actionclassinstance->resprints)) {
$this->resPrint .= $actionclassinstance->resprints;
$localResPrint .= $actionclassinstance->resprints;
}
if (is_numeric($resactiontmp) && $resactiontmp < 0) {
$error++;
Expand All @@ -307,7 +307,7 @@ public function executeHooks($method, $parameters = array(), &$object = '', &$ac
if (!is_array($resactiontmp) && !is_numeric($resactiontmp)) {
dol_syslog('Error: Bug into hook '.$method.' of module class '.get_class($actionclassinstance).'. Method must not return a string but an int (0=OK, 1=Replace, -1=KO) and set string into ->resprints', LOG_ERR);
if (empty($actionclassinstance->resprints)) {
$this->resPrint .= $resactiontmp;
$localResPrint .= $resactiontmp;
}
}
}
Expand All @@ -320,6 +320,8 @@ public function executeHooks($method, $parameters = array(), &$object = '', &$ac
}
}

$this->resPrint = $localResPrint;

return ($error ? -1 : $resaction);
}
}
3 changes: 2 additions & 1 deletion htdocs/fichinter/agenda.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
$socid = $user->socid;
}
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'ficheinter', $object->id, '', '', 'fk_soc', 'rowid', $isdraft);
restrictedArea($user, 'ficheinter', $object->id, 'fichinter', '', 'fk_soc', 'rowid', $isdraft);



/*
Expand Down
2 changes: 1 addition & 1 deletion htdocs/mrp/mo_production.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
$object = new Mo($db);
$extrafields = new ExtraFields($db);
$diroutputmassaction = $conf->mrp->dir_output.'/temp/massgeneration/'.$user->id;
$hookmanager->initHooks(array('mocard', 'globalcard')); // Note that conf->hooks_modules contains array
$hookmanager->initHooks(array('moproduction', 'globalcard')); // Note that conf->hooks_modules contains array

// Fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
Expand Down

0 comments on commit 2e620c9

Please sign in to comment.