// Fix PSTEST-396

This commit is contained in:
rGaillard committed 2012-01-30 13:21:12 +00:00
1 parent 0a5dc876e3
commit 9a70ff3a77
2 files changed
+19 -20

No files matched your search

@@ -431,10 +431,20 @@
function updateCarrierList(carriers) function updateCarrierList(carriers)
{ {
var html = ''; var html = '';
if (carriers.length > 0)
{
$.each(carriers, function() { $.each(carriers, function() {
html += '<option value="'+this.id_carrier+'">'+this.name+' - '+this.delay+'</option>'; html += '<option value="'+this.id_carrier+'">'+this.name+' - '+this.delay+'</option>';
}); });
$('#carrier_form').show();
$('#id_carrier').html(html); $('#id_carrier').html(html);
$('#carriers_err').hide();
}
else
{
$('#carrier_form').hide();
$('#carriers_err').show().html('{l s='No carrier can be applied to this order'}');
}
} }
function searchProducts() function searchProducts()
@@ -551,7 +561,7 @@
updateCartVouchers(jsonSummary.summary.discounts); updateCartVouchers(jsonSummary.summary.discounts);
updateAddressesList(jsonSummary.addresses, jsonSummary.cart.id_address_delivery, jsonSummary.cart.id_address_invoice); updateAddressesList(jsonSummary.addresses, jsonSummary.cart.id_address_delivery, jsonSummary.cart.id_address_invoice);
if (!jsonSummary.summary.products.length || !jsonSummary.addresses.length) if (!jsonSummary.summary.products.length || !jsonSummary.addresses.length || !jsonSummary.cart.id_carrier)
$('#carriers_part,#summary_part').hide(); $('#carriers_part,#summary_part').hide();
else else
$('#carriers_part,#summary_part').show(); $('#carriers_part,#summary_part').show();
@@ -746,7 +756,6 @@
var addresses_invoice_options = ''; var addresses_invoice_options = '';
var address_invoice_detail = ''; var address_invoice_detail = '';
var address_delivery_detail = ''; var address_delivery_detail = '';
$.each(addresses, function() { $.each(addresses, function() {
if (this.id_address == id_address_invoice) if (this.id_address == id_address_invoice)
address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city+' '+this.country; address_invoice_detail = this.company+' '+this.firstname+' '+this.lastname+'<br />'+this.address1+'<br />'+this.address2+'<br />'+this.postcode+' '+this.city+' '+this.country;
@@ -782,27 +791,10 @@
success : function(res) success : function(res)
{ {
displaySummary(res); displaySummary(res);
var x;
for(x in res.addresses)
{
if (res.addresses[x].id_address == $('#id_address_delivery option:selected').val())
displayAddressDetail('address_delivery_detail', res.addresses[x]);
else if (res.addresses[x].id_address == $('#id_address_invoice option:selected').val())
displayAddressDetail('address_invoice_detail', res.addresses[x]);
}
} }
}); });
} }
function displayAddressDetail(id, address)
{
var address_detail = address.company+' '+address.firstname+' '+address.lastname+'<br />';
address_detail += address.address1+'<br />';
address_detail += address.address2+'<br />';
address_detail += address.postcode+' '+address.city+' '+address.country;
$('#'+id).html(address_detail);
}
</script> </script>
{if $show_toolbar} {if $show_toolbar}
<div class="toolbar-placeholder"> <div class="toolbar-placeholder">
@@ -990,6 +982,8 @@
<br /> <br />
<fieldset id="carriers_part" style="display:none;"> <fieldset id="carriers_part" style="display:none;">
<legend><img src="../img/t/AdminCarriers.gif" />{l s='Carriers'}</legend> <legend><img src="../img/t/AdminCarriers.gif" />{l s='Carriers'}</legend>
<div id="carriers_err" style="display:none;" class="warn"></div>
<div id="carrier_form">
<div> <div>
<p> <p>
<label>{l s='Carriers:'} </label> <label>{l s='Carriers:'} </label>
@@ -1010,6 +1004,8 @@
<p><label for="gift_message">{l s='Gift message:'}</label><textarea id="gift_message" cols="40" rows="4"></textarea></p> <p><label for="gift_message">{l s='Gift message:'}</label><textarea id="gift_message" cols="40" rows="4"></textarea></p>
{/if} {/if}
</div> </div>
</div>
</div>
</fieldset> </fieldset>
<br /> <br />
<fieldset id="summary_part" style="display:none;"> <fieldset id="summary_part" style="display:none;">
+4 -1
View File
@@ -1604,12 +1604,15 @@ class AdminControllerCore extends Controller
_PS_JS_DIR_.'toggle.js', _PS_JS_DIR_.'toggle.js',
_PS_JS_DIR_.'tools.js', _PS_JS_DIR_.'tools.js',
_PS_JS_DIR_.'ajax.js', _PS_JS_DIR_.'ajax.js',
_PS_JS_DIR_.'notifications.js',
_PS_JS_DIR_.'toolbar.js' _PS_JS_DIR_.'toolbar.js'
)); ));
if (!Tools::getValue('submitFormAjax'))
{
$this->addJs(_PS_JS_DIR_.'notifications.js');
if (Configuration::get('PS_HELPBOX')) if (Configuration::get('PS_HELPBOX'))
$this->addJS(_PS_JS_DIR_.'helpAccess.js'); $this->addJS(_PS_JS_DIR_.'helpAccess.js');
}
} }
/** /**
* use translations files to replace english expression. * use translations files to replace english expression.