[-] BO : fixed some bug on carrier wizard - added tabindex on input - new default carrier img
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
<script>var zones_nbr = {$zones|count};</script>
|
||||||
<div style="float:left" id="zone_ranges">
|
<div style="float:left" id="zone_ranges">
|
||||||
<table cellpadding="5" cellspacing="0" id="zones_table">
|
<table cellpadding="5" cellspacing="0" id="zones_table">
|
||||||
<tr class="range_inf">
|
<tr class="range_inf">
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
*}
|
*}
|
||||||
|
|
||||||
<div id="carrier_logo_block">
|
<div id="carrier_logo_block">
|
||||||
<img id="carrier_logo_img" src="{if $carrier_logo}{$carrier_logo}{else}../img/404.gif{/if}" />
|
<img id="carrier_logo_img" src="{if $carrier_logo}{$carrier_logo}{else}../img/admin/carrier-default.jpg{/if}" />
|
||||||
<p>
|
<p>
|
||||||
<input id="carrier_logo_input" type="file" onchange="uploadCarrierLogo();" name="carrier_logo_input" />
|
<input id="carrier_logo_input" type="file" onchange="uploadCarrierLogo();" name="carrier_logo_input" />
|
||||||
<input type="hidden" id="logo" name="logo" value="" />
|
<input type="hidden" id="logo" name="logo" value="" />
|
||||||
|
|||||||
@@ -1290,7 +1290,7 @@ class CarrierCore extends ObjectModel
|
|||||||
public function setGroups($groups, $delete = true)
|
public function setGroups($groups, $delete = true)
|
||||||
{
|
{
|
||||||
if ($delete)
|
if ($delete)
|
||||||
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$id_carrier);
|
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$this->id);
|
||||||
if (!count($groups))
|
if (!count($groups))
|
||||||
return true;
|
return true;
|
||||||
$sql = 'INSERT INTO '._DB_PREFIX_.'carrier_group (id_carrier, id_group) VALUES ';
|
$sql = 'INSERT INTO '._DB_PREFIX_.'carrier_group (id_carrier, id_group) VALUES ';
|
||||||
|
|||||||
@@ -224,26 +224,6 @@ class AdminCarrierWizardControllerCore extends AdminController
|
|||||||
'form' => array(
|
'form' => array(
|
||||||
'id_form' => 'step_carrier_ranges',
|
'id_form' => 'step_carrier_ranges',
|
||||||
'input' => array(
|
'input' => array(
|
||||||
array(
|
|
||||||
'type' => 'radio',
|
|
||||||
'label' => $this->l('Apply shipping cost:'),
|
|
||||||
'name' => 'is_free',
|
|
||||||
'required' => false,
|
|
||||||
'class' => 't',
|
|
||||||
'values' => array(
|
|
||||||
array(
|
|
||||||
'id' => 'is_free_off',
|
|
||||||
'value' => 0,
|
|
||||||
'label' => '<img src="../img/admin/enabled.gif" alt="'.$this->l('Yes').'" title="'.$this->l('Yes').'" />'
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'id' => 'is_free_on',
|
|
||||||
'value' => 1,
|
|
||||||
'label' => '<img src="../img/admin/disabled.gif" alt="'.$this->l('No').'" title="'.$this->l('No').'" />'
|
|
||||||
)
|
|
||||||
),
|
|
||||||
'desc' => $this->l('Apply both regular shipping cost and product-specific shipping costs.')
|
|
||||||
),
|
|
||||||
array(
|
array(
|
||||||
'type' => 'radio',
|
'type' => 'radio',
|
||||||
'label' => $this->l('Shipping and handling:'),
|
'label' => $this->l('Shipping and handling:'),
|
||||||
@@ -265,6 +245,26 @@ class AdminCarrierWizardControllerCore extends AdminController
|
|||||||
),
|
),
|
||||||
'desc' => $this->l('Include the shipping and handling costs in the carrier price.')
|
'desc' => $this->l('Include the shipping and handling costs in the carrier price.')
|
||||||
),
|
),
|
||||||
|
array(
|
||||||
|
'type' => 'radio',
|
||||||
|
'label' => $this->l('Apply shipping cost:'),
|
||||||
|
'name' => 'is_free',
|
||||||
|
'required' => false,
|
||||||
|
'class' => 't',
|
||||||
|
'values' => array(
|
||||||
|
array(
|
||||||
|
'id' => 'is_free_off',
|
||||||
|
'value' => 0,
|
||||||
|
'label' => '<img src="../img/admin/enabled.gif" alt="'.$this->l('Yes').'" title="'.$this->l('Yes').'" />'
|
||||||
|
),
|
||||||
|
array(
|
||||||
|
'id' => 'is_free_on',
|
||||||
|
'value' => 1,
|
||||||
|
'label' => '<img src="../img/admin/disabled.gif" alt="'.$this->l('No').'" title="'.$this->l('No').'" />'
|
||||||
|
)
|
||||||
|
),
|
||||||
|
'desc' => $this->l('Apply both regular shipping cost and product-specific shipping costs.')
|
||||||
|
),
|
||||||
array(
|
array(
|
||||||
'type' => 'radio',
|
'type' => 'radio',
|
||||||
'label' => $this->l('Billing:'),
|
'label' => $this->l('Billing:'),
|
||||||
|
|||||||
@@ -2518,3 +2518,5 @@ margin-bottom:7px;
|
|||||||
#carrier_wizard #zones_table input[type=text] {width: 45px;}
|
#carrier_wizard #zones_table input[type=text] {width: 45px;}
|
||||||
|
|
||||||
#carrier_logo_block{position: absolute;right: 15px;}
|
#carrier_logo_block{position: absolute;right: 15px;}
|
||||||
|
|
||||||
|
#carrier_wizard #fieldset_form { min-height: 190px}
|
||||||
|
|||||||
BIN
img/admin/carrier-default.jpg
Normal file
BIN
img/admin/carrier-default.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 KiB |
@@ -214,6 +214,7 @@ function bind_inputs()
|
|||||||
$('tr.fees').each( function () {
|
$('tr.fees').each( function () {
|
||||||
$(this).children('td:eq('+index+')').remove();
|
$(this).children('td:eq('+index+')').remove();
|
||||||
});
|
});
|
||||||
|
rebuildTabindex();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -270,7 +271,7 @@ function bind_inputs()
|
|||||||
var is_free = $(this);
|
var is_free = $(this);
|
||||||
$("#step_carrier_ranges .margin-form").each(function() {
|
$("#step_carrier_ranges .margin-form").each(function() {
|
||||||
var field = $(this).children().attr('name');
|
var field = $(this).children().attr('name');
|
||||||
if (typeof(field) != 'undefined' && field != 'is_free')
|
if (typeof(field) != 'undefined' && field != 'is_free' && field != 'shipping_handling')
|
||||||
{
|
{
|
||||||
if (parseInt(is_free.val()))
|
if (parseInt(is_free.val()))
|
||||||
{
|
{
|
||||||
@@ -294,6 +295,7 @@ function bind_inputs()
|
|||||||
$('#zones_table').show();
|
$('#zones_table').show();
|
||||||
$('.new_range').show();
|
$('.new_range').show();
|
||||||
}
|
}
|
||||||
|
resizeWizard();
|
||||||
});
|
});
|
||||||
$('input[name="is_free"]:checked').click();
|
$('input[name="is_free"]:checked').click();
|
||||||
|
|
||||||
@@ -400,12 +402,13 @@ function add_new_range()
|
|||||||
$('tr.fees_all td:last').after('<td class="center border_top border_bottom"><input style="display:none" type="text" /> <button class="button">'+labelValidate+'</button</td>');
|
$('tr.fees_all td:last').after('<td class="center border_top border_bottom"><input style="display:none" type="text" /> <button class="button">'+labelValidate+'</button</td>');
|
||||||
|
|
||||||
$('tr.fees').each( function () {
|
$('tr.fees').each( function () {
|
||||||
$(this).children('td:last').after('<td><input disabled="disabled" name="fees['+$(this).data('zoneid')+'][]" type="text" /></td>');
|
$(this).children('td:last').after('<td class="center"><input disabled="disabled" name="fees['+$(this).data('zoneid')+'][]" type="text" /></td>');
|
||||||
});
|
});
|
||||||
$('tr.delete_range td:last').after('<td class="center"><button class="button">'+labelDelete+'</button</td>');
|
$('tr.delete_range td:last').after('<td class="center"><button class="button">'+labelDelete+'</button</td>');
|
||||||
|
|
||||||
resizeWizard();
|
resizeWizard();
|
||||||
bind_inputs();
|
bind_inputs();
|
||||||
|
rebuildTabindex();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -415,3 +418,24 @@ function delete_new_range()
|
|||||||
if ($('#new_range_form_placeholder').children('td').length = 1)
|
if ($('#new_range_form_placeholder').children('td').length = 1)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function rebuildTabindex()
|
||||||
|
{
|
||||||
|
i = 1;
|
||||||
|
zones_nbr +=3; // corresponds to the third input text (max, min and all)
|
||||||
|
$('#zones_table tr').each( function ()
|
||||||
|
{
|
||||||
|
$(this).children('td').each( function ()
|
||||||
|
{
|
||||||
|
if ($(this).index() > 2)
|
||||||
|
j = i + zones_nbr;
|
||||||
|
else if ($(this).index() == 2)
|
||||||
|
j = i;
|
||||||
|
|
||||||
|
if ($(this).index() >= 2 && $(this).find('input'))
|
||||||
|
$(this).find('input').attr('tabindex', j);
|
||||||
|
});
|
||||||
|
i ++;
|
||||||
|
});
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user