diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 230fb005dc51733dca9518663b9862446a8087f7..797bcb1f04fb4aab87243412793d8a749e9fa046 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -61,8 +61,8 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') dolibarr_set_const($db, "MAIN_MULTILANGS", $_POST["main_multilangs"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", $_POST["main_size_liste_limit"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_DISABLE_JAVASCRIPT", $_POST["main_disable_javascript"],'chaine',0,'',$conf->entity); - //dolibarr_set_const($db, "MAIN_CONFIRM_AJAX", $_POST["main_confirm_ajax"],'chaine',0,'',$conf->entity); - //dolibarr_set_const($db, "MAIN_POPUP_CALENDAR", $_POST["main_popup_calendar"],'chaine',0,'',$conf->entity); + //dolibarr_set_const($db, "MAIN_CONFIRM_AJAX", $_POST["MAIN_CONFIRM_AJAX"],'chaine',0,'',$conf->entity); + //dolibarr_set_const($db, "MAIN_POPUP_CALENDAR", $_POST["MAIN_POPUP_CALENDAR"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["main_use_preview_tabs"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); @@ -193,7 +193,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit // Use Ajax popups for confirmation /*$var=!$var; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("ConfirmAjax").'</td><td>'; - print $html->selectyesno('main_confirm_ajax',isset($conf->global->MAIN_CONFIRM_AJAX)?$conf->global->MAIN_CONFIRM_AJAX:0,1); + print $html->selectyesno('MAIN_CONFIRM_AJAX',isset($conf->global->MAIN_CONFIRM_AJAX)?$conf->global->MAIN_CONFIRM_AJAX:0,1); print ' ('.$langs->trans("AvailableOnlyIfJavascriptAndAjaxNotDisabled").')'; print '</td>'; print '<td width="20">'; @@ -211,7 +211,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit //'eldy'=>$langs->trans("Yes").' (style eldy)', //'andre'=>$langs->trans("Yes").' (style andre)' ); - print $html->selectarray('main_popup_calendar',$liste_popup_calendar,$conf->global->MAIN_POPUP_CALENDAR); + print $html->selectarray('MAIN_POPUP_CALENDAR',$liste_popup_calendar,$conf->global->MAIN_POPUP_CALENDAR); print ' ('.$langs->trans("AvailableOnlyIfJavascriptNotDisabled").')'; print '</td>'; print '<td width="20"> </td>'; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 83f1528fa70c8490f830c87fde1962227762e2bc..583f60188147d3381664c41e56eec57a20082e17 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -314,7 +314,6 @@ class Conf if (! $this->use_javascript_ajax) { $this->global->PRODUIT_USE_SEARCH_TO_SELECT=0; - $this->global->MAIN_CONFIRM_AJAX=0; } // conf->monnaie diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index fc37aaa06359960980d142f1c70478c5c4a1248c..6a13f097a7ab9a2f1aef19a243e21e6c97758d45 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2037,7 +2037,7 @@ class Form $formconfirm.= "\n<!-- begin form_confirm -->\n"; - if ($useajax && $conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($useajax && $conf->use_javascript_ajax) { $autoOpen=true; $dialogconfirm='dialog-confirm'; diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index ef08abbde140f343643440796620355d751d3b50..cf7e9e962751e54f6ada36ed1d44bb165ac431cf 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -45,8 +45,6 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_M insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_UPLOAD_DOC','2048','chaine','Max size for file upload (0 means no upload allowed)',0,0); -insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_CONFIRM_AJAX','1','chaine','Use Ajax popup to make confirmations',0,0); - -- Hidden but specific to one entity insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MONNAIE','EUR','chaine','Monnaie',0,1); insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_MAIL_EMAIL_FROM','dolibarr-robot@domain.com','chaine','EMail emetteur pour les emails automatiques Dolibarr',0,1); diff --git a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql index ee60b6ff2a0b6fe207e50023d72911e282796dc7..c0f5aacf704e1321fe1a00b20a06ad7ce328c050 100755 --- a/htdocs/install/mysql/migration/3.0.0-3.1.0.sql +++ b/htdocs/install/mysql/migration/3.0.0-3.1.0.sql @@ -42,6 +42,7 @@ DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_MENU_BARRELEFT'; DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_MENUFRONT_BARRELEFT'; DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_POPUP_CALENDAR' and value in ('1','eldy'); +DELETE FROM llx_const WHERE __DECRYPT('name')__ = 'MAIN_CONFIRM_AJAX'; ALTER TABLE llx_facture_fourn ADD COLUMN ref_ext varchar(30) AFTER entity; ALTER TABLE llx_commande_fournisseur ADD COLUMN ref_ext varchar(30) AFTER entity; diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 554b6ac5f9dff9a8880253d8b5a26454713444c9..8b63cc059c4d89a0a4696f96db8eb9f5e97a3152 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -347,7 +347,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') { $product = new Product($db); $product->fetch($id); - + if ( ($product->type == 0 && $user->rights->produit->supprimer) || ($product->type == 1 && $user->rights->service->supprimer) ) { $result = $product->delete($id); @@ -1033,7 +1033,7 @@ if ($id || $ref) dol_fiche_head($head, 'card', $titre, 0, $picto); // Confirm delete product - if ($action == 'delete' || ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)) + if ($action == 'delete' || $conf->use_javascript_ajax) { $ret=$html->form_confirm("fiche.php?id=".$product->id,$langs->trans("DeleteProduct"),$langs->trans("ConfirmDeleteProduct"),"confirm_delete",'',0,"action-delete"); if ($ret == 'html') print '<br>'; @@ -1197,7 +1197,7 @@ else if ($action != 'create') // Clone confirmation -if ($action == 'clone' || ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) ) +if ($action == 'clone' || $conf->use_javascript_ajax) { // Create an array for form $formquestion=array( @@ -1227,7 +1227,7 @@ if ($action == '') print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&id='.$product->id.'">'.$langs->trans("Modify").'</a>'; if ($product->no_button_copy <> 1) { - if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { + if ($conf->use_javascript_ajax) { print '<span id="action-clone" class="butAction">'.$langs->trans('ToClone').'</span>'."\n"; } else { print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=clone&id='.$product->id.'">'.$langs->trans("ToClone").'</a>'; @@ -1241,7 +1241,7 @@ if ($action == '') { if (! $product_is_used && $product->no_button_delete <> 1) { - if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax) { print '<span id="action-delete" class="butActionDelete">'.$langs->trans('Delete').'</span>'."\n"; } diff --git a/htdocs/societe/canvas/default/actions_card_default.class.php b/htdocs/societe/canvas/default/actions_card_default.class.php index 8a7e86ae3a6fdbeccfc891e7f773cc4344dea309..d8ad83d59b3fc8e84ef41cc6e812fe9951172e2d 100644 --- a/htdocs/societe/canvas/default/actions_card_default.class.php +++ b/htdocs/societe/canvas/default/actions_card_default.class.php @@ -149,7 +149,7 @@ class ActionsCardDefault extends ActionsCardCommon else { // Confirm delete third party - if ($_GET["action"] == 'delete' || ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)) + if ($_GET["action"] == 'delete' || $conf->use_javascript_ajax) { $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"1,action-delete"); } diff --git a/htdocs/societe/canvas/default/tpl/card_view.tpl.php b/htdocs/societe/canvas/default/tpl/card_view.tpl.php index d2c9493ddf9819d86da5bfda0c325b665ed1d317..76faf8d5cdf5c4959e0a42fa6e9c39cd76f67b77 100644 --- a/htdocs/societe/canvas/default/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/default/tpl/card_view.tpl.php @@ -238,7 +238,7 @@ for ($i=1; $i<=4; $i++) { <?php } ?> <?php if ($user->rights->societe->supprimer) { ?> - <?php if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { ?> + <?php if ($conf->use_javascript_ajax) { ?> <span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span> <?php } else { ?> <a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id'].'&action=delete&canvas='.$canvas; ?>"><?php echo $langs->trans('Delete'); ?></a> diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index 41e81f2f55c1f0a0284065e6fbce7b0c5fbc702a..a8d5c5dd0c5b458e7004c3b05ce513af9ebab12b 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -99,7 +99,7 @@ class ActionsCardIndividual extends ActionsCardCommon else { // Confirm delete third party - if ($_GET["action"] == 'delete' || ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)) + if ($_GET["action"] == 'delete' || $conf->use_javascript_ajax) { $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteAnIndividual"),$langs->trans("ConfirmDeleteIndividual"),"confirm_delete",'',0,"1,action-delete"); } diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php index 9ac90a19b4bfca27e7a984487669e79560eab64a..5db27c2de89dc1f6940474df102896472d908442 100644 --- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php +++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php @@ -179,7 +179,7 @@ <?php } ?> <?php if ($user->rights->societe->supprimer) { ?> - <?php if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { ?> + <?php if ($conf->use_javascript_ajax) { ?> <span id="action-delete" class="butActionDelete"><?php echo $langs->trans('Delete'); ?></span> <?php } else { ?> <a class="butActionDelete" href="<?php echo $_SERVER["PHP_SELF"].'?socid='.$this->control->tpl['id'].'&action=delete&canvas='.$canvas; ?>"><?php echo $langs->trans('Delete'); ?></a> diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index dae5a48c37ce871edf3588565f75198a653117c9..5e043106b72c01ea830fbab51a6c0f9accca6642 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -1328,7 +1328,7 @@ else // Confirm delete third party - if ($action == 'delete' || ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX)) + if ($action == 'delete' || $conf->use_javascript_ajax) { $html = new Form($db); $ret=$html->form_confirm($_SERVER["PHP_SELF"]."?socid=".$soc->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"action-delete"); @@ -1675,7 +1675,7 @@ else } print '</table>'; - + print "</div>\n"; @@ -1683,7 +1683,7 @@ else * Actions */ print '<div class="tabsAction">'."\n"; - + if ($user->rights->societe->creer) { print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action=edit">'.$langs->trans("Modify").'</a>'."\n"; @@ -1693,15 +1693,15 @@ else { print '<a class="butAction" href="'.DOL_URL_ROOT.'/contact/fiche.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddContact").'</a>'."\n"; } - + if ($conf->projet->enabled && $user->rights->projet->creer) { print '<a class="butAction" href="'.DOL_URL_ROOT.'/projet/fiche.php?socid='.$socid.'&action=create">'.$langs->trans("AddProject").'</a>'."\n"; } - + if ($user->rights->societe->supprimer) { - if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax) { print '<span id="action-delete" class="butActionDelete">'.$langs->trans('Delete').'</span>'."\n"; } @@ -1710,10 +1710,10 @@ else print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?socid='.$soc->id.'&action=delete">'.$langs->trans('Delete').'</a>'."\n"; } } - + print '</div>'."\n"; print '<br>'; - + print '<table width="100%"><tr><td valign="top" width="50%">'; print '<a name="builddoc"></a>'; // ancre