// quantities product modified + line bootsrap added in order, categories and attributes group controllers

This commit is contained in:
sLorenzini committed 2013-07-10 12:21:22 +02:00
1 parent ec466b8c70
commit 8b33ac5aca
4 files changed
+152 -166

No files matched your search

@@ -25,13 +25,12 @@
{if isset($product->id)} {if isset($product->id)}
<input type="hidden" name="submitted_tabs[]" value="Quantities" /> <input type="hidden" name="submitted_tabs[]" value="Quantities" />
<h4>{l s='Available quantities for sale'}</h4> <legend>{l s='Available quantities for sale'}</legend>
<div class="separation"></div>
{if !$ps_stock_management} {if !$ps_stock_management}
<div class="alert alert-info" style="display:block; position:auto;">{l s='The stock management is disabled'}</div> <div class="alert alert-info">{l s='The stock management is disabled'}</div>
{else} {else}
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Quantities"} {include file="controllers/products/multishop/check_fields.tpl" product_tab="Quantities"}
<div class="alert alert-info" style="display:block; position:'auto';"> <div class="alert alert-info">
<p>{l s='This interface allows you to manage available quantities for sale for products. It also allows you to manage product combinations in the current shop.'}</p> <p>{l s='This interface allows you to manage available quantities for sale for products. It also allows you to manage product combinations in the current shop.'}</p>
<p>{l s='You can choose whether or not to use the advanced stock management system for this product.'}</p> <p>{l s='You can choose whether or not to use the advanced stock management system for this product.'}</p>
<p>{l s='You can manually specify the quantities for the product/each product combination, or you can choose to automatically determine these quantities based on your stock (if advanced stock management is activated).'}</p> <p>{l s='You can manually specify the quantities for the product/each product combination, or you can choose to automatically determine these quantities based on your stock (if advanced stock management is activated).'}</p>
@@ -40,17 +39,19 @@
<p>{l s='For packs: If it has products that use advanced stock management, you have to specify a common warehouse for these products in the pack.'}</p> <p>{l s='For packs: If it has products that use advanced stock management, you have to specify a common warehouse for these products in the pack.'}</p>
<p>{l s='Also, please note that when a product has combinations, its default combination will be used in stock movements.'}</p> <p>{l s='Also, please note that when a product has combinations, its default combination will be used in stock movements.'}</p>
</div> </div>
<br />
{if $show_quantities == true} {if $show_quantities == true}
<div class="alert alert-block" id="available_quantity_ajax_msg" style="display: none;"></div> <div class="alert alert-block" id="available_quantity_ajax_msg" style="display: none;"></div>
<div class="error" id="available_quantity_ajax_error_msg" style="display: none;"></div> <div class="error" id="available_quantity_ajax_error_msg" style="display: none;"></div>
<div class="alert" id="available_quantity_ajax_success_msg" style="display: none;"></div> <div class="alert" id="available_quantity_ajax_success_msg" style="display: none;"></div>
<table cellpadding="5" style="width:100%">
<tbody>
<tr {if $product->is_virtual || $product->cache_is_pack}style="display:none;"{/if} class="stockForVirtualProduct"> <div {if $product->is_virtual || $product->cache_is_pack}style="display:none;"{/if} class="row stockForVirtualProduct">
<td valign="top" style="vertical-align:top;"> <div class="col-lg-12">
<input <p class="checkbox">
<label for="advanced_stock_management">
<input type="checkbox" name="advanced_stock_management" class="advanced_stock_management" id="advanced_stock_management"
{if $product->advanced_stock_management == 1 && $stock_management_active == 1} {if $product->advanced_stock_management == 1 && $stock_management_active == 1}
value="1" checked="checked" value="1" checked="checked"
{else} {else}
@@ -59,127 +60,109 @@
{if $stock_management_active == 0 || $product->cache_is_pack} {if $stock_management_active == 0 || $product->cache_is_pack}
disabled="disabled" disabled="disabled"
{/if} {/if}
type="checkbox" name="advanced_stock_management" class="advanced_stock_management" id="advanced_stock_management" /> />
<label style="float:none;font-weight:normal" for="advanced_stock_management"> {l s='I want to use the advanced stock management system for this product.'}
{l s='I want to use the advanced stock management system for this product.'} {if $stock_management_active == 0 && !$product->cache_is_pack}&nbsp;-&nbsp;{l s='This requires you to enable advanced stock management.'}
{if $stock_management_active == 0 && !$product->cache_is_pack} {else if $product->cache_is_pack}&nbsp;-&nbsp;{l s='This parameter depends on the product(s) in the pack.'}
&nbsp;-&nbsp;<b>{l s='This requires you to enable advanced stock management.'}</b> {/if}
{else if $product->cache_is_pack} </label>
&nbsp;-&nbsp;<b>{l s='This parameter depends on the product(s) in the pack.'}</b> </p>
{/if} </div>
</label> </div>
<br /><br />
</td> <div {if $product->is_virtual || $product->cache_is_pack}style="display:none;"{/if} class="row stockForVirtualProduct">
</tr> <label class="control-label col-lg-3">{l s='Available quantities:'}</label>
<tr {if $product->is_virtual || $product->cache_is_pack}style="display:none;"{/if} class="stockForVirtualProduct"> <div class="col-lg-9">
<td valign="top" style="vertical-align:top;"> <p class="radio">
<input <label for="depends_on_stock_1">
<input type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_1" value="1"
{if $product->depends_on_stock == 1 && $stock_management_active == 1} {if $product->depends_on_stock == 1 && $stock_management_active == 1}
checked="checked" checked="checked"
{/if} {/if}
{if $stock_management_active == 0 || $product->advanced_stock_management == 0 || $product->cache_is_pack} {if $stock_management_active == 0 || $product->advanced_stock_management == 0 || $product->cache_is_pack}
disabled="disabled" disabled="disabled"
{/if} {/if}
type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_1" value="1"/> />
<label style="float:none;font-weight:normal" for="depends_on_stock_1"> {l s='Available quantities for current product and its combinations are based on warehouse stock. '}
{l s='Available quantities for current product and its combinations are based on warehouse stock. '} {if ($stock_management_active == 0 || $product->advanced_stock_management == 0) && !$product->cache_is_pack} &nbsp;-&nbsp;{l s='This requires you to enable advanced stock management globally or for this product.'}
{if ($stock_management_active == 0 || $product->advanced_stock_management == 0) && !$product->cache_is_pack} {else if $product->cache_is_pack} &nbsp;-&nbsp;{l s='This parameter depends on the product(s) in the pack.'}
&nbsp;-&nbsp;<b>{l s='This requires you to enable advanced stock management globally or for this product.'}</b> {/if}
{else if $product->cache_is_pack} </label>
&nbsp;-&nbsp;<b>{l s='This parameter depends on the product(s) in the pack.'}</b> </p>
{/if} <p class="radio">
</label> <label for="depends_on_stock_0">
<br /><br /> <input type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_0" value="0"
</td>
</tr>
<tr {if $product->is_virtual || $product->cache_is_pack}style="display:none;"{/if} class="stockForVirtualProduct">
<td valign="top" style="vertical-align:top;">
<input
{if $product->depends_on_stock == 0 || $stock_management_active == 0} {if $product->depends_on_stock == 0 || $stock_management_active == 0}
checked="checked" checked="checked"
{/if} {/if}
type="radio" name="depends_on_stock" class="depends_on_stock" id="depends_on_stock_0" value="0"/> />
<label style="float:none;font-weight:normal" for="depends_on_stock_0"> {l s='I want to specify available quantities manually.'}
{l s='I want to specify available quantities manually.'} </label>
</label> </p>
<br /><br /> </div>
</td> </div>
</tr>
{if isset($pack_quantity)} {if isset($pack_quantity)}
<div class="alert alert-info">
<p>{l s='When a product has combinations, quantities will be based on the default combination.'}</p>
<p>{l s='Given the quantities of the products in this pack, the maximum quantity should be:'} {$pack_quantity}</p>
</div>
{/if}
<table class="table table-hover">
<colgroup>
<col width="50">
<col>
</colgroup>
<thead>
<tr> <tr>
<td valign="top" style="text-align:left;vertical-align:top;"> <th>{l s='Quantity'}</th>
<p><b>{l s='When a product has combinations, quantities will be based on the default combination.'}</b></p> <th>{l s='Designation'}</th>
<p><b>{l s='Given the quantities of the products in this pack, the maximum quantity should be:'} {$pack_quantity}</b></p>
</td>
</tr> </tr>
{/if} </thead>
{foreach from=$attributes item=attribute}
<tr> <tr>
<td valign="top" style="text-align:left;vertical-align:top;"> <td class="available_quantity" id="qty_{$attribute['id_product_attribute']}">
<table class="table" cellpadding="0" cellspacing="0" style="width:100%;"> <span>{$available_quantity[$attribute['id_product_attribute']]}</span>
<colgroup> <input type="text" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/>
<col width="50">
<col>
</colgroup>
<thead>
<tr>
<th>{l s='Quantity'}</th>
<th>{l s='Designation'}</th>
</tr>
</thead>
<tbody>
{foreach from=$attributes item=attribute}
<tr>
<td class="available_quantity" id="qty_{$attribute['id_product_attribute']}">
<span>{$available_quantity[$attribute['id_product_attribute']]}</span>
<input type="text" value="{$available_quantity[$attribute['id_product_attribute']]|htmlentities}"/>
</td>
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
</tr>
{/foreach}
</tbody>
</table>
</td> </td>
<td>{$product_designation[$attribute['id_product_attribute']]}</td>
</tr> </tr>
<tr id="when_out_of_stock"> {/foreach}
<td>
<table style="margin-top: 15px;">
<tbody>
<tr>
<td class="col-left"><label>{l s='When out of stock:'}</label></td>
<td style="padding-bottom:5px;">
<ul class="listForm">
<li>
<input {if $product->out_of_stock == 0} checked="checked" {/if} id="out_of_stock_1" type="radio" checked="checked" value="0" class="out_of_stock" name="out_of_stock">
<label id="label_out_of_stock_1" class="t" for="out_of_stock_1">{l s='Deny orders'}</label>
</li>
<li>
<input {if $product->out_of_stock == 1} checked="checked" {/if} id="out_of_stock_2" type="radio" value="1" class="out_of_stock" name="out_of_stock">
<label id="label_out_of_stock_2" class="t" for="out_of_stock_2">{l s='Allow orders'}</label>
</li>
<li>
<input {if $product->out_of_stock == 2} checked="checked" {/if} id="out_of_stock_3" type="radio" value="2" class="out_of_stock" name="out_of_stock">
<label id="label_out_of_stock_3" class="t" for="out_of_stock_3">
{l s='Default'}:
{if $order_out_of_stock == 1}
<i>{l s='Allow orders'}</i>
{else}
<i>{l s='Deny orders'}</i>
{/if}
<a class="confirm_leave" href="index.php?tab=AdminPPreferences&token={$token_preferences}">
{l s='as set in Preferences'}
</a>
</label>
</li>
</ul>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table> </table>
<div id="when_out_of_stock" class="row">
<label class="control-label col-lg-3">{l s='When out of stock:'}</label>
<div class="col-lg-9">
<p class="checkbox">
<label id="label_out_of_stock_1" for="out_of_stock_1">
<input {if $product->out_of_stock == 0} checked="checked" {/if} id="out_of_stock_1" type="radio" checked="checked" value="0" class="out_of_stock" name="out_of_stock">
{l s='Deny orders'}
</label>
</p>
<p class="checkbox">
<label id="label_out_of_stock_2" for="out_of_stock_2">
<input {if $product->out_of_stock == 1} checked="checked" {/if} id="out_of_stock_2" type="radio" value="1" class="out_of_stock" name="out_of_stock">
{l s='Allow orders'}
</label>
</p>
<p class="checkbox">
<label id="label_out_of_stock_3" for="out_of_stock_3">
<input {if $product->out_of_stock == 2} checked="checked" {/if} id="out_of_stock_3" type="radio" value="2" class="out_of_stock" name="out_of_stock">
{l s='Default'}:
{if $order_out_of_stock == 1}
{l s='Allow orders'}
{else}
{l s='Deny orders'}
{/if}
<a class="confirm_leave" href="index.php?tab=AdminPPreferences&token={$token_preferences}">
{l s='as set in Preferences'}
</a>
</label>
</p>
</div>
</div>
{else} {else}
<div class="alert alert-block"> <div class="alert alert-block">
<p>{l s='It is not possible to manage quantities when:'}</p> <p>{l s='It is not possible to manage quantities when:'}</p>
@@ -191,60 +174,60 @@
</div> </div>
{/if} {/if}
{/if} {/if}
<div class="separation"></div>
<h4>{l s='Availability settings'}</h4> <hr>
<table cellpadding="5"> <legend>{l s='Availability settings'}</legend>
{if !$has_attribute}
<tr> {if !$has_attribute}
<td class="col-left"><label>{l s='Minimum quantity:'}</label></td> <div class="row">
<td style="padding-bottom:5px;"> <label class="control-label col-lg-3">{l s='Minimum quantity:'}</label>
<input size="3" maxlength="6" name="minimal_quantity" id="minimal_quantity" type="text" value="{$product->minimal_quantity|default:1}" /> <div class="col-lg-1">
<p class="preference_description">{l s='The minimum quantity to buy this product (set to 1 to disable this feature)'}</p> <input maxlength="6" name="minimal_quantity" id="minimal_quantity" type="text" value="{$product->minimal_quantity|default:1}" />
</td> </div>
</tr> <p class="help-block">{l s='The minimum quantity to buy this product (set to 1 to disable this feature)'}</p>
{/if} </div>
{if $ps_stock_management} {/if}
<tr>
<td class="col-left"> {if $ps_stock_management}
{include file="controllers/products/multishop/checkbox.tpl" field="available_now" type="default" multilang="true"} {include file="controllers/products/multishop/checkbox.tpl" field="available_now" type="default" multilang="true"}
<label>{l s='Displayed text when in-stock:'}</label> <div class="row">
</td> <label class="control-label col-lg-3">{l s='Displayed text when in-stock:'}</label>
<td style="padding-bottom:5px;" class="col-right"> <div class="col-lg-8">
{include file="controllers/products/input_text_lang.tpl" <div class="row">
languages=$languages {include file="controllers/products/input_text_lang.tpl"
input_value=$product->available_now languages=$languages
input_name='available_now'} input_value=$product->available_now
<span class="alert alert-info" name="help_box">{l s='Forbidden characters:'} <>;=#{}<span class="hint-pointer">&nbsp;</span></span> input_name='available_now'}
</td> </div>
</tr> </div>
<tr> <p class="help-block" name="help_box">{l s='Forbidden characters:'} &#60;&#62;;&#61;#&#123;&#125;</p>
<td class="col-left"> </div>
{include file="controllers/products/multishop/checkbox.tpl" field="available_later" type="default" multilang="true"} <div class="row">
<label>{l s='Displayed text when back-ordereding is allowed:'}</label> {include file="controllers/products/multishop/checkbox.tpl" field="available_later" type="default" multilang="true"}
</td> <label class="control-label col-lg-3">{l s='Displayed text when back-ordereding is allowed:'}</label>
<td style="padding-bottom:5px;" class="col-right"> <div class="col-lg-8">
{include file="controllers/products/input_text_lang.tpl" <div class="row">
languages=$languages {include file="controllers/products/input_text_lang.tpl"
input_value=$product->available_later languages=$languages
input_name='available_later'} input_value=$product->available_later
<span class="alert alert-info" name="help_box">{l s='Forbidden characters:'} <>;=#{}<span class="hint-pointer">&nbsp;</span></span> input_name='available_later'}
</td> </div>
</tr> </div>
{if !$countAttributes} <p class="help-block" name="help_box">{l s='Forbidden characters:'} &#60;&#62;;&#61;#&#123;&#125;</p>
<tr> </div>
<td class="col-left"><label>{l s='Available date:'}</label></td>
<td style="padding-bottom:5px;">
<input id="available_date" name="available_date" value="{$product->available_date}" class="datepicker"
style="text-align: center;" type="text" /> {if !$countAttributes}
<p>{l s='The available date when this product is out of stock.'}</p> <label>{l s='Available date:'}</label>
</td> <input id="available_date" name="available_date" value="{$product->available_date}" class="datepicker" type="text" />
</tr> <p>{l s='The available date when this product is out of stock.'}</p>
{/if}
{/if} {/if}
</table> {/if}
<script type="text/javascript"> <script type="text/javascript">
var quantities_ajax_success = '{l s='Data saved'}'; var quantities_ajax_success = '{l s='Data saved'}';
var quantities_ajax_waiting = '{l s='Saving data...'}'; var quantities_ajax_waiting = '{l s='Saving data...'}';
</script> </script>
{/if} {/if}
{*$default_language*}
@@ -31,6 +31,7 @@ class AdminAttributesGroupsControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->context = Context::getContext(); $this->context = Context::getContext();
$this->table = 'attribute_group'; $this->table = 'attribute_group';
$this->identifier = 'id_attribute_group'; $this->identifier = 'id_attribute_group';
@@ -40,6 +40,7 @@ class AdminCategoriesControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->table = 'category'; $this->table = 'category';
$this->className = 'Category'; $this->className = 'Category';
$this->lang = true; $this->lang = true;
@@ -30,6 +30,7 @@ class AdminOrdersControllerCore extends AdminController
public function __construct() public function __construct()
{ {
$this->bootstrap = true;
$this->table = 'order'; $this->table = 'order';
$this->className = 'Order'; $this->className = 'Order';
$this->lang = false; $this->lang = false;