From 62e680cbf2af6325629f1f2aba3c370865b3e1e8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 18 May 2011 12:07:38 +0000 Subject: [PATCH] MAIN_CONFIRM_AJAX is on by default --- htdocs/admin/ihm.php | 8 ++++---- htdocs/core/class/conf.class.php | 1 - htdocs/core/class/html.form.class.php | 2 +- htdocs/install/mysql/data/llx_const.sql | 2 -- htdocs/install/mysql/migration/3.0.0-3.1.0.sql | 1 + htdocs/product/fiche.php | 10 +++++----- .../default/actions_card_default.class.php | 2 +- .../societe/canvas/default/tpl/card_view.tpl.php | 2 +- .../individual/actions_card_individual.class.php | 2 +- .../canvas/individual/tpl/card_view.tpl.php | 2 +- htdocs/societe/soc.php | 16 ++++++++-------- 11 files changed, 23 insertions(+), 25 deletions(-) diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 230fb005dc5..797bcb1f04f 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 ''.$langs->trans("ConfirmAjax").''; - 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 ''; print ''; @@ -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 ''; print ' '; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 83f1528fa70..583f6018814 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 fc37aaa0635..6a13f097a7a 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\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 ef08abbde14..cf7e9e96275 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 ee60b6ff2a0..c0f5aacf704 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 554b6ac5f9d..8b63cc059c4 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 '
'; @@ -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 'id.'">'.$langs->trans("Modify").''; if ($product->no_button_copy <> 1) { - if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { + if ($conf->use_javascript_ajax) { print ''.$langs->trans('ToClone').''."\n"; } else { print 'id.'">'.$langs->trans("ToClone").''; @@ -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 ''.$langs->trans('Delete').''."\n"; } diff --git a/htdocs/societe/canvas/default/actions_card_default.class.php b/htdocs/societe/canvas/default/actions_card_default.class.php index 8a7e86ae3a6..d8ad83d59b3 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 d2c9493ddf9..76faf8d5cdf 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++) { rights->societe->supprimer) { ?> - use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { ?> + use_javascript_ajax) { ?> trans('Delete'); ?> ">trans('Delete'); ?> diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index 41e81f2f55c..a8d5c5dd0c5 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 9ac90a19b4b..5db27c2de89 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 @@ rights->societe->supprimer) { ?> - use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) { ?> + use_javascript_ajax) { ?> trans('Delete'); ?> ">trans('Delete'); ?> diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index dae5a48c37c..5e043106b72 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 ''; - + print "\n"; @@ -1683,7 +1683,7 @@ else * Actions */ print '
'."\n"; - + if ($user->rights->societe->creer) { print ''.$langs->trans("Modify").''."\n"; @@ -1693,15 +1693,15 @@ else { print ''.$langs->trans("AddContact").''."\n"; } - + if ($conf->projet->enabled && $user->rights->projet->creer) { print ''.$langs->trans("AddProject").''."\n"; } - + if ($user->rights->societe->supprimer) { - if ($conf->use_javascript_ajax && $conf->global->MAIN_CONFIRM_AJAX) + if ($conf->use_javascript_ajax) { print ''.$langs->trans('Delete').''."\n"; } @@ -1710,10 +1710,10 @@ else print ''.$langs->trans('Delete').''."\n"; } } - + print '
'."\n"; print '
'; - + print '
'; print ''; // ancre