diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 3205206a11c..5019b2dba02 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2475,7 +2475,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=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 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 $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 @@ -2563,6 +2563,8 @@ class Form $more.=''."\n"; } + if (! empty($conf->dol_use_jmobile)) $useajax=0; // JQUI method dialog is broken with jmobile, we use standard HTML. We also change code for button to have get on url with action=xxx and output confirm only when action=xxx + if ($useajax && $conf->use_javascript_ajax) { $autoOpen=true; @@ -2654,9 +2656,8 @@ class Form } }); - var button = "'.$button.'"; - if (button.length > 0) { + if (button.length > 0) { $( "#" + button ).click(function() { $("#'.$dialogconfirm.'").dialog("open"); }); diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 04f5806bf96..4da853a764a 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1438,7 +1438,7 @@ else dol_fiche_head($head, 'card', $langs->trans("ThirdParty"),0,'company'); // Confirm delete third party - if ($action == 'delete' || $conf->use_javascript_ajax) + if ($action == 'delete' || ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile))) { $form = new Form($db); $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?socid=".$object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"action-delete"); @@ -1786,7 +1786,7 @@ else if ($user->rights->societe->supprimer) { - if ($conf->use_javascript_ajax) + if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) // We can(t use preloaded confirm form with jmobile { print '
'.$langs->trans('Delete').'
'."\n"; }