diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index b756f0313a5..8d2d80958fb 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2499,7 +2499,7 @@ class Form * @param string $action Action * @param array $formquestion An array with complementary inputs to add into forms: array(array('label'=> ,'type'=> , )) * @param string $selectedchoice "" or "no" or "yes" - * @param int $useajax 0=No, 1 or 'xxx'=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=preoutput confirm box with div id=dialog-confirm-xxx + * @param int $useajax 0=No, 1=Yes, 2=Yes but submit page with &confirm=no if choice is No, 'xxx'=Yes and preoutput confirm box with div id=dialog-confirm-xxx * @param int $height Force height of box * @param int $width Force width of bow * @return string HTML ajax code if a confirm ajax popup is required, Pure HTML code if it's an html form @@ -2588,10 +2588,12 @@ class Form } // JQUI method dialog is broken with jmobile, we use standard HTML. - // Note: When using dol_use_jmobile, you must also check code for button use a GET url with action=xxx and output the confirm code only when action=xxx + // Note: When using dol_use_jmobile or no js, you must also check code for button use a GET url with action=xxx and check that you also output the confirm code when action=xxx + // See page product/fiche.php for example if (! empty($conf->dol_use_jmobile)) $useajax=0; + if (empty($conf->use_javascript_ajax)) $useajax=0; - if ($useajax && $conf->use_javascript_ajax) + if ($useajax) { $autoOpen=true; $dialogconfirm='dialog-confirm'; diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 241a0fb1bc9..330ea0c3273 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -1262,13 +1262,15 @@ $formquestionclone=array( ); // Confirm delete product -if ($action == 'delete' && empty($conf->use_javascript_ajax)) +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("fiche.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)) +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 { print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneProduct'),$langs->trans('ConfirmCloneProduct',$object->ref),'confirm_clone',$formquestionclone,'yes','action-clone',250,600); } @@ -1291,13 +1293,12 @@ if ($action == '' || $action == 'view') if (! isset($object->no_button_copy) || $object->no_button_copy <> 1) { - if (! empty($conf->use_javascript_ajax)) + if (! empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { print '
'.$langs->trans('ToClone').'
'."\n"; - print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneProduct'),$langs->trans('ConfirmCloneProduct',$object->ref),'confirm_clone',$formquestionclone,'yes','action-clone',250,600); } else - { + { print '
id.'">'.$langs->trans("ToClone").'
'; } } @@ -1309,23 +1310,22 @@ if ($action == '' || $action == 'view') { if (empty($object_is_used) && (! isset($object->no_button_delete) || $object->no_button_delete <> 1)) { - if (! empty($conf->use_javascript_ajax)) + if (! empty($conf->use_javascript_ajax) && empty($conf->dol_use_jmobile)) { print '
'.$langs->trans('Delete').'
'."\n"; - print $form->formconfirm("fiche.php?id=".$object->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete",'',0,"action-delete"); } else - { + { print '
id.'">'.$langs->trans("Delete").'
'; } } else - { + { print '
'.$langs->trans("Delete").'
'; } } else - { + { print '
'.$langs->trans("Delete").'
'; } }