[*] BO : #PSFV-94 - added AdminShippingController

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9727 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-10-28 15:46:01 +00:00
parent 4e0a3102a3
commit bb01a8debc
6 changed files with 331 additions and 324 deletions
@@ -26,7 +26,11 @@
<script type="text/javascript">
id_language = Number({$current_id_lang});
</script>
<form action="{$current}&submitOptions{$table}=1&token={$token}" method="post" enctype="multipart/form-data">
<form action="{$current}&submitOptions{$table}=1&token={$token}"
{if isset($categoryData['name'])} name={$categoryData['name']}{/if}
{if isset($categoryData['id'])} id={$categoryData['id']} {/if}
method="post"
enctype="multipart/form-data">
{foreach $option_list AS $category => $categoryData}
{if isset($categoryData['top'])}{$categoryData['top']}{/if}
<fieldset {if isset($categoryData['class'])}class="{$categoryData['class']}"{/if}>
@@ -38,7 +42,7 @@
{* Category description *}
{if (isset($categoryData['description']) && $categoryData['description'])}
<p class="optionsDescription">{$categoryData['description']}</p>
<div class="optionsDescription">{$categoryData['description']}</div>
{/if}
{* Category info *}
{if (isset($categoryData['info']) && $categoryData['info'])}
@@ -62,11 +66,15 @@
<div class="margin-form">
{/block}
{if $field['type'] == 'select'}
<select name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}">
{foreach $field['list'] AS $k => $option}
<option value="{$option[$field['identifier']]}"{if $field['value'] == $option[$field['identifier']]} selected="selected"{/if}>{$option['name']}</option>
{/foreach}
</select>
{if $field['list']}
<select name="{$key}"{if isset($field['js'])} onchange="{$field['js']}"{/if} id="{$key}">
{foreach $field['list'] AS $k => $option}
<option value="{$option[$field['identifier']]}"{if $field['value'] == $option[$field['identifier']]} selected="selected"{/if}>{$option['name']}</option>
{/foreach}
</select>
{else if isset($input.empty_message)}
{$input.empty_message}
{/if}
{elseif $field['type'] == 'bool'}
<label class="t" for="{$key}_on"><img src="../img/admin/enabled.gif" alt="{l s='Yes'}" title="{l s='Yes'}" /></label>
<input type="radio" name="{$key}" id="{$key}_on" value="1" {if $field['value']} checked="checked"{/if}{if isset($field['js']['on'])} {$field['js']['on']}{/if}/>
@@ -89,10 +97,10 @@
*}
{elseif $field['type'] == 'text'}
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" />
{if isset($field['next'])}&nbsp;{$field['next']|strval}{/if}
{if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if}
{elseif $field['type'] == 'password'}
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="" />
{if isset($field['next'])}&nbsp;{$field['next']|strval}{/if}
{if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if}
{elseif $field['type'] == 'textarea'}
<textarea name={$key} cols="{$field['cols']}" rows="{$field['rows']}">{$field['value']|escape:'htmlall':'UTF-8'}</textarea>
{elseif $field['type'] == 'file'}
@@ -0,0 +1,107 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{$content}
<br /><br />
<h2>{l s='Fees by carrier, geographical zone, and ranges'}</h2>
<form action="{$action_fees}" id="fees" name="fees" method="post">
<fieldset>
<legend><img src="../img/admin/delivery.gif" />{l s='Fees'}</legend>
{if empty($carriers)}
{l s='You only have free carriers, there is no need to configure your delivery prices.'}
{else}
<b>{l s='Carrier:'} </b>
<select name="id_carrier2" onchange="$('#fees').attr('action', $('#fees').attr('action')+'&id_carrier='+$(this).attr('value')); $('#fees').submit();">
{foreach $carriers AS $carrier}
<option value="{$carrier['id_carrier']|intval}" {if $carrier['id_carrier'] == $id_carrier} selected="selected"{/if}>{$carrier['name']}</option>
{/foreach}
</select><br />
<table class="table space" cellpadding="0" cellspacing="0">
<tr>
<th>{l s='Zone / Range'}</th>
{if !$carrierSelected->is_free}
{foreach $ranges AS $range}
<th style="font-size: 11px;">{$range['delimiter1']|floatval}{$suffix} {l s='to'} {$range['delimiter2']|floatval}{$suffix}</th>
{/foreach}
{/if}
</tr>
{if sizeof($ranges) && !$carrierSelected->is_free}
{if sizeof($zones) > 1}
<tr>
<th style="height: 30px;">{l s='All'}</th>
{foreach $ranges AS $range}
<td class="center">
{$currency->getSign('left')}
<input type="text" id="fees_all_{$range[$rangeIdentifier]}" onchange="this.value = this.value.replace(/,/g, \'.\');" onkeyup="if ((event.keyCode||event.which) != 9){ spreadFees('.$range[$rangeIdentifier].') }" style="width: 45px;" />
{$currency->getSign('right')}
</td>
{/foreach}
</tr>
{/if}
{foreach $zones AS $zone}
<tr>
<th style="height: 30px;">{$zone['name']}</th>
{foreach $ranges AS $range}
{if isset($deliveryArray[$zone['id_zone']][$id_carrier][$range[$rangeIdentifier]])}
{$price = $deliveryArray[$zone['id_zone']][$id_carrier][$range[$rangeIdentifier]]}
{else}
{$price = '0.00'}
{/if}
<td class="center">
{$currency->getSign('left')}
<input
type="text"
class="fees_{$range[$rangeIdentifier]}"
onchange="this.value = this.value.replace(/,/g, \'.\');" name="fees_{$zone['id_zone']}_{$range[$rangeIdentifier]}" onkeyup="clearAllFees({$range[$rangeIdentifier]})"
value="{$price}"
style="width: 45px;"
/>
{$currency->getSign('right')}
</td>
{/foreach}
</tr>
{/foreach}
{/if}
<tr>
<td colspan="{$ranges|sizeof + 1}" class="center" style="border-bottom: none; height: 40px;">
<input type="hidden" name="submitFees{$table}" value="1" />
{if sizeof($ranges) && !$carrierSelected->is_free}
<input type="submit" value="{l s=' Save '}" class="button" />
{else if $carrierSelected->is_free}
{l s='This is a free carrier'}
{else}
{l s='No ranges set for this carrier'}
{/if}
</td>
</tr>
</table>
<p>{l s='Prices do not include tax.'}</p>
{/if}
<input type="hidden" name="id_carrier" value="{$id_carrier}" />
</fieldset>
</form>
+3 -3
View File
@@ -37,7 +37,7 @@
{* Category description *}
{if (isset($categoryData['description']) && $categoryData['description'])}
<p class="optionsDescription">{$categoryData['description']}</p>
<div class="optionsDescription">{$categoryData['description']}</div>
{/if}
{foreach $categoryData['fields'] AS $key => $field}
@@ -79,10 +79,10 @@
*}
{elseif $field['type'] == 'text'}
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="{$field['value']|escape:'htmlall':'UTF-8'}" />
{if isset($field['next'])}&nbsp;{$field['next']|strval}{/if}
{if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if}
{elseif $field['type'] == 'password'}
<input type="{$field['type']}"{if isset($field['id'])} id="{$field['id']}"{/if} size="{if isset($field['size'])}{$field['size']|intval}{else}5{/if}" name="{$key}" value="" />
{if isset($field['next'])}&nbsp;{$field['next']|strval}{/if}
{if isset($field['suffix'])}&nbsp;{$field['suffix']|strval}{/if}
{elseif $field['type'] == 'textarea'}
<textarea name={$key} cols="{$field['cols']}" rows="{$field['rows']}">{$field['value']|escape:'htmlall':'UTF-8'}</textarea>
{elseif $field['type'] == 'file'}