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

Conflicts:
	admin-dev/themes/default/template/helpers/list/list_header.tpl
This commit is contained in:
Jerome Nadaud
2013-11-18 18:39:25 +01:00
10 changed files with 60 additions and 13 deletions
@@ -106,7 +106,6 @@
$(document).ready(function()
{
$('#product-tab-content-wait').show();
//product_type = $("input[name=type_product]:checked").val();
if (product_type == product_type_pack)
{
@@ -103,7 +103,7 @@
<select name="{$list_id}_pagination" onchange="submit()">
{* Choose number of results per page *}
{foreach $pagination AS $value}
<option value="{$value|intval}"{if $selected_pagination == $value} selected="selected" {elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option>
<option value="{$value|intval}"{if $selected_pagination == $value && $selected_pagination != NULL} selected="selected"{elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option>
{/foreach}
</select>
/ {$list_total} {l s='result(s)'}
@@ -188,8 +188,8 @@
{if $params.type == 'bool'}
<select onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$key}">
<option value="">-</option>
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
<option value="1"{if $params.value == 1} selected="selected"{/if}>{l s='Yes'}</option>
<option value="0"{if $params.value == 0 && $params.value != ''} selected="selected"{/if}>{l s='No'}</option>
</select>
{elseif $params.type == 'date' || $params.type == 'datetime'}
{l s='From'} <input type="text" class="filter datepicker" id="{$params.id_date}_0" name="{$params.name_date}[0]" value="{if isset($params.value.0)}{$params.value.0}{/if}"{if isset($params.width)} style="width:70px"{/if}/><br />
@@ -197,7 +197,7 @@
{elseif $params.type == 'select'}
{if isset($params.filter_key)}
<select onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<option value="" {if $params.value == ''} selected="selected" {/if}>-</option>
<option value=""{if $params.value == ''} selected="selected"{/if}>-</option>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
<option value="{$option_value}" {if $params.value != '' && ($option_display == $params.value || $option_value == $params.value)} selected="selected"{/if}>{$option_display}</option>
+1
View File
@@ -510,6 +510,7 @@ class LinkCore
public function goPage($url, $p)
{
$url = rtrim(str_replace('?&', '?', $url), '?');
return $url.($p == 1 ? '' : (!strstr($url, '?') ? '?' : '&amp;').'p='.(int)$p);
}
+3
View File
@@ -5278,7 +5278,10 @@ class ProductCore extends ObjectModel
WHERE id_product='.(int)$this->id.Shop::addSqlRestriction()
);
else
{
$this->setFieldsToUpdate(array('advanced_stock_management' => true));
$this->save();
}
}
/**
@@ -195,6 +195,22 @@ class AdminGendersControllerCore extends AdminController
}
return !count($this->errors) ? true : false;
}
protected function afterImageUpload()
{
parent::afterImageUpload();
if (($id_gender = (int)Tools::getValue('id_gender')) &&
isset($_FILES) && count($_FILES) && file_exists(_PS_GENDERS_DIR_.$id_gender.'.jpg'))
{
$current_file = _PS_TMP_IMG_DIR_.'gender_mini_'.$id_gender.'_'.$this->context->shop->id.'.jpg';
if (file_exists($current_file))
unlink($current_file);
}
return true;
}
}
@@ -145,8 +145,10 @@ class AdminLocalizationControllerCore extends AdminController
if (Validate::isFileName(Tools::getValue('iso_localization_pack')))
{
$pack = @Tools::file_get_contents('http://api.prestashop.com/localization/'.$version.'/'.Tools::getValue('iso_localization_pack').'.xml');
if (Tools::getValue('download_updated_pack') == '1')
$pack = @Tools::file_get_contents('http://api.prestashop.com/localization/'.$version.'/'.Tools::getValue('iso_localization_pack').'.xml');
else
$pack = false;
if (!$pack && !($pack = @Tools::file_get_contents(dirname(__FILE__).'/../../localization/'.Tools::getValue('iso_localization_pack').'.xml')))
$this->errors[] = Tools::displayError('Cannot load the localization pack.');
@@ -264,6 +266,26 @@ class AdminLocalizationControllerCore extends AdminController
'id' => 'id',
'name' => 'name'
)
),
array(
'type' => 'radio',
'label' => $this->l('Download pack data'),
'desc' => $this->l('If set to yes then the localization pack will be downloaded from prestashop.com. Otherwise the local xml file found in the localization folder of your PrestaShop installation will be used.'),
'name' => 'download_updated_pack',
'class' => 't',
'is_bool'=> true,
'values' => array(
array(
'id' => 'download_updated_pack_yes',
'value' => 1,
'label' => $this->l('Yes')
),
array(
'id' => 'download_updated_pack_no',
'value' => 0,
'label' => $this->l('No')
)
)
)
),
'submit' => array(
@@ -278,7 +300,8 @@ class AdminLocalizationControllerCore extends AdminController
'selection[]_taxes' => true,
'selection[]_currencies' => true,
'selection[]_languages' => true,
'selection[]_units' => true
'selection[]_units' => true,
'download_updated_pack' => 1
);
$this->show_toolbar = false;
+1 -1
View File
@@ -212,7 +212,7 @@ return array(
'Contact us' => 'Свяжитесь с нами',
'PrestaShop Installation Assistant' => 'Помощник установки PrestaShop',
'Installation Assistant' => 'Помощник установки',
'License Agreements' => 'Лицензионное соглшение',
'License Agreements' => 'Лицензионное соглашение',
'Print my login information' => 'Распечатать информацию о моем аккаунте',
'To use PrestaShop, you must <a href="http://doc.prestashop.com/display/PS15/Installing+PrestaShop#InstallingPrestaShop-Creatingadatabaseforyourshop" target="_blank">create a database</a> to collect all of your stores data-related activities.' => 'Для использования PrestaShop, Вам следует <a href="http://doc.prestashop.com/display/PS15/Installing+PrestaShop#InstallingPrestaShop-Creatingadatabaseforyourshop" target="_blank">создать базу данных </a>, чтобы сгруппировать информацию Вашего магазина.',
'Please complete the fields below in order for PrestaShop to connect to your database. ' => 'Заполните поля ниже, чтобы PrestaShop смог установить соединение с Вашей с базой данных.',
+4 -4
View File
@@ -53,6 +53,7 @@ class BlockSearch extends Module
public function hookdisplayMobileTopSiteMap($params)
{
$this->smarty->assign(array('hook_mobile' => true, 'instantsearch' => false));
$params['hook_mobile'] = true;
return $this->hookTop($params);
}
@@ -80,7 +81,6 @@ public function hookDisplayMobileHeader($params)
public function hookRightColumn($params)
{
if (Tools::getValue('search_query') || !$this->isCached('blocksearch.tpl', $this->getCacheId()))
{
$this->calculHookCommon($params);
@@ -95,7 +95,8 @@ public function hookDisplayMobileHeader($params)
public function hookTop($params)
{
if (Tools::getValue('search_query') || !$this->isCached('blocksearch-top.tpl', $this->getCacheId('blocksearch-top')))
$key = $this->getCacheId('blocksearch-top'.((!isset($params['hook_mobile']) || !$params['hook_mobile']) ? '' : '-hook_mobile'));
if (Tools::getValue('search_query') || !$this->isCached('blocksearch-top.tpl', $key))
{
$this->calculHookCommon($params);
$this->smarty->assign(array(
@@ -105,8 +106,7 @@ public function hookDisplayMobileHeader($params)
);
}
return $this->display(__FILE__, 'blocksearch-top.tpl', Tools::getValue('search_query') ? null : $this->getCacheId('blocksearch-top'));
return $this->display(__FILE__, 'blocksearch-top.tpl', Tools::getValue('search_query') ? null : $key);
}
/**
@@ -680,11 +680,14 @@ class ProductComments extends Module
{
require_once(dirname(__FILE__).'/ProductComment.php');
require_once(dirname(__FILE__).'/ProductCommentCriterion.php');
$average = ProductComment::getAverageGrade((int)Tools::getValue('id_product'));
$this->context->smarty->assign(array(
'allow_guests' => (int)Configuration::get('PRODUCT_COMMENTS_ALLOW_GUESTS'),
'comments' => ProductComment::getByProduct((int)(Tools::getValue('id_product'))),
'criterions' => ProductCommentCriterion::getByProduct((int)(Tools::getValue('id_product')), $this->context->language->id),
'averageTotal' => round($average['grade']),
'nbComments' => (int)(ProductComment::getCommentNumber((int)(Tools::getValue('id_product'))))
));
@@ -93,6 +93,8 @@ class ReferralProgramModule extends ObjectModel
$cartRule->date_to = date('Y-m-d H:i:s', time() + 31536000); // + 1 year
$cartRule->code = $this->getDiscountPrefix().Tools::passwdGen(6);
$cartRule->name = Configuration::getInt('REFERRAL_DISCOUNT_DESCRIPTION');
if (empty($cartRule->name))
$cartRule->name = 'Referral reward';
$cartRule->id_customer = (int)$id_customer;
$cartRule->reduction_currency = (int)$id_currency;