diff --git a/admin-dev/themes/default/template/controllers/groups/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/groups/helpers/form/form.tpl index acb52c2e8..681758327 100644 --- a/admin-dev/themes/default/template/controllers/groups/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/groups/helpers/form/form.tpl @@ -106,63 +106,61 @@ if ($(this).attr('name') == 'category_reduction['+$('[name="id_category"]:checked').val()+']') { exist = true; - jAlert('{l s='This category already exists for this group.'}'); + jAlert('{l s='This category already exists for this group.' js='1'}'); return false; } - }); if (exist) return; $.ajax({ - type:"POST", - url: "ajax-tab.php", - async: true, - dataType: "json", - data : { - ajax: "1", - token: "{getAdminToken tab='AdminGroups'}", - controller: "AdminGroups", - action: "addCategoryReduction", - category_reduction: $('#category_reduction_fancybox').val() , - id_category: $('[name="id_category"]:checked').val() - }, - success : function(jsonData) + type:"POST", + url: "ajax-tab.php", + async: true, + dataType: "json", + data : { + ajax: "1", + token: "{getAdminToken tab='AdminGroups'}", + controller: "AdminGroups", + action: "addCategoryReduction", + category_reduction: $('#category_reduction_fancybox').val() , + id_category: $('[name="id_category"]:checked').val() + }, + success : function(jsonData) { + if (jsonData.hasError) { - if (jsonData.hasError) - { - var errors = ''; - for(error in jsonData.errors) - //IE6 bug fix - if(error != 'indexOf') - errors += jsonData.errors[error] + "\n"; - jAlert(errors); - } - else - { - $('#group_discount_category_table').append('


\ No newline at end of file
diff --git a/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/form.tpl
index 79f38f94b..9372654b7 100644
--- a/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/form.tpl
+++ b/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/form.tpl
@@ -138,7 +138,7 @@
// check if it's possible to add the product
if (product_infos == null || $('#cur_product_name').val() == '')
{
- jAlert('{l s='Please select at least one product.'}');
+ jAlert('{l s='Please select at least one product.' js='1'}');
return false;
}
diff --git a/js/admin_order.js b/js/admin_order.js
index 098d83e59..f2305948b 100644
--- a/js/admin_order.js
+++ b/js/admin_order.js
@@ -470,8 +470,7 @@ function init()
cache: false,
dataType: 'json',
data : query,
- success : function(data)
- {
+ success : function(data) {
if (data.result)
{
go = false;
@@ -491,8 +490,7 @@ function init()
else
jAlert(data.error);
},
- error : function(XMLHttpRequest, textStatus, errorThrown)
- {
+ error : function(XMLHttpRequest, textStatus, errorThrown) {
jAlert("Impossible to add the product to the cart.\n\ntextStatus: '" + textStatus + "'\nerrorThrown: '" + errorThrown + "'\nresponseText:\n" + XMLHttpRequest.responseText);
}
});