[-] BO : #PSCFV-3366 - Not possible to create customizable fields on multishop context

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16635 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
mDeflotte
2012-08-01 08:15:35 +00:00
parent 218236c1ee
commit 66dc8389dd
3 changed files with 22 additions and 3 deletions
@@ -28,17 +28,24 @@
<input type="hidden" name="submitted_tabs[]" value="Customization" />
<h4>{l s='Add or modify customizable properties'}</h4>
{include file="controllers/products/multishop/check_fields.tpl" product_tab="Customization"}
<div class="separation"></div><br />
<table cellpadding="5" style="width:100%">
<tr>
<td style="width:150px;text-align:right;padding-right:10px;font-weight:bold;vertical-align:top;" valign="top">{l s='File fields:'}</td>
<td style="width:150px;text-align:right;padding-right:10px;font-weight:bold;vertical-align:top;" valign="top">
{include file="controllers/products/multishop/checkbox.tpl" field="uploadable_files" type="default"}
<label>{l s='File fields:'}</label>
</td>
<td style="padding-bottom:5px;">
<input type="text" name="uploadable_files" id="uploadable_files" size="4" value="{$uploadable_files|htmlentities}" />
<p class="preference_description">{l s='Number of upload file fields displayed'}</p>
</td>
</tr>
<tr>
<td style="width:150px;text-align:right;padding-right:10px;font-weight:bold;vertical-align:top;" valign="top">{l s='Text fields:'}</td>
<td style="width:150px;text-align:right;padding-right:10px;font-weight:bold;vertical-align:top;" valign="top">
{include file="controllers/products/multishop/checkbox.tpl" field="text_fields" type="default"}
<label>{l s='Text fields:'}</label>
</td>
<td style="padding-bottom:5px;">
<input type="text" name="text_fields" id="text_fields" size="4" value="{$text_fields|htmlentities}" />
<p class="preference_description">{l s='Number of text fields displayed'}</p>
+1 -1
View File
@@ -247,7 +247,6 @@ class ProductCore extends ObjectModel
'depth' => array('type' => self::TYPE_FLOAT, 'validate' => 'isUnsignedFloat'),
'weight' => array('type' => self::TYPE_FLOAT, 'validate' => 'isUnsignedFloat'),
'quantity_discount' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
'uploadable_files' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'ean13' => array('type' => self::TYPE_STRING, 'validate' => 'isEan13', 'size' => 13),
'upc' => array('type' => self::TYPE_STRING, 'validate' => 'isUpc', 'size' => 12),
'cache_is_pack' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
@@ -268,6 +267,7 @@ class ProductCore extends ObjectModel
'additional_shipping_cost' => array('type' => self::TYPE_FLOAT, 'shop' => true, 'validate' => 'isPrice'),
'customizable' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedInt'),
'text_fields' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedInt'),
'uploadable_files' => array('type' => self::TYPE_INT, 'shop' => true, 'validate' => 'isUnsignedInt'),
'active' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'available_for_order' => array('type' => self::TYPE_BOOL, 'shop' => true, 'validate' => 'isBool'),
'available_date' => array('type' => self::TYPE_DATE, 'shop' => true, 'validate' => 'isDateFormat'),
+12
View File
@@ -27,6 +27,12 @@
// The ProductTabsManager instance will make sure the onReady() methods of each tabs are executed once the tab has loaded
var product_tabs = [];
product_tabs['Customization'] = new function(){
this.onReady = function(){
if (display_multishop_checkboxes)
ProductMultishop.checkAllCustomization();
}
}
product_tabs['Combinations'] = new function(){
var self = this;
this.bindEdit = function(){
@@ -1543,6 +1549,12 @@ var ProductMultishop = new function()
ProductMultishop.checkField($('input[name=\'multishop_check[id_category_default]\']').prop('checked'), 'categories-treeview', 'category_box');
};
this.checkAllCustomization = function()
{
ProductMultishop.checkField($('input[name=\'multishop_check[uploadable_files]\']').prop('checked'), 'uploadable_files');
ProductMultishop.checkField($('input[name=\'multishop_check[text_fields]\']').prop('checked'), 'text_fields');
};
this.checkAllCombinations = function()
{
ProductMultishop.checkField($('input[name=\'multishop_check[attribute_wholesale_price]\']').prop('checked'), 'attribute_wholesale_price');