add formConfirm hook
This commit is contained in:
parent
f5d7e94d7e
commit
164e3bff2c
@ -2082,6 +2082,19 @@ if ($result > 0)
|
|||||||
$tmpcode = '';
|
$tmpcode = '';
|
||||||
if (!empty($modCodeProduct->code_auto)) $tmpcode = $modCodeProduct->getNextValue($object, $object->type);
|
if (!empty($modCodeProduct->code_auto)) $tmpcode = $modCodeProduct->getNextValue($object, $object->type);
|
||||||
|
|
||||||
|
$formconfirm='';
|
||||||
|
|
||||||
|
// Confirm delete product
|
||||||
|
if (($action == 'delete' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js
|
||||||
|
|| (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) // Always output when not jmobile nor js
|
||||||
|
{
|
||||||
|
$formconfirm = $form->formconfirm("card.php?id=".$object->id, $langs->trans("DeleteProduct"), $langs->trans("ConfirmDeleteProduct"), "confirm_delete", '', 0, "action-delete");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clone confirmation
|
||||||
|
if (($action == 'clone' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js
|
||||||
|
|| (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) // Always output when not jmobile nor js
|
||||||
|
{
|
||||||
// Define confirmation messages
|
// Define confirmation messages
|
||||||
$formquestionclone = array(
|
$formquestionclone = array(
|
||||||
'text' => $langs->trans("ConfirmClone"),
|
'text' => $langs->trans("ConfirmClone"),
|
||||||
@ -2097,20 +2110,17 @@ if (!empty($conf->global->PRODUIT_SOUSPRODUITS))
|
|||||||
$formquestionclone[] = array('type' => 'checkbox', 'name' => 'clone_composition', 'label' => $langs->trans('CloneCompositionProduct'), 'value' => 1);
|
$formquestionclone[] = array('type' => 'checkbox', 'name' => 'clone_composition', 'label' => $langs->trans('CloneCompositionProduct'), 'value' => 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Confirm delete product
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneProduct', $object->ref), 'confirm_clone', $formquestionclone, 'yes', 'action-clone', 350, 600);
|
||||||
if (($action == 'delete' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js
|
|
||||||
|| (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) // Always output when not jmobile nor js
|
|
||||||
{
|
|
||||||
print $form->formconfirm("card.php?id=".$object->id, $langs->trans("DeleteProduct"), $langs->trans("ConfirmDeleteProduct"), "confirm_delete", '', 0, "action-delete");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clone confirmation
|
// Call Hook formConfirm
|
||||||
if (($action == 'clone' && (empty($conf->use_javascript_ajax) || !empty($conf->dol_use_jmobile))) // Output when action = clone if jmobile or no js
|
$parameters = array('formConfirm' => $formconfirm, 'object' => $object);
|
||||||
|| (!empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile))) // Always output when not jmobile nor js
|
$reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
|
||||||
{
|
if (empty($reshook)) $formconfirm .= $hookmanager->resPrint;
|
||||||
print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneProduct', $object->ref), 'confirm_clone', $formquestionclone, 'yes', 'action-clone', 350, 600);
|
elseif ($reshook > 0) $formconfirm = $hookmanager->resPrint;
|
||||||
}
|
|
||||||
|
|
||||||
|
// Print form confirm
|
||||||
|
print $formconfirm;
|
||||||
|
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user