Merge branch 'bootstrap' of https://github.com/PrestaShop/PrestaShop into bootstrap

This commit is contained in:
Kevin Granger
2013-12-02 11:11:29 +01:00
13 changed files with 50 additions and 40 deletions
@@ -28,6 +28,10 @@
<script type="text/javascript">
$('#product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_content').parent().hide();
$("#product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_link").fancybox();
$("#product_rule_{$product_rule_group_id|intval}_{$product_rule_id|intval}_choose_link").fancybox({
autoDimensions: false,
autoSize: false,
width: 600,
height: 250});
$(document).ready(function() { updateProductRuleShortDescription($('#product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_add')); });
</script>
@@ -1,11 +1,12 @@
<div class="col-lg-12 bootstrap">
<div class="col-lg-6">
{l s='Unselected'}
<select multiple id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_1">
<select multiple size="10" id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_1">
{foreach from=$product_rule_itemlist.unselected item='item'}
<option value="{$item.id|intval}">&nbsp;{$item.name}</option>
{/foreach}
</select>
<div class="clearfix">&nbsp;</div>
<a id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_add" class="btn btn-default btn-block" >
{l s='Add'}
<i class="icon-arrow-right"></i>
@@ -13,11 +14,12 @@
</div>
<div class="col-lg-6">
{l s='Selected'}
<select multiple name="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}[]" id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_2" class="product_rule_toselect" >
<select multiple size="10" name="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}[]" id="product_rule_select_{$product_rule_group_id|intval}_{$product_rule_id|intval}_2" class="product_rule_toselect" >
{foreach from=$product_rule_itemlist.selected item='item'}
<option value="{$item.id|intval}">&nbsp;{$item.name}</option>
{/foreach}
</select>
<div class="clearfix">&nbsp;</div>
<a id="product_rule_select_{$product_rule_group_id}_{$product_rule_id}_remove" class="btn btn-default btn-block" >
<i class="icon-arrow-left"></i>
{l s='Remove'}
@@ -147,14 +147,14 @@
</button>
<ul class="dropdown-menu" role="menu">
<li>
<a href="{$current}&token={$token}&csvfilename={$filename|@base64_encode}" target="_blank">
<a href="{$current}&token={$token}&csvfilename={$filename|@urlencode}" target="_blank">
<i class="icon-download"></i>
{l s='Download'}
</a>
</li>
<li class="divider"></li>
<li>
<a href="{$current}&token={$token}&csvfilename={$filename|@base64_encode}&delete=1">
<a href="{$current}&token={$token}&csvfilename={$filename|@urlencode}&delete=1">
<i class="icon-trash"></i>
{l s='Delete'}
</a>
@@ -404,7 +404,7 @@
$(document).ready(function() {
var file_add_button = Ladda.create( document.querySelector('#file-add-button' ));
var file_add_button = Ladda.create(document.querySelector('#file-add-button'));
var file_total_files = 0;
$('#file').fileupload({
@@ -427,15 +427,16 @@
else {
$(data.context).find('button').remove();
var name = encodeURIComponent(data.result.file.name);
console.log(data.result.file);
var filename = encodeURIComponent(data.result.file.filename);
var row = $('#csv_uploaded_history tr:first').clone();
$('#csv_uploaded_history').append(row);
row.removeClass('hide');
row.find('td:first').html(data.result.file.filename);
row.find('button.csv-use-btn').data('filename', data.result.file.filename);
row.find('a.csv-download-link').attr('href','{$current}&token={$token}&csvfilename='+name);
row.find('a.csv-delete-link').attr('href','{$current}&token={$token}&csvfilename='+name+'&delete=1');
row.find('a.csv-download-link').attr('href','{$current}&token={$token}&csvfilename='+filename);
row.find('a.csv-delete-link').attr('href','{$current}&token={$token}&csvfilename='+filename+'&delete=1');
csv_select(data.result.file.filename);
var items = $('#csv_uploaded_history tr').length -1;
$('.csv-history-nb').html(items);
@@ -22,7 +22,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div class="bootstrap">
<div class="bootstrap panel">
<h3><i class="icon-cogs"></i> {l s='Configuration'}</h3>
<div class="input-group">
<button type="button" class="btn btn-default dropdown-toggle" tabindex="-1" data-toggle="dropdown">
@@ -39,6 +39,6 @@
{if isset($display_multishop_checkbox) && $display_multishop_checkbox}
<input type="checkbox" name="activateModule" value="1"{if $module->active} checked="checked"{/if}
onclick="location.href = '{$current_url}&enable='+(($(this).attr('checked')) ? 1 : 0)" />
{l s='Activate module for '}{$shop_context}
{l s='Activate module for'} {$shop_context}
{/if}
</div>
@@ -77,7 +77,7 @@
</td>
<td>
{assign var="module_name" value=$module->name}
<select name="t_{$module->name}" multiple="multiple">
<select name="t_{$module->name}" multiple="multiple" class="chosen moduleTabPreferencesChoise">
{foreach $tabs AS $t}
{if $t.active}
<option {if isset($tab_modules_preferences.$module_name) && in_array($t.id_tab, $tab_modules_preferences.$module_name)} selected="selected" {/if} class="group" value="{$t.id_tab}">{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}</option>
+8 -8
View File
@@ -790,10 +790,10 @@ class CartCore extends ObjectModel
)))
return false;
Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_ALL);
Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_SHIPPING);
Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_REDUCTION);
Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_GIFT);
Cache::clean('Cart::getCartRules_'.$this->id.'-'.CartRule::FILTER_ACTION_ALL);
Cache::clean('Cart::getCartRules_'.$this->id.'-'.CartRule::FILTER_ACTION_SHIPPING);
Cache::clean('Cart::getCartRules_'.$this->id.'-'.CartRule::FILTER_ACTION_REDUCTION);
Cache::clean('Cart::getCartRules_'.$this->id.'-'.CartRule::FILTER_ACTION_GIFT);
if ((int)$cartRule->gift_product)
$this->updateQty(1, $cartRule->gift_product, $cartRule->gift_product_attribute, false, 'up', 0, null, false);
@@ -1127,10 +1127,10 @@ class CartCore extends ObjectModel
public function removeCartRule($id_cart_rule)
{
Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_ALL);
Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_SHIPPING);
Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_REDUCTION);
Cache::clean('Cart::getCartRules'.$this->id.'-'.CartRule::FILTER_ACTION_GIFT);
Cache::clean('Cart::getCartRules_'.$this->id.'-'.CartRule::FILTER_ACTION_ALL);
Cache::clean('Cart::getCartRules_'.$this->id.'-'.CartRule::FILTER_ACTION_SHIPPING);
Cache::clean('Cart::getCartRules_'.$this->id.'-'.CartRule::FILTER_ACTION_REDUCTION);
Cache::clean('Cart::getCartRules_'.$this->id.'-'.CartRule::FILTER_ACTION_GIFT);
$result = Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'cart_cart_rule`
+2 -1
View File
@@ -89,7 +89,8 @@ class ProductSaleCore
$ids = array();
foreach ($products as $product)
$ids[$product['id_product']] = 1;
if (Validate::isUnsignedId($product['id_product']))
$ids[$product['id_product']] = 1;
$ids = array_keys($ids);
$ids = array_filter($ids);
sort($ids);
+11 -11
View File
@@ -540,22 +540,22 @@ class AdminImportControllerCore extends AdminController
$entity_selected = (int)$this->context->cookie->entity_selected;
$csv_selected = '';
if (isset($this->context->cookie->csv_selected) && file_exists(_PS_ADMIN_DIR_.'/import/'.base64_decode($this->context->cookie->csv_selected)))
$csv_selected = base64_decode($this->context->cookie->csv_selected);
if (isset($this->context->cookie->csv_selected) && file_exists(_PS_ADMIN_DIR_.'/import/'.urldecode($this->context->cookie->csv_selected)))
$csv_selected = urldecode($this->context->cookie->csv_selected);
else
$this->context->cookie->csv_selected = $csv_selected;
$id_lang_selected = '';
if (isset($this->context->cookie->iso_lang_selected) && $this->context->cookie->iso_lang_selected)
$id_lang_selected = (int)Language::getIdByIso(base64_decode($this->context->cookie->iso_lang_selected));
$id_lang_selected = (int)Language::getIdByIso(urldecode($this->context->cookie->iso_lang_selected));
$separator_selected = $this->separator;
if (isset($this->context->cookie->separator_selected) && $this->context->cookie->separator_selected)
$separator_selected = base64_decode($this->context->cookie->separator_selected);
$separator_selected = urldecode($this->context->cookie->separator_selected);
$multiple_value_separator_selected = $this->multiple_value_separator;
if (isset($this->context->cookie->multiple_value_separator_selected) && $this->context->cookie->multiple_value_separator_selected)
$multiple_value_separator_selected = base64_decode($this->context->cookie->multiple_value_separator_selected);
$multiple_value_separator_selected = urldecode($this->context->cookie->multiple_value_separator_selected);
//get post max size
$post_max_size = ini_get('post_max_size');
@@ -653,10 +653,10 @@ class AdminImportControllerCore extends AdminController
$data[$i] = $this->generateContentTable($i, $nb_column, $handle, $this->separator);
$this->context->cookie->entity_selected = (int)Tools::getValue('entity');
$this->context->cookie->iso_lang_selected = base64_encode(Tools::getValue('iso_lang'));
$this->context->cookie->separator_selected = base64_encode($this->separator);
$this->context->cookie->multiple_value_separator_selected = base64_encode($this->multiple_value_separator);
$this->context->cookie->csv_selected = base64_encode(Tools::getValue('csv'));
$this->context->cookie->iso_lang_selected = urlencode(Tools::getValue('iso_lang'));
$this->context->cookie->separator_selected = urlencode($this->separator);
$this->context->cookie->multiple_value_separator_selected = urlencode($this->multiple_value_separator);
$this->context->cookie->csv_selected = urlencode(Tools::getValue('csv'));
$this->tpl_view_vars = array(
'import_matchs' => Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'import_match'),
@@ -3101,7 +3101,7 @@ class AdminImportControllerCore extends AdminController
}
elseif ($filename = Tools::getValue('csvfilename'))
{
$filename = base64_decode($filename);
$filename = urldecode($filename);
$file = _PS_ADMIN_DIR_.'/import/'.basename($filename);
if (realpath(dirname($file)) != _PS_ADMIN_DIR_.DIRECTORY_SEPARATOR.'import')
exit();
@@ -3135,7 +3135,7 @@ class AdminImportControllerCore extends AdminController
}
}
}
parent::postProcess();
return parent::postProcess();
}
public static function setLocale()
+3 -3
View File
@@ -66,7 +66,7 @@ class ParentOrderControllerCore extends FrontController
if (Configuration::get('PS_ORDER_PROCESS_TYPE') == 1 && Dispatcher::getInstance()->getController() != 'orderopc')
{
if (isset($_GET['step']) && $_GET['step'] == 3)
if (Tools::getIsset('step') && Tools::getValue('step') == 3)
Tools::redirect('index.php?controller=order-opc&isPaymentStep=true');
Tools::redirect('index.php?controller=order-opc');
}
@@ -210,10 +210,10 @@ class ParentOrderControllerCore extends FrontController
$this->context->cart->gift = (int)(Tools::getValue('gift'));
if ((int)(Tools::getValue('gift')))
{
if (!Validate::isMessage($_POST['gift_message']))
if (!Validate::isMessage(Tools::getValue('gift_message')))
$this->errors[] = Tools::displayError('Invalid gift message.');
else
$this->context->cart->gift_message = strip_tags($_POST['gift_message']);
$this->context->cart->gift_message = strip_tags(Tools::getValue('gift_message'));
}
if (isset($this->context->customer->id) && $this->context->customer->id)
+1 -1
View File
@@ -28,6 +28,6 @@
<div class="block_content clearfix">
<p>{l s='Our support hotline is available 24/7.' mod='blockcontact'}</p>
{if $telnumber != ''}<p class="tel"><span class="label">{l s='Phone:' mod='blockcontact'}</span>{$telnumber|escape:'html':'UTF-8'}</p>{/if}
{if $email != ''}<a href="mailto:{$email|escape:'html':'UTF-8'}">{l s='Contact our expert support team!' mod='blockcontact'}</a>{/if}
{if $email != ''}<a href="mailto:{$email|escape:'html':'UTF-8'}" title="{l s='Contact our expert support team!' mod='blockcontact'}">{l s='Contact our expert support team!' mod='blockcontact'}</a>{/if}
</div>
</div>
+4 -2
View File
@@ -328,8 +328,10 @@ function openCloseFilter()
function stopAjaxQuery() {
if (typeof(ajaxQueries) == 'undefined')
ajaxQueries = new Array();
for(i = 0; i < ajaxQueries.length; i++)
ajaxQueries[i].abort();
for(i = 0; i < ajaxQueries.length; i++) {
if (typeof ajaxQueries[i] != 'undefined')
ajaxQueries[i].abort();
}
ajaxQueries = new Array();
}
+1 -1
View File
@@ -30,7 +30,7 @@
{if $rss_links}
<ul>
{foreach from=$rss_links item='rss_link'}
<li><a href="{$rss_link.url}">{$rss_link.title}</a></li>
<li><a href="{$rss_link.url}" title="{$rss_link.title}">{$rss_link.title}</a></li>
{/foreach}
</ul>
{else}
+1 -1
View File
@@ -31,7 +31,7 @@
{foreach from=$productsViewedObj item=viewedProduct name=myLoop}
<li class="clearfix{if $smarty.foreach.myLoop.last} last_item{elseif $smarty.foreach.myLoop.first} first_item{else} item{/if}">
<a href="{$viewedProduct->product_link|escape:'html'}" title="{l s='About' mod='blockviewed'} {$viewedProduct->name|escape:html:'UTF-8'}" class="content_img">
<img src="{if isset($viewedProduct->id_image) && $viewedProduct->id_image}{$link->getImageLink($viewedProduct->link_rewrite, $viewedProduct->cover, 'medium_default')}{else}{$img_prod_dir}{$lang_iso}-default-medium_default.jpg{/if}" alt="{$viewedProduct->legend|escape:html:'UTF-8'}" />
<img src="{if isset($viewedProduct->id_image) && $viewedProduct->id_image}{$link->getImageLink($viewedProduct->link_rewrite, $viewedProduct->cover, 'medium_default')}{else}{$img_prod_dir}{$lang_iso}-default-medium_default.jpg{/if}" alt="{$viewedProduct->legend|escape:html:'UTF-8'}" title="{$viewedProduct->legend|escape:html:'UTF-8'}"/>
</a>
<div class="text_desc">
<h5 class="s_title_block"><a href="{$viewedProduct->product_link|escape:'html'}" title="{l s='About' mod='blockviewed'} {$viewedProduct->name|escape:html:'UTF-8'}">{$viewedProduct->name|truncate:14:'...'|escape:html:'UTF-8'}</a></h5>