mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
Merge pull request #17429 from fr69400/develop
FIX formAddObjectLine cant be overloaded by hook
This commit is contained in:
commit
d1f11d2e65
|
|
@ -572,10 +572,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
|
||||
if ($action != 'editline') {
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
|
||||
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $mysoc, null, '/bom/tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2457,10 +2457,12 @@ if ($action == 'create') {
|
|||
if ($object->statut == Propal::STATUS_DRAFT && $usercancreate && $action != 'selectlines') {
|
||||
if ($action != 'editline') {
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
} else {
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formEditObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
|
|
|
|||
|
|
@ -2442,11 +2442,13 @@ if ($action == 'create' && $usercancreate) {
|
|||
if ($object->statut == Commande::STATUS_DRAFT && $usercancreate && $action != 'selectlines') {
|
||||
if ($action != 'editline') {
|
||||
// Add free products/services
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
// Note that $action and $object may be modified by hook
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action);
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -1620,10 +1620,12 @@ if ($action == 'create') {
|
|||
if ($object->statut == $object::STATUS_DRAFT && $user->rights->facture->creer && $action != 'valid' && $action != 'editline') {
|
||||
if ($action != 'editline') {
|
||||
// Add free products/services
|
||||
$object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(0, $mysoc, $object->thirdparty); // No date selector for template invoice
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5193,10 +5193,12 @@ if ($action == 'create') {
|
|||
if ($object->statut == 0 && $usercancreate && $action != 'valid' && $action != 'editline') {
|
||||
if ($action != 'editline' && $action != 'selectlines') {
|
||||
// Add free products/services
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1981,10 +1981,12 @@ if ($action == 'create') {
|
|||
}
|
||||
|
||||
// Add free products/services
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -595,10 +595,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
|
||||
if ($action != 'editline') {
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2309,10 +2309,12 @@ if ($action == 'create') {
|
|||
if ($object->statut == CommandeFournisseur::STATUS_DRAFT && $usercancreate) {
|
||||
if ($action != 'editline') {
|
||||
// Add free products/services
|
||||
$object->formAddObjectLine(1, $societe, $mysoc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $societe, $mysoc);
|
||||
}
|
||||
}
|
||||
print '</table>';
|
||||
|
|
|
|||
|
|
@ -3327,10 +3327,12 @@ if ($action == 'create') {
|
|||
if ($object->statut == FactureFournisseur::STATUS_DRAFT && $usercancreate) {
|
||||
if ($action != 'editline') {
|
||||
// Add free products/services
|
||||
$object->formAddObjectLine(1, $societe, $mysoc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $societe, $mysoc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -458,10 +458,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
|
||||
if ($action != 'editline') {
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -548,10 +548,12 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
if ($object->status == 0 && $permissiontoadd && $action != 'selectlines') {
|
||||
if ($action != 'editline') {
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine(1, $mysoc, $soc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1773,10 +1773,12 @@ if ($action == 'create') {
|
|||
if ($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) {
|
||||
if ($action != 'editline') {
|
||||
// Add products/services form
|
||||
$object->formAddObjectLine($dateSelector, $soc, $mysoc);
|
||||
|
||||
$parameters = array();
|
||||
$reshook = $hookmanager->executeHooks('formAddObjectLine', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||
if (empty($reshook))
|
||||
$object->formAddObjectLine($dateSelector, $soc, $mysoc);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user