[-] BO : #PSTEST-525 - Fix problem with the page product : field must be reset if there is an errors
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12731 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -82,6 +82,7 @@
|
|||||||
var toload = new Array();
|
var toload = new Array();
|
||||||
var empty_pack_msg = '{l s='Pack is empty. You need to add at least one product to the pack before you can save it.'}';
|
var empty_pack_msg = '{l s='Pack is empty. You need to add at least one product to the pack before you can save it.'}';
|
||||||
$('#product-tab-content-wait').show();
|
$('#product-tab-content-wait').show();
|
||||||
|
var post_data = {$post_data};
|
||||||
|
|
||||||
$(document).ready(function()
|
$(document).ready(function()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -34,11 +34,11 @@
|
|||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="text">{l s='Type:'}</label>
|
<label class="text">{l s='Type:'}</label>
|
||||||
<input type="radio" name="type_product" id="simple_product" value="{Product::PTYPE_SIMPLE}" />
|
<input type="radio" name="type_product" id="simple_product" value="{Product::PTYPE_SIMPLE}" {if (isset($smarty.post.type_product) && Product::PTYPE_SIMPLE == $smarty.post.type_product)}checked="checked"{/if} />
|
||||||
<label class="radioCheck" for="simple_product">{l s='Product'}</label>
|
<label class="radioCheck" for="simple_product">{l s='Product'}</label>
|
||||||
<input type="radio" name="type_product" id="pack_product" value="{Product::PTYPE_PACK}" {if $is_pack}checked="checked"{/if} />
|
<input type="radio" name="type_product" id="pack_product" value="{Product::PTYPE_PACK}" {if $is_pack || (isset($smarty.post.type_product) && Product::PTYPE_PACK == $smarty.post.type_product)}checked="checked"{/if} />
|
||||||
<label class="radioCheck" for="pack_product">{l s='Pack'}</label>
|
<label class="radioCheck" for="pack_product">{l s='Pack'}</label>
|
||||||
<input type="radio" name="type_product" id="virtual_product" value="{Product::PTYPE_VIRTUAL}" />
|
<input type="radio" name="type_product" id="virtual_product" value="{Product::PTYPE_VIRTUAL}" {if (isset($smarty.post.type_product) && Product::PTYPE_VIRTUAL == $smarty.post.type_product)}checked="checked"{/if} />
|
||||||
<label class="radioCheck" for="virtual_product">{l s='Virtual Product (services, booking and downloadable products)'}</label>
|
<label class="radioCheck" for="virtual_product">{l s='Virtual Product (services, booking and downloadable products)'}</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -2056,6 +2056,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
$this->display = 'edit';
|
$this->display = 'edit';
|
||||||
$this->tpl_form_vars['token'] = $this->token;
|
$this->tpl_form_vars['token'] = $this->token;
|
||||||
$this->tpl_form_vars['combinationImagesJs'] = $this->getCombinationImagesJs();
|
$this->tpl_form_vars['combinationImagesJs'] = $this->getCombinationImagesJs();
|
||||||
|
$this->tpl_form_vars['post_data'] = Tools::jsonEncode($_POST);
|
||||||
|
|
||||||
// autoload rich text editor (tiny mce)
|
// autoload rich text editor (tiny mce)
|
||||||
$this->tpl_form_vars['tinymce'] = true;
|
$this->tpl_form_vars['tinymce'] = true;
|
||||||
@@ -2602,7 +2603,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
'languages' => $languages,
|
'languages' => $languages,
|
||||||
'default_language' => $default_language,
|
'default_language' => $default_language,
|
||||||
'ps_ssl_enabled' => Configuration::get('PS_SSL_ENABLED'),
|
'ps_ssl_enabled' => Configuration::get('PS_SSL_ENABLED'),
|
||||||
'is_pack' => ($product->id && Pack::isPack($product->id)) || Tools::getValue('ppack'),
|
'is_pack' => ($product->id && Pack::isPack($product->id)) || Tools::getValue('ppack') || Tools::getValue('type_product') == Product::PTYPE_PACK,
|
||||||
'input_pack_items' => $input_pack_items,
|
'input_pack_items' => $input_pack_items,
|
||||||
'input_namepack_items' => $input_namepack_items
|
'input_namepack_items' => $input_namepack_items
|
||||||
));
|
));
|
||||||
@@ -3742,7 +3743,7 @@ class AdminProductsControllerCore extends AdminController
|
|||||||
|
|
||||||
protected function initPack(Product $product)
|
protected function initPack(Product $product)
|
||||||
{
|
{
|
||||||
$this->tpl_form_vars['is_pack'] = ($product->id && Pack::isPack($product->id)) || Tools::getValue('ppack');
|
$this->tpl_form_vars['is_pack'] = ($product->id && Pack::isPack($product->id)) || Tools::getValue('ppack') || Tools::getValue('type_product') == Product::PTYPE_PACK;
|
||||||
$product->packItems = Pack::getItems($product->id, $this->context->language->id);
|
$product->packItems = Pack::getItems($product->id, $this->context->language->id);
|
||||||
|
|
||||||
$input_pack_items = '';
|
$input_pack_items = '';
|
||||||
|
|||||||
@@ -235,6 +235,7 @@ function displayTabProductById(id, selected, index, stack)
|
|||||||
url : myurl,
|
url : myurl,
|
||||||
async : true,
|
async : true,
|
||||||
cache: false, // cache needs to be set to false or IE will cache the page with outdated product values
|
cache: false, // cache needs to be set to false or IE will cache the page with outdated product values
|
||||||
|
data: post_data,
|
||||||
success : function(data)
|
success : function(data)
|
||||||
{
|
{
|
||||||
tab_selector.html(data);
|
tab_selector.html(data);
|
||||||
|
|||||||
Reference in New Issue
Block a user