[-] BO : fixed bug #PSCFV-10091 - you can now enable all zone in one clic

This commit is contained in:
Vincent Augagneur
2013-08-12 14:56:49 +02:00
parent 52806c0056
commit 30c9156a41
2 changed files with 26 additions and 2 deletions
@@ -109,6 +109,7 @@ class AdminCarrierWizardControllerCore extends AdminController
'wizard_steps' => $this->wizard_steps,
'validate_url' => $this->context->link->getAdminLink('AdminCarrierWizard'),
'carrierlist_url' => $this->context->link->getAdminLink('AdminCarriers').'&conf='.((int)Validate::isLoadedObject($carrier) ? 4 : 3),
'multistore_enable' => Shop::isFeatureActive(),
'wizard_contents' => array(
'contents' => array(
0 => $this->renderStepOne($carrier),
+25 -2
View File
@@ -454,12 +454,24 @@ function validateRange(index)
return is_ok;
}
function enableZone(index)
{
$(this).children('td:eq('+index+')').children('input').removeAttr('disabled');
}
function disableZone(index)
{
$(this).children('td:eq('+index+')').children('input').attr('disabled', 'disabled');
}
function enableRange(index)
{
$('tr.fees').each( function () {
//only enable fees for enabled zones
if ($(this).children('td').children('input:checkbox').attr('checked') == 'checked')
$(this).children('td:eq('+index+')').children('input').removeAttr('disabled');
enableZone(index);
});
$('span.fees_all').show();
$('tr.fees_all td:eq('+index+')').children('input').show().removeAttr('disabled');
@@ -474,7 +486,7 @@ function disableRange(index)
$('tr.fees').each( function () {
//only enable fees for enabled zones
if ($(this).children('td').children('input:checkbox').attr('checked') == 'checked')
$(this).children('td:eq('+index+')').children('input').attr('disabled', 'disabled');
disableZone(index);
});
$('tr.fees_all td:eq('+index+')').children('input').attr('disabled', 'disabled');
$('tr.fees_all td:eq('+index+')').removeClass('validated').addClass('not_validated');
@@ -602,7 +614,18 @@ function getCorrectRangePosistion(current_inf, current_sup)
function checkAllZones(elt)
{
if($(elt).is(':checked'))
{
$('.input_zone').attr('checked', 'checked');
$('.fees input:text').each( function () {
index = $(this).parent().index();
if ($('tr.fees_all td:eq('+index+')').hasClass('validated'))
$(this).removeAttr('disabled');
})
}
else
{
$('.input_zone').removeAttr('checked');
$('.fees input:text').attr('disabled', 'disabled').val('');
}
}