[-] BO : fixed #PSCFV-3058 SAV multi fix
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@16231 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -199,6 +199,7 @@ class ContactControllerCore extends FrontController
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addCSS(_THEME_CSS_DIR_.'contact-form.css');
|
||||
$this->addJS(_THEME_JS_DIR_.'contact-form.js');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,18 +257,15 @@ class ContactControllerCore extends FrontController
|
||||
$orders[$row['id_order']] = Tools::displayDate($date[0], $this->context->language->id);
|
||||
$tmp = $order->getProducts();
|
||||
foreach ($tmp as $key => $val)
|
||||
$products[$val['product_id']] = $val['product_name'];
|
||||
$products[$row['id_order']][$val['product_id']] = array('value' => $val['product_id'], 'label' => $val['product_name']);
|
||||
}
|
||||
|
||||
$orderList = '';
|
||||
$order_tab = array();
|
||||
foreach ($orders as $key => $val)
|
||||
$orderList .= '<option value="'.$key.'" '.((int)(Tools::getValue('id_order')) == $key ? 'selected' : '').' >'.$key.' -- '.$val.'</option>';
|
||||
$orderedProductList = '';
|
||||
|
||||
foreach ($products as $key => $val)
|
||||
$orderedProductList .= '<option value="'.$key.'" '.((int)(Tools::getValue('id_product')) == $key ? 'selected' : '').' >'.$val.'</option>';
|
||||
$this->context->smarty->assign('orderList', $orderList);
|
||||
$this->context->smarty->assign('orderedProductList', $orderedProductList);
|
||||
$order_tab[] = array('value' => $key, 'label' => $key.' -- '.$val, 'selected' => (int)(Tools::getValue('id_order')) == $key);
|
||||
|
||||
$this->context->smarty->assign('orderList', $order_tab);
|
||||
$this->context->smarty->assign('orderedProductList', $products);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,9 +73,9 @@
|
||||
<p class="text">
|
||||
<label for="email">{l s='E-mail address'}</label>
|
||||
{if isset($customerThread.email)}
|
||||
<input type="text" id="email" name="from" value="{$customerThread.email}" readonly="readonly" />
|
||||
<input type="text" id="email" name="from" value="{$customerThread.email|escape:'htmlall':'UTF-8'}" readonly="readonly" />
|
||||
{else}
|
||||
<input type="text" id="email" name="from" value="{$email}" />
|
||||
<input type="text" id="email" name="from" value="{$email|escape:'htmlall':'UTF-8'}" />
|
||||
{/if}
|
||||
</p>
|
||||
{if !$PS_CATALOG_MODE}
|
||||
@@ -83,7 +83,12 @@
|
||||
<p class="text select">
|
||||
<label for="id_order">{l s='Order ID'}</label>
|
||||
{if !isset($customerThread.id_order) && isset($isLogged) && $isLogged == 1}
|
||||
<select name="id_order" ><option value="0">{l s='-- Choose --'}</option>{$orderList}</select>
|
||||
<select name="id_order" >
|
||||
<option value="0">{l s='-- Choose --'}</option>
|
||||
{foreach from=$orderList item=order}
|
||||
<option value="{$order.value|intval}">{$order.label|escape:'htmlall':'UTF-8'}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{elseif !isset($customerThread.id_order) && !isset($isLogged)}
|
||||
<input type="text" name="id_order" id="id_order" value="{if isset($customerThread.id_order) && $customerThread.id_order > 0}{$customerThread.id_order|intval}{else}{if isset($smarty.post.id_order)}{$smarty.post.id_order|intval}{/if}{/if}" />
|
||||
{elseif $customerThread.id_order > 0}
|
||||
@@ -95,7 +100,14 @@
|
||||
<p class="text select">
|
||||
<label for="id_product">{l s='Product'}</label>
|
||||
{if !isset($customerThread.id_product)}
|
||||
<select name="id_product" style="width:300px;"><option value="0">{l s='-- Choose --'}</option>{$orderedProductList}</select>
|
||||
{foreach from=$orderedProductList key=id_order item=products name=products}
|
||||
<select name="id_product" id="{$id_order}_order_products" class="product_select" style="width:300px;{if !$smarty.foreach.products.first} display:none; {/if}" {if !$smarty.foreach.products.first}disabled="disabled" {/if}>
|
||||
<option value="0">{l s='-- Choose --'}</option>
|
||||
{foreach from=$products item=product}
|
||||
<option value="{$product.value|intval}">{$product.label|escape:'htmlall':'UTF-8'}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{/foreach}
|
||||
{elseif $customerThread.id_product > 0}
|
||||
<input type="text" name="id_product" id="id_product" value="{$customerThread.id_product|intval}" readonly="readonly" />
|
||||
{/if}
|
||||
|
||||
Executable
+37
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 2007-2012 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-2012 PrestaShop SA
|
||||
* @version Release: $Revision: 6594 $
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
$('select[name=id_order]').change(function () {
|
||||
showProductSelect($(this).attr('value'));
|
||||
});
|
||||
});
|
||||
|
||||
function showProductSelect(id_order)
|
||||
{
|
||||
$('.product_select').hide().attr('disabled', 'disabled');
|
||||
$('#'+id_order+'_order_products').show().removeAttr('disabled');
|
||||
}
|
||||
Reference in New Issue
Block a user