diff --git a/admin-dev/themes/template/tax_rules/form.tpl b/admin-dev/themes/template/tax_rules/form.tpl index 76b212101..04ff264d5 100644 --- a/admin-dev/themes/template/tax_rules/form.tpl +++ b/admin-dev/themes/template/tax_rules/form.tpl @@ -26,19 +26,14 @@ {extends file="../helper/form/form.tpl"} {block name="label"} - {if $input.type == 'select' && $input.name == 'country[]'} - - - {else} - - {/if} -{/block} - {block name="script"} $(document).ready(function() { $('#country').click(function() { populateStates($(this).val(), ''); }); + $('#tax_rule_form').hide(); $('#desc-tax_rules_group-new').click(function() { initForm(); - $('#add_new_tax_rule').show(); + $('#tax_rule_form').slideToggle(); return false; - }, function() { - $('#add_new_tax_rule').hide(); }); }); @@ -118,7 +103,7 @@ dataType: 'json', data: 'ajaxStates=1&ajaxUpdateTaxRule=1&id_tax_rule='+id_tax_rule, success: function(data){ - $('#add_new_tax_rule').show(); + $('#tax_rule_form').show(); $('#id_tax_rule').val(data.id); $('#country').val(data.id_country); $('#state').val(data.id_state); diff --git a/admin-dev/themes/template/tax_rules_group/form.tpl b/admin-dev/themes/template/tax_rules_group/form.tpl index aee7ce078..3ea9b3b05 100644 --- a/admin-dev/themes/template/tax_rules_group/form.tpl +++ b/admin-dev/themes/template/tax_rules_group/form.tpl @@ -25,133 +25,6 @@ *} {extends file="../helper/form/form.tpl"} -{block name="label"} - {if $input.type == 'select' && $input.name == 'country[]'} - -{/block} - -{block name="script"} - - $(document).ready(function() { - - $('#country').click(function() { - populateStates($(this).val(), ''); - }); - - $('span.process-icon-new').parent().click(function() { - initForm(); - $('#add_new_tax_rule').slideToggle(); - }); - - $('table.tax_rule').find('a.edit').attr('href', '#'); - - }); - - function populateStates(id_country, id_state) - { - if ($("#country option:selected").size() > 1) - { - $("#zipcode-label").hide(); - $("#zipcode").hide(); - - $("#state-select").hide(); - $("#state-label").hide(); - } else { - $.ajax({ - url: "ajax.php", - cache: false, - data: "ajaxStates=1&id_country="+id_country+"&id_state="+id_state+"&empty_value={l s='All'}", - success: function(html){ - if (html == "false") - { - $("#state-label").hide(); - $("#state-select").hide(); - $("#states").html(''); - } - else - { - $("#state-label").show(); - $("#state-select").show(); - $("#states").html(html); - } - } - }); - - $("#zipcode-label").show(); - $("#zipcode").show(); - } - } - - function loadTaxRule(id_tax_rule) - { - $.ajax({ - type: 'POST', - url: 'ajax.php', - async: true, - dataType: 'json', - data: 'ajaxStates=1&ajaxUpdateTaxRule=1&id_tax_rule='+id_tax_rule, - success: function(data){ - $('#add_new_tax_rule').show(); - $('#id_tax_rule').val(data.id); - $('#country').val(data.id_country); - $('#state').val(data.id_state); - - zipcode = 0; - if (data.zipcode_from != 0) - { - zipcode = data.zipcode_from; - - if (data.zipcode_to != 0) - zipcode = zipcode +"-"+data.zipcode_to - } - - $('#zipcode').val(zipcode); - $('#behavior').val(data.behavior); - $('#id_tax').val(data.id_tax); - $('#description').val(data.description); - - populateStates(data.id_country, data.id_state); - } - }); - } - - function initForm() - { - $('#id_tax_rule').val(''); - $('#country').val(0); - $('#state').val(0); - $('#zipcode').val(0); - $('#behavior').val(0); - $('#tax').val(0); - $('#description').val(''); - - populateStates(0,0); - } -{/block} +{block name="after"} +
+{/block} \ No newline at end of file diff --git a/controllers/admin/AdminTaxRulesGroupController.php b/controllers/admin/AdminTaxRulesGroupController.php index 58142b699..e9ca341e7 100644 --- a/controllers/admin/AdminTaxRulesGroupController.php +++ b/controllers/admin/AdminTaxRulesGroupController.php @@ -77,7 +77,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController $this->table = 'tax_rule'; $this->identifier = 'id_tax_rule'; $this->lang = false; - $this->simple_header = true; + $this->list_simple_header = true; $this->toolbar_btn = null; $this->list_no_link = true;