Compare commits
229 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
056709f2dd | ||
|
|
eb7cf3dbbb | ||
|
|
5ac2a0d946 | ||
|
|
17209a1725 | ||
|
|
907047165b | ||
|
|
a8b89d7411 | ||
|
|
45f54ce08d | ||
|
|
35d3d1d6c5 | ||
|
|
e827d3355d | ||
|
|
f7f137fec1 | ||
|
|
8f406fcd1d | ||
|
|
125884d8c0 | ||
|
|
b2b17eb041 | ||
|
|
08f6d1a670 | ||
|
|
5a3c2aa5cf | ||
|
|
cc2df5b237 | ||
|
|
1975755d8a | ||
|
|
5967c6ebbe | ||
|
|
7cafc7bdf5 | ||
|
|
feb1edc076 | ||
|
|
75dd65f207 | ||
|
|
83f132aa78 | ||
|
|
d16f30f322 | ||
|
|
2d1a4ed180 | ||
|
|
318a136553 | ||
|
|
697a305848 | ||
|
|
8d4723247e | ||
|
|
4162591e3e | ||
|
|
bec335441e | ||
|
|
4be1bef203 | ||
|
|
ceddfdd8e6 | ||
|
|
13c435a54b | ||
|
|
4e21c56d1b | ||
|
|
75fed1a2cc | ||
|
|
da1f92b85b | ||
|
|
cd079f7a1a | ||
|
|
0da1eb9e35 | ||
|
|
38adc4aaf3 | ||
|
|
7912aba499 | ||
|
|
59ab9b63cf | ||
|
|
90bf119624 | ||
|
|
116df3b3fd | ||
|
|
16906d8590 | ||
|
|
cc3f9212ac | ||
|
|
236675544b | ||
|
|
1a8ab7f68c | ||
|
|
38bdd421f7 | ||
|
|
803447b88d | ||
|
|
828ffb74ad | ||
|
|
e22fe455b3 | ||
|
|
e9b8af0e97 | ||
|
|
53cc380a6a | ||
|
|
986d57148f | ||
|
|
ccfa343b0d | ||
|
|
ab700a6285 | ||
|
|
158ab771b6 | ||
|
|
5edfd03068 | ||
|
|
f0c5407aa6 | ||
|
|
ee3e2ac6dc | ||
|
|
b633b44ac7 | ||
|
|
5ba3fda95f | ||
|
|
f83b91ae51 | ||
|
|
49ff8ae4a1 | ||
|
|
34f2ff36a3 | ||
|
|
de0ef82f74 | ||
|
|
de887cc078 | ||
|
|
701d9e50af | ||
|
|
5bae95dacc | ||
|
|
4783cb17c5 | ||
|
|
1a795cfe4a | ||
|
|
47c118c3ca | ||
|
|
22694898df | ||
|
|
96ee6386c1 | ||
|
|
ce02baf658 | ||
|
|
abbdb4d165 | ||
|
|
48390eed96 | ||
|
|
efb90cb0a6 | ||
|
|
8c5143de9e | ||
|
|
b1b71c0c07 | ||
|
|
7c626218df | ||
|
|
62fd5c6195 | ||
|
|
5ab4c18396 | ||
|
|
a93cfbec07 | ||
|
|
70176f07e6 | ||
|
|
661ddd7548 | ||
|
|
c0ae0c9b28 | ||
|
|
f2bdb73d39 | ||
|
|
df60120d5f | ||
|
|
b2f5ed838d | ||
|
|
a4d86f14da | ||
|
|
6cdf8babca | ||
|
|
7711c710d4 | ||
|
|
00d7d78ba6 | ||
|
|
eca4a87082 | ||
|
|
5989481859 | ||
|
|
23b70c4906 | ||
|
|
df111c0662 | ||
|
|
bf90c8cf84 | ||
|
|
047551952e | ||
|
|
7a89d0596f | ||
|
|
0256ee7c59 | ||
|
|
cf874a832a | ||
|
|
bd0e467c97 | ||
|
|
0ba0a25f3d | ||
|
|
f209d5a669 | ||
|
|
a73c09ab4c | ||
|
|
fcce2d2737 | ||
|
|
d48d33fc43 | ||
|
|
9060661cef | ||
|
|
37296f9c7f | ||
|
|
f0209dd447 | ||
|
|
1ebd625563 | ||
|
|
8609f07749 | ||
|
|
305cf4dd9c | ||
|
|
e8f3fcf581 | ||
|
|
a632965b0d | ||
|
|
08c53d77b2 | ||
|
|
3cbd8444d6 | ||
|
|
714b57f225 | ||
|
|
d827879f8b | ||
|
|
61557f2fd0 | ||
|
|
60e77597ac | ||
|
|
239dcb0179 | ||
|
|
0a0f28ee21 | ||
|
|
f9225cb8c2 | ||
|
|
b1dc638120 | ||
|
|
759de67222 | ||
|
|
4738a15c16 | ||
|
|
0b7e9827af | ||
|
|
7222af7466 | ||
|
|
2149c2a986 | ||
|
|
df1e71fe76 | ||
|
|
c1518dfcbf | ||
|
|
0b21f0e221 | ||
|
|
b12b6571a1 | ||
|
|
89f5dbcde8 | ||
|
|
a6dafcfa86 | ||
|
|
7a27fa2f64 | ||
|
|
f43aee9a25 | ||
|
|
17012ea00d | ||
|
|
8674313eae | ||
|
|
a0db01db58 | ||
|
|
1b01c7a602 | ||
|
|
3ba776a9d1 | ||
|
|
c26fa09667 | ||
|
|
e5cf7a4c06 | ||
|
|
403b9b760f | ||
|
|
86c6b3154f | ||
|
|
66b321ae55 | ||
|
|
881b6e7a8b | ||
|
|
3ffe339a76 | ||
|
|
a720b19854 | ||
|
|
90878d8a80 | ||
|
|
6c36a1ba72 | ||
|
|
d6ee2acc90 | ||
|
|
5b6dc1e9e9 | ||
|
|
3f1bcb4d18 | ||
|
|
6edc6c37f7 | ||
|
|
d7b78e6f43 | ||
|
|
26bdf77308 | ||
|
|
3bbb9aa685 | ||
|
|
d19cfc33bc | ||
|
|
fd4006bcd4 | ||
|
|
b925bd9ac1 | ||
|
|
b9e3436e30 | ||
|
|
47e918aa67 | ||
|
|
a1589621a5 | ||
|
|
1258f31953 | ||
|
|
06f7c89de1 | ||
|
|
9173a35a2b | ||
|
|
a77111dc62 | ||
|
|
df4e3a0000 | ||
|
|
585cd016b0 | ||
|
|
44101663b7 | ||
|
|
073e33e5c2 | ||
|
|
28a5a7a0e1 | ||
|
|
d2b5c35d3d | ||
|
|
a26ce970ff | ||
|
|
ac02afccda | ||
|
|
3e936965c8 | ||
|
|
e59274fb2b | ||
|
|
aeae013c4c | ||
|
|
0a466d8c5d | ||
|
|
ca9abbf30a | ||
|
|
82471c2728 | ||
|
|
fdd4b50bf6 | ||
|
|
084dac09b3 | ||
|
|
68cfd53c41 | ||
|
|
9f7afc317d | ||
|
|
55232917c1 | ||
|
|
009a98c34d | ||
|
|
5fe0acbfcb | ||
|
|
bc5e93ba20 | ||
|
|
5642ffb8ee | ||
|
|
77fe043ebe | ||
|
|
02275f20b1 | ||
|
|
91a3b1d049 | ||
|
|
f6bb597c0b | ||
|
|
b39a739877 | ||
|
|
52dbbd9e91 | ||
|
|
404d60f877 | ||
|
|
8445bb4a94 | ||
|
|
9b6ff354ed | ||
|
|
206fc5cfa5 | ||
|
|
d790447e5f | ||
|
|
2da2455397 | ||
|
|
ccdbaf8ffb | ||
|
|
88ec1de15c | ||
|
|
42b025d8ae | ||
|
|
9680d4987b | ||
|
|
e3ba526625 | ||
|
|
e31e4ae018 | ||
|
|
01eaffcd1c | ||
|
|
af1becaa1d | ||
|
|
6dcf2d53e3 | ||
|
|
06e30b91b1 | ||
|
|
02e7a8ca00 | ||
|
|
7b93630595 | ||
|
|
d2e57706d2 | ||
|
|
5fbe5b7687 | ||
|
|
93baeff66c | ||
|
|
052d17c30d | ||
|
|
bfc717e241 | ||
|
|
9cfb411614 | ||
|
|
02baab7393 | ||
|
|
92ad912074 | ||
|
|
b3175fed08 | ||
|
|
69ce0db619 | ||
|
|
de9e75cc0d |
6
.gitignore
vendored
6
.gitignore
vendored
@@ -29,4 +29,10 @@ themes/default/cache/*.js
|
||||
themes/default/cache/*.css
|
||||
modules/*/translations/*.php
|
||||
!modules/*/translations/index.php
|
||||
mails/*
|
||||
!mails/en
|
||||
modules/*/mails/*
|
||||
!modules/*/mails/en
|
||||
translations/*
|
||||
!translations/*.gzip
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__).'/../images.inc.php');
|
||||
function bindDatepicker($id, $time)
|
||||
{
|
||||
if ($time)
|
||||
|
||||
@@ -664,4 +664,8 @@ ul.listForm li {padding-bottom:3px;}
|
||||
/******** CREATE AN ORDER **************/
|
||||
|
||||
#carrier_form label{padding-top:0}
|
||||
#carrier_form input{margin-top:3px}
|
||||
#carrier_form input{margin-top:3px}
|
||||
|
||||
/************** SCENE *****************/
|
||||
|
||||
#large_scene_image{clear:both;border:1px solid transparent;}
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
{block name="label"}
|
||||
{if $input.type == 'color'}
|
||||
<div id="colorAttributeProperties" style="display:{if $colorAttributeProperties}block{else}none{/if}";>
|
||||
<div id="colorAttributeProperties" style="display:{if $colorAttributeProperties}block{else}none{/if};">
|
||||
{/if}
|
||||
{$smarty.block.parent}
|
||||
{/block}
|
||||
|
||||
@@ -207,12 +207,12 @@
|
||||
<br />
|
||||
<input type="checkbox" id="product_restriction" name="product_restriction" value="1" {if $product_rule_groups|@count}checked="checked"{/if} /> <strong>{l s='Product selection'}</strong>
|
||||
<div id="product_restriction_div">
|
||||
<table id="product_rule_group_table" style="border:1px solid #AAAAAA;margin:10px 0 10px 0;padding:10px 10px 10px 10px;background-color:#FFF5D3;width:600px" cellpadding="0" cellspacing="0">
|
||||
<table id="product_rule_group_table" style="border:1px solid #AAAAAA;margin:10px 0 10px 0;padding:10px 10px 10px 10px;background-color:#FFF5D3;width:600px;display:none" cellpadding="0" cellspacing="0">
|
||||
{foreach from=$product_rule_groups item='product_rule_group'}
|
||||
{$product_rule_group}
|
||||
{/foreach}
|
||||
</table>
|
||||
<a href="javascript:addProductRuleGroup();">
|
||||
<a href="javascript:addProductRuleGroup();" style="margin-top:5px;display:block">
|
||||
<img src="../img/admin/add.gif" alt="{l s='Add'}" title="{l s='Add'}" /> {l s='Product selection'}
|
||||
</a>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
function addProductRuleGroup()
|
||||
{
|
||||
$('#product_rule_group_table').show();
|
||||
product_rule_groups_counter += 1;
|
||||
product_rule_counters[product_rule_groups_counter] = 0;
|
||||
|
||||
@@ -84,6 +85,13 @@ function addCartRuleOption(item)
|
||||
|
||||
function updateProductRuleShortDescription(item)
|
||||
{
|
||||
/******* For IE: put a product in condition on cart rules *******/
|
||||
if(typeof String.prototype.trim !== 'function') {
|
||||
String.prototype.trim = function() {
|
||||
return this.replace(/^\s+|\s+$/g, '');
|
||||
}
|
||||
}
|
||||
|
||||
var id1 = $(item).attr('id').replace('_add', '').replace('_remove', '');
|
||||
var id2 = id1.replace('_select', '');
|
||||
var length = $('#' + id1 + '_2 option').length;
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
</form>
|
||||
{/if}
|
||||
|
||||
{if isset($display_move)}
|
||||
{if isset($display_move) && $display_move}
|
||||
<br /><h2 class="space">{l s='Move images'}</h2>
|
||||
{l s='PrestaShop now uses a new storage system for product images. It offers better performance if your shop has a large number of products.'}<br />
|
||||
<br />
|
||||
|
||||
@@ -22,91 +22,79 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
<script type="text/javascript">
|
||||
var there_are = '{l s='There are'}';
|
||||
var there_is = '{l s='There is'}';
|
||||
var label_errors = '{l s='errors'}';
|
||||
var label_error = '{l s='error'}';
|
||||
</script>
|
||||
|
||||
<div id="container">
|
||||
<div id="error" {if !isset($errors)}class="hide"{/if}>
|
||||
{if isset($errors)}
|
||||
<h3>{if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}</h3>
|
||||
<ol style="margin: 0 0 0 20px;">
|
||||
{foreach from=$errors item="error"}
|
||||
<li>{$error}</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
{/if}
|
||||
</div>
|
||||
<br />
|
||||
{if isset($warningSslMessage)}
|
||||
<div class="warn">
|
||||
{$warningSslMessage}
|
||||
</div>
|
||||
{/if}
|
||||
<div id="login">
|
||||
<h1>{$shop_name}</h1>
|
||||
{if !isset($wrong_folder_name) && !isset($wrong_install_name)}
|
||||
<form action="#" id="login_form" method="post">
|
||||
<div class="field">
|
||||
<label for="email">{l s='Email address:'}</label>
|
||||
<input type="text" id="email" name="email" class="input email_field" value="{if isset($email)}{$email|escape:'htmlall':'UTF-8'}{/if}" />
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<label for="passwd">{l s='Password:'}</label>
|
||||
<input id="passwd" type="password" name="passwd" class="input password_field" value="{if isset($password)}{$password}{/if}"/>
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<input type="submit" name="submitLogin" value="{l s='Log in'}" class="button fl margin-right-5" />
|
||||
|
||||
<p class="fl no-margin hide ajax-loader">
|
||||
<img src="../img/loader.gif" alt="" />
|
||||
</p>
|
||||
|
||||
<p class="fr no-margin">
|
||||
<a href="#" class="show-forgot-password">{l s='Lost password?'}</a>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<input type="hidden" name="redirect" id="redirect" value="{$redirect}"/>
|
||||
</form>
|
||||
|
||||
<form action="#" id="forgot_password_form" method="post" class="hide">
|
||||
<h2 class="no-margin">{l s='Forgot your password?'}</h2>
|
||||
<p class="bold">{l s='In order to receive your access code by email, please enter the address you provided during the registration process.'}</p>
|
||||
|
||||
<div class="field">
|
||||
<label>{l s='Email address:'}</label>
|
||||
<input type="text" name="email_forgot" id="email_forgot" class="input email_field" />
|
||||
</div>
|
||||
|
||||
<div class="field">
|
||||
<input type="submit" name="submit" value="{l s='Send'}" class="button fl margin-right-5" />
|
||||
|
||||
<p class="fl no-margin hide ajax-loader">
|
||||
<img src="../img/loader.gif" alt="" />
|
||||
</p>
|
||||
|
||||
<p class="fr no-margin">
|
||||
<a href="#" class="show-login-form">{l s='Back to login'}</a>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</form>
|
||||
{else}
|
||||
<div class="padding-30">
|
||||
<p>{l s='For security reasons, you cannot connect to the Back Office until after you have:'}</p>
|
||||
<ul>
|
||||
{if isset($wrong_install_name) && $wrong_install_name == true}<li>{l s='deleted the /install folder'}</li>{/if}
|
||||
{if isset($wrong_folder_name) && $wrong_folder_name == true}<li>{l s='renamed the /admin folder (e.g. /admin%d)' sprintf=$randomNb}</li>{/if}
|
||||
</ul>
|
||||
{if isset($wrong_folder_name) && $wrong_folder_name == true}<p>{l s='Please then access this page by the new URL (e.g. http://www.yoursite.com/admin%d)' sprintf=$randomNb}</p>{/if}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<h2><a href="http://www.prestashop.com">© 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.</a></h2>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var there_are = '{l s='There are'}';
|
||||
var there_is = '{l s='There is'}';
|
||||
var label_errors = '{l s='errors'}';
|
||||
var label_error = '{l s='error'}';
|
||||
</script>
|
||||
<div id="container">
|
||||
<div id="error" {if !isset($errors)}class="hide"{/if}>
|
||||
{if isset($errors)}
|
||||
<h3>{if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}</h3>
|
||||
<ol style="margin: 0 0 0 20px;">
|
||||
{foreach from=$errors item="error"}
|
||||
<li>{$error}</li>
|
||||
{/foreach}
|
||||
</ol>
|
||||
{/if}
|
||||
</div>
|
||||
<br />
|
||||
{if isset($warningSslMessage)}
|
||||
<div class="warn">{$warningSslMessage}</div>
|
||||
{/if}
|
||||
<div id="login">
|
||||
<h1>{$shop_name}</h1>
|
||||
{if !isset($wrong_folder_name) && !isset($wrong_install_name)}
|
||||
<form action="#" id="login_form" method="post">
|
||||
<div class="field">
|
||||
<label for="email">{l s='Email address:'}</label>
|
||||
<input type="text" id="email" name="email" class="input email_field" value="{if isset($email)}{$email|escape:'htmlall':'UTF-8'}{/if}" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<label for="passwd">{l s='Password:'}</label>
|
||||
<input id="passwd" type="password" name="passwd" class="input password_field" value="{if isset($password)}{$password}{/if}"/>
|
||||
</div>
|
||||
<div class="field">
|
||||
<input type="submit" name="submitLogin" value="{l s='Log in'}" class="button fl margin-right-5" />
|
||||
<p class="fl no-margin hide ajax-loader">
|
||||
<img src="../img/loader.gif" alt="" />
|
||||
</p>
|
||||
<p class="fr no-margin">
|
||||
<a href="#" class="show-forgot-password">{l s='Lost password?'}</a>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
<input type="hidden" name="redirect" id="redirect" value="{$redirect}"/>
|
||||
</form>
|
||||
<form action="#" id="forgot_password_form" method="post" class="hide">
|
||||
<h2 class="no-margin">{l s='Forgot your password?'}</h2>
|
||||
<p class="bold">{l s='In order to receive your access code by email, please enter the address you provided during the registration process.'}</p>
|
||||
<div class="field">
|
||||
<label>{l s='Email address:'}</label>
|
||||
<input type="text" name="email_forgot" id="email_forgot" class="input email_field" />
|
||||
</div>
|
||||
<div class="field">
|
||||
<input type="submit" name="submit" value="{l s='Send'}" class="button fl margin-right-5" />
|
||||
<p class="fl no-margin hide ajax-loader">
|
||||
<img src="../img/loader.gif" alt="" />
|
||||
</p>
|
||||
<p class="fr no-margin">
|
||||
<a href="#" class="show-login-form">{l s='Back to login'}</a>
|
||||
</p>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
</form>
|
||||
{else}
|
||||
<div class="padding-30">
|
||||
<p>{l s='For security reasons, you cannot connect to the Back Office until after you have:'}</p>
|
||||
<ul>
|
||||
{if isset($wrong_install_name) && $wrong_install_name == true}<li>{l s='deleted the /install folder'}</li>{/if}
|
||||
{if isset($wrong_folder_name) && $wrong_folder_name == true}<li>{l s='renamed the /admin folder (e.g. %s)' sprintf=$randomNb}</li>{/if}
|
||||
</ul>
|
||||
<p><a href="{$adminUrl|escape:'htmlall':'UTF-8'}">{l s='Please then access this page by the new URL (e.g. %s)' sprintf=$adminUrl}</a></p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<h2><a href="http://www.prestashop.com">© 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.</a></h2>
|
||||
</div>
|
||||
@@ -321,6 +321,46 @@
|
||||
catch(e){}
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.toggle_favorite').live('click', function(event)
|
||||
{
|
||||
var el = $(this);
|
||||
var value_pref = el.data('value');
|
||||
var module_pref = el.data('module');
|
||||
var action_pref = 'f';
|
||||
try
|
||||
{
|
||||
resAjax = $.ajax({
|
||||
type:"POST",
|
||||
url : ajaxCurrentIndex,
|
||||
async: true,
|
||||
data : {
|
||||
ajax : "1",
|
||||
token : token,
|
||||
controller : "AdminModules",
|
||||
action : "saveFavoritePreferences",
|
||||
action_pref : action_pref,
|
||||
module_pref : module_pref,
|
||||
value_pref : value_pref
|
||||
},
|
||||
success : function(data)
|
||||
{
|
||||
// res.status = cache or refresh
|
||||
if (data == 'OK')
|
||||
{
|
||||
el.parent('div').find('.toggle_favorite').toggle();
|
||||
}
|
||||
|
||||
},
|
||||
error: function(res,textStatus,jqXHR)
|
||||
{
|
||||
//jAlert("TECHNICAL ERROR"+res);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(e){}
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
{/literal}
|
||||
|
||||
@@ -79,7 +79,18 @@
|
||||
<p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else} {/if}</p>
|
||||
{if isset($module->message)}<div class="conf">{$module->message}</div>{/if}
|
||||
<div class="row-actions-module">
|
||||
{if !isset($module->not_on_disk)}{$module->optionsHtml}{else} {/if}
|
||||
{if !isset($module->not_on_disk)}
|
||||
{$module->optionsHtml}
|
||||
{if isset($module->preferences) && $module->preferences['favorite'] == 1}
|
||||
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#">{l s='Remove from Favorites'}</a>
|
||||
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#" style="display: none;">{l s='Mark as Favorite'}</a>
|
||||
{else}
|
||||
<a class="action_module action_unfavorite toggle_favorite" data-module="{$module->name}" data-value="0" href="#" style="display: none;">{l s='Remove from Favorites'}</a>
|
||||
<a class="action_module action_favorite toggle_favorite" data-module="{$module->name}" data-value="1" href="#">{l s='Mark as Favorite'}</a>
|
||||
{/if}
|
||||
{else}
|
||||
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -26,7 +26,16 @@
|
||||
<div id="productBox">
|
||||
{include file='controllers/modules/header.tpl'}
|
||||
{include file='controllers/modules/filters.tpl'}
|
||||
|
||||
{if $upgrade_available|@count}
|
||||
<div class="hint" style="display:block;">
|
||||
{l s='An upgrade is available for some of your modules!'}
|
||||
<ul>
|
||||
{foreach from=$upgrade_available item='module'}
|
||||
<li> » <a href="{$currentIndex|escape:htmlall}&token={$token|escape:htmlall}&anchor=anchor{$module.anchor|escape:htmlall}"><b>{$module.name|escape:htmlall}</b></a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
<ul class="view-modules">
|
||||
<li class="button normal-view-disabled"><img src="themes/default/img/modules_view_layout_sidebar.png" alt="{l s='Normal view'}" border="0" /><span>{l s='Normal view'}</span></li>
|
||||
<li class="button favorites-view"><a href="index.php?controller={$smarty.get.controller|htmlentities}&token={$smarty.get.token|htmlentities}&select=favorites"><img src="themes/default/img/modules_view_table_select_row.png" alt="{l s='Favorites view'}" border="0" /><span>{l s='Favorites view'}</span></a></li>
|
||||
|
||||
@@ -66,7 +66,7 @@
|
||||
{else if !isset($module->not_on_disk)}
|
||||
{$module->optionsHtml}
|
||||
<div class="clear"> </div>
|
||||
<a href="#" class="button action_tab_module" data-option="select_{$module->name}" class="button">Valider</a>
|
||||
<a href="#" class="button action_tab_module" data-option="select_{$module->name}" class="button">{l s='Submit'}</a>
|
||||
{else}
|
||||
<a href="{$module->options.install_url}" class="button">{l s='Install'}</a>
|
||||
{/if}
|
||||
|
||||
@@ -22,22 +22,23 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
{if $product.customizedDatas}
|
||||
<tr class="customized customized-{$product.id_order_detail}">
|
||||
<input type="hidden" class="edit_product_id_order_detail" value="{$product.id_order_detail}" />
|
||||
<td align="center">{if isset($product.image) && $product.image->id}{$product.image_tag}{else}--{/if}</td>
|
||||
{if $product['customizedDatas']}
|
||||
<tr class="customized customized-{$product['id_order_detail']|intval}">
|
||||
<td align="center">
|
||||
<input type="hidden" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
|
||||
{if isset($product['image']) && $product['image']->id|intval}{$product['image_tag']}{else}--{/if}</td>
|
||||
<td>
|
||||
<a href="index.php?controller=adminproducts&id_product={$product['product_id']}&updateproduct&token={getAdminToken tab='AdminProducts'}">
|
||||
<a href="index.php?controller=adminproducts&id_product={$product['product_id']|intval}&updateproduct&token={getAdminToken tab='AdminProducts'}">
|
||||
<span class="productName">{$product['product_name']} - {l s='Customized'}</span><br />
|
||||
{if ($product['product_reference'])}{l s='Ref:'} {$product['product_reference']}<br />{/if}
|
||||
{if ($product['product_supplier_reference'])}{l s='Ref Supplier:'} {$product['product_supplier_reference']}{/if}
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<span class="product_price_show">{displayPrice price=$product['product_price_wt'] currency=$currency->id}</span>
|
||||
<span class="product_price_show">{displayPrice price=$product['product_price_wt'] currency=$currency->id|intval}</span>
|
||||
{if $can_edit}
|
||||
<span class="product_price_edit" style="display:none;">
|
||||
<input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']}" />
|
||||
<input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
|
||||
{if $currency->sign % 2}{$currency->sign}{/if}<input type="text" name="product_price_tax_excl" class="edit_product_price_tax_excl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_excl'], 2)}" size="5" /> {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax excl.'}<br />
|
||||
{if $currency->sign % 2}{$currency->sign}{/if}<input type="text" name="product_price_tax_incl" class="edit_product_price_tax_incl edit_product_price" value="{Tools::ps_round($product['unit_price_tax_incl'], 2)}" size="5" /> {if !($currency->sign % 2)}{$currency->sign}{/if} {l s='tax incl.'}
|
||||
</span>
|
||||
@@ -49,32 +50,37 @@
|
||||
{if $stock_management}<td align="center" class=""> - </td>{/if}
|
||||
<td align="center" class="total_product">
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id}
|
||||
{displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval}
|
||||
{else}
|
||||
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id}
|
||||
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="cancelQuantity standard_refund_fields current-edit" style="display:none" colspan="2">
|
||||
|
||||
</td>
|
||||
<td class="edit_product_fields" colspan="2" style="display:none"> </td>
|
||||
<td class="partial_refund_fields current-edit" style="text-align:left;display:none"></td>
|
||||
<td class="product_action" style="text-align:right">
|
||||
<a href="#" class="edit_product_change_link"><img src="../img/admin/edit.gif" alt="{l s='Edit'}" /></a>
|
||||
<input type="submit" class="button" name="submitProductChange" value="{l s='Update'}" style="display: none;" />
|
||||
<a href="#" class="cancel_product_change_link" style="display: none;"><img src="../img/admin/disabled.gif" alt="{l s='Cancel'}" /></a>
|
||||
<a href="#" class="delete_product_line"><img src="../img/admin/delete.gif" alt="{l s='Delete'}" /></a>
|
||||
</td>
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<td class="product_action" style="text-align:right">
|
||||
<a href="#" class="edit_product_change_link"><img src="../img/admin/edit.gif" alt="{l s='Edit'}" /></a>
|
||||
<input type="submit" class="button" name="submitProductChange" value="{l s='Update'}" style="display: none;" />
|
||||
<a href="#" class="cancel_product_change_link" style="display: none;"><img src="../img/admin/disabled.gif" alt="{l s='Cancel'}" /></a>
|
||||
<a href="#" class="delete_product_line"><img src="../img/admin/delete.gif" alt="{l s='Delete'}" /></a>
|
||||
</td>
|
||||
{/if}
|
||||
</tr>
|
||||
{foreach $product.customizedDatas as $customizationPerAddress}
|
||||
{foreach $product['customizedDatas'] as $customizationPerAddress}
|
||||
{foreach $customizationPerAddress as $customizationId => $customization}
|
||||
<tr class="customized customized-{$product.id_order_detail}">
|
||||
<input type="hidden" class="edit_product_id_order_detail" value="{$product.id_order_detail}" />
|
||||
<tr class="customized customized-{$product['id_order_detail']|intval}">
|
||||
<td colspan="2">
|
||||
<input type="hidden" class="edit_product_id_order_detail" value="{$product['id_order_detail']|intval}" />
|
||||
{foreach $customization.datas as $type => $datas}
|
||||
{if ($type == Product::CUSTOMIZE_FILE)}
|
||||
<ul style="margin: 4px 0px 4px 0px; padding: 0px; list-style-type: none;">
|
||||
{foreach from=$datas item=data}
|
||||
<li style="margin: 2px;">
|
||||
<span>{if $data['name']}{$data['name']}{else}{l s='Picture #'}{$data@iteration}{/if}{l s=':'}</span>
|
||||
<a href="displayImage.php?img={$data['value']}&name={$order->id}-file{$data@iteration}" target="_blank"><img src="{$smarty.const._THEME_PROD_PIC_DIR_}{$data['value']}_small" alt="" /></a>
|
||||
<a href="displayImage.php?img={$data['value']}&name={$order->id|intval}-file{$data@iteration}" target="_blank"><img src="{$smarty.const._THEME_PROD_PIC_DIR_}{$data['value']}_small" alt="" /></a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
@@ -93,7 +99,7 @@
|
||||
<span class="product_quantity_show{if (int)$customization['quantity'] > 1} red bold{/if}">{$customization['quantity']}</span>
|
||||
{if $can_edit}
|
||||
<span class="product_quantity_edit" style="display:none;">
|
||||
<input type="text" name="product_quantity[{$customizationId}]" class="edit_product_quantity" value="{$customization['quantity']|htmlentities}" size="2" />
|
||||
<input type="text" name="product_quantity[{$customizationId|intval}]" class="edit_product_quantity" value="{$customization['quantity']|htmlentities}" size="2" />
|
||||
</span>
|
||||
{/if}
|
||||
</td>
|
||||
@@ -104,36 +110,38 @@
|
||||
</td>
|
||||
<td align="center" class="total_product">
|
||||
{if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)}
|
||||
{displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id}
|
||||
{displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id|intval}
|
||||
{else}
|
||||
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id}
|
||||
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id|intval}
|
||||
{/if}
|
||||
</td>
|
||||
<td align="center" class="cancelCheck standard_refund_fields current-edit" style="display:none">
|
||||
<input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="{$customization['quantity_returned']}" />
|
||||
<input type="hidden" name="totalQty" id="totalQty" value="{$customization['quantity']}" />
|
||||
<input type="hidden" name="totalQtyReturn" id="totalQtyReturn" value="{$customization['quantity_returned']|intval}" />
|
||||
<input type="hidden" name="totalQty" id="totalQty" value="{$customization['quantity']|intval}" />
|
||||
<input type="hidden" name="productName" id="productName" value="{$product['product_name']}" />
|
||||
{if ((!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN')) AND (int)($customization['quantity_returned']) < (int)($customization['quantity']))}
|
||||
<input type="checkbox" name="id_order_detail[{$product['id_order_detail']}]" id="id_order_detail[{$product['id_order_detail']}]" value="{$product['id_order_detail']}" onchange="setCancelQuantity(this, {$product['id_order_detail']}, {$customization['quantity'] - $product['customizationQuantityTotal'] - $product['product_quantity_reinjected']})" {if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])}disabled="disabled" {/if}/>
|
||||
<input type="checkbox" name="id_customization[{$customizationId|intval}]" id="id_customization[{$customizationId|intval}]" value="{$product['id_order_detail']|intval}" onchange="setCancelQuantity(this, {$customizationId|intval}, {$customization['quantity'] - $product['customizationQuantityTotal'] - $product['product_quantity_reinjected']})" {if ($product['product_quantity_return'] + $product['product_quantity_refunded'] >= $product['product_quantity'])}disabled="disabled" {/if}/>
|
||||
{else}
|
||||
--
|
||||
{/if}
|
||||
</td>
|
||||
<td class="cancelQuantity standard_refund_fields current-edit" style="display:none">
|
||||
{if ($customization['quantity_returned'] + $customization['quantity_refunded'] >= $customization['quantity'])}
|
||||
<input type="hidden" name="cancelQuantity[{$product['id_order_detail']}]" value="0" />
|
||||
<input type="hidden" name="cancelCustomizationQuantity[{$customizationId|intval}]" value="0" />
|
||||
{elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))}
|
||||
<input type="text" id="cancelQuantity_{$product['id_order_detail']}" name="cancelQuantity[{$product['id_order_detail']}]" size="2" onclick="selectCheckbox(this);" value="" />0/{$customization['quantity']-$customization['quantity_refunded']}
|
||||
<input type="text" id="cancelQuantity_{$customizationId|intval}" name="cancelCustomizationQuantity[{$customizationId|intval}]" size="2" onclick="selectCheckbox(this);" value="" />0/{$customization['quantity']-$customization['quantity_refunded']}
|
||||
{/if}
|
||||
</td>
|
||||
<td class="partial_refund_fields current-edit" style="text-align:left;display:none">
|
||||
<div style="width:40%;margin-top:5px;float:left">{l s='Quantity:'}</div> <div style="width:60%;margin-top:2px;float:left"><input type="text" size="3" name="partialRefundProductQuantity[{$product['id_order_detail']}]" value="0" />
|
||||
<div style="width:40%;margin-top:5px;float:left">{l s='Quantity:'}</div> <div style="width:60%;margin-top:2px;float:left"><input type="text" size="3" name="partialRefundProductQuantity[{$product['id_order_detail']|intval}]" value="0" />
|
||||
0/{$customization['quantity']-$customization['quantity_refunded']}
|
||||
</div>
|
||||
<div style="width:40%;margin-top:5px;float:left">{l s='Amount:'}</div> <div style="width:60%;margin-top:2px;float:left">{$currency->prefix}<input type="text" size="3" name="partialRefundProduct[{$product['id_order_detail']}]" />{$currency->suffix}</div>
|
||||
<td class="edit_product_fields" colspan="2" style="display:none"></td>
|
||||
<td class="product_action" style="text-align:right">
|
||||
<div style="width:40%;margin-top:5px;float:left">{l s='Amount:'}</div> <div style="width:60%;margin-top:2px;float:left">{$currency->prefix}<input type="text" size="3" name="partialRefundProduct[{$product['id_order_detail']|intval}]" />{$currency->suffix}</div>
|
||||
</td>
|
||||
{if ($can_edit && !$order->hasBeenDelivered())}
|
||||
<td class="edit_product_fields" colspan="2" style="display:none"></td>
|
||||
<td class="product_action" style="text-align:right"></td>
|
||||
{/if}
|
||||
</tr>
|
||||
{/foreach}
|
||||
{/foreach}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
*}
|
||||
<script type="text/javascript">
|
||||
var id_cart = {$cart->id|intval};
|
||||
var id_customer = '';
|
||||
var id_customer = 0;
|
||||
var changed_shipping_price = false;
|
||||
var shipping_price_selected_carrier = '';
|
||||
var current_index = '{$current}&token={$token}';
|
||||
@@ -464,6 +464,7 @@
|
||||
$('#summary_part').show();
|
||||
var address_link = $('#new_address').attr('href');
|
||||
id_customer = idCustomer;
|
||||
id_cart = 0;
|
||||
$('#new_address').attr('href', address_link.replace(/id_customer=[0-9]+/, 'id_customer='+id_customer));
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
|
||||
@@ -317,8 +317,8 @@
|
||||
line = line.replace(/image_path/g, path);
|
||||
line = line.replace(/image_position/g, position);
|
||||
line = line.replace(/blank/g, cover);
|
||||
line = line.replace("<tbody>", "");
|
||||
line = line.replace("</tbody>", "");
|
||||
line = line.replace(/<tbody>/gi, "");
|
||||
line = line.replace(/<\/tbody>/gi, "");
|
||||
if (shops != false)
|
||||
{
|
||||
$.each(shops, function(key, value){
|
||||
|
||||
@@ -227,7 +227,7 @@
|
||||
{else}
|
||||
<div class="hint clear" style="display: block;width: 70%;">{l s='You cannot edit your file here because you used combinations. Please edit this file in the Combinations tab.'}</div>
|
||||
<br />
|
||||
{$error_product_download}
|
||||
{if isset($error_product_download)}{$error_product_download}{/if}
|
||||
{/if}
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
if (html == 'false')
|
||||
{
|
||||
$("#conf_id_PS_SHOP_STATE_ID").fadeOut();
|
||||
$('#id_state option[value=0]').attr("selected", "selected");
|
||||
$('#PS_SHOP_STATE_ID option[value=0]').attr("selected", "selected");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -33,22 +33,29 @@
|
||||
document.getElementById('typeTranslationForm').submit();
|
||||
}
|
||||
|
||||
function addThemeSelect(el)
|
||||
function addThemeSelect()
|
||||
{
|
||||
var list_type_for_theme = [{foreach $translations_type_for_theme as $type}'{$type}', {/foreach}];
|
||||
var type = el.value;
|
||||
var list_type_for_theme = ['front', 'modules', 'pdf', 'mails'];
|
||||
var type = $('select[name=type]').val();
|
||||
|
||||
$('select[name=theme]').hide();
|
||||
for (i=0; i < list_type_for_theme.length; i++)
|
||||
if (list_type_for_theme[i] == type)
|
||||
{
|
||||
$('select[name=theme]').show();
|
||||
if (type == 'front')
|
||||
$('select[name=theme]').children('option[value=""]').attr('disabled', true)
|
||||
else
|
||||
$('select[name=theme]').children('option[value=""]').attr('disabled', false)
|
||||
}
|
||||
else
|
||||
$('select[name=theme]').val('{$theme_default}');
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
addThemeSelect();
|
||||
$('select[name=type]').change(function() {
|
||||
addThemeSelect(this);
|
||||
addThemeSelect();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -60,15 +67,15 @@
|
||||
<form method="get" action="index.php" id="typeTranslationForm">
|
||||
<input type="hidden" name="controller" value="AdminTranslations" />
|
||||
<input type="hidden" name="lang" id="translation_lang" value="0" />
|
||||
<select name="type" style="float:left; margin-right:10px;">
|
||||
<select name="type" style="float:left;margin-right:10px">
|
||||
{foreach $translations_type as $type => $array}
|
||||
<option value="{$type}">{$array.name} </option>
|
||||
<option value="{$type}">{$array.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<select name="theme" style="float:left; margin-right:10px;">
|
||||
<select name="theme" style="float:left;margin-right:10px">
|
||||
<option value="">{l s='Core (no theme selected)'}</option>
|
||||
{foreach $themes as $theme}
|
||||
|
||||
<option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name} </option>
|
||||
<option value="{$theme->directory}" {if $id_theme_current == $theme->id}selected=selected{/if}>{$theme->name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
{foreach $languages as $language}
|
||||
|
||||
@@ -117,7 +117,7 @@
|
||||
<td style="width: 40%">{$key|stripslashes}</td>
|
||||
<td>=
|
||||
{* Prepare name string for md5() *}
|
||||
{capture assign="name"}{strtolower($module_name)}_{strtolower($theme_name)}_{strtolower($template_name)}_{md5($key)}{/capture}
|
||||
{capture assign="name"}{strtolower($module_name)}{if $theme_name}_{strtolower($theme_name)}{/if}_{strtolower($template_name)}_{md5($key)}{/capture}
|
||||
{if $key|strlen < $textarea_sized}
|
||||
<input type="text"
|
||||
style="width: 450px{if empty($value.trad)};background:#FBB{/if}"
|
||||
|
||||
@@ -22,33 +22,31 @@
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*}
|
||||
|
||||
<div style="clear:both;height:0;line-height:0"> </div>
|
||||
</div>
|
||||
<div style="clear:both;height:0;line-height:0"> </div>
|
||||
<div style="clear:both;height:0;line-height:0"> </div>
|
||||
</div>
|
||||
<div style="clear:both;height:0;line-height:0"> </div>
|
||||
</div>
|
||||
{if $display_footer}
|
||||
{hook h="displayBackOfficeFooter"}
|
||||
<div id="footer">
|
||||
<div class="footerLeft">
|
||||
<a href="http://www.prestashop.com/" target="_blank">PrestaShop™ {$ps_version}</a><br />
|
||||
<span>{l s='Load time: '}{number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
|
||||
</div>
|
||||
{if $display_footer}
|
||||
{hook h="displayBackOfficeFooter"}
|
||||
<div id="footer">
|
||||
<div class="footerLeft">
|
||||
<a href="http://www.prestashop.com/" target="_blank">PrestaShop™ {$ps_version}</a><br />
|
||||
<span>{l s='Load time: '}{number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
|
||||
</div>
|
||||
<div class="footerRight">
|
||||
{if $iso_is_fr}
|
||||
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h à 18h
|
||||
{/if}
|
||||
| <a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</a>
|
||||
| <a href="http://forge.prestashop.com" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|
||||
| <a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">{l s='Forum'}</a>
|
||||
</div>
|
||||
<div class="footerRight">
|
||||
{if $iso_is_fr}
|
||||
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h à 18h
|
||||
{/if}
|
||||
| <a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</a>
|
||||
| <a href="http://forge.prestashop.com" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|
||||
| <a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">{l s='Forum'}</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ajax_confirmation" style="display:none"></div>
|
||||
{* ajaxBox allows*}
|
||||
<div id="ajaxBox" style="display:none"></div>
|
||||
{/if}
|
||||
<div id="scrollTop"><a href="#top"></a></div>
|
||||
</body>
|
||||
</html>
|
||||
</div>
|
||||
<div id="ajax_confirmation" style="display:none"></div>
|
||||
{* ajaxBox allows*} <div id="ajaxBox" style="display:none"></div>
|
||||
{/if}
|
||||
<div id="scrollTop"><a href="#top"></a></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -82,7 +82,6 @@
|
||||
<script type="text/javascript" src="{$js_uri}"></script>
|
||||
{/foreach}
|
||||
{/if}
|
||||
|
||||
<link rel="icon" type="image/vnd.microsoft.icon" href="{$img_dir}favicon.ico" />
|
||||
<link rel="shortcut icon" type="image/x-icon" href="{$img_dir}favicon.ico" />
|
||||
{if isset($displayBackOfficeHeader)}
|
||||
@@ -91,16 +90,15 @@
|
||||
<!--[if IE]>
|
||||
<link type="text/css" rel="stylesheet" href="{$base_url}css/admin-ie.css" />
|
||||
<![endif]-->
|
||||
{if isset($brightness)}
|
||||
{if isset($brightness)}
|
||||
<style type="text/css">
|
||||
div#header_infos, div#header_infos a#header_shopname, div#header_infos a#header_logout, div#header_infos a#header_foaccess {ldelim}color:{$brightness}{rdelim}
|
||||
</style>
|
||||
{/if}
|
||||
{/if}
|
||||
</head>
|
||||
<body style="{if isset($bo_color) && $bo_color}background:{$bo_color};{/if}{if isset($bo_width) && $bo_width > 0}text-align:center;{/if}">
|
||||
{if $display_header}
|
||||
<div id="ajax_running"><img src="../img/admin/ajax-loader-yellow.gif" alt="" /> {l s='Loading...'}</div>
|
||||
|
||||
<div id="top_container" {if $bo_width > 0}style="margin:auto;width:{$bo_width}px"{/if}>
|
||||
<div id="container">
|
||||
{* begin HEADER *}
|
||||
@@ -108,7 +106,7 @@
|
||||
<div id="header_infos">
|
||||
<a id="header_shopname" href="{$link->getAdminLink('AdminHome')|escape:'htmlall':'UTF-8'}"><span>{$shop_name}</span></a>
|
||||
<div id="notifs_icon_wrapper">
|
||||
{if {$show_new_orders} == 1}
|
||||
{if {$show_new_orders} == 1}
|
||||
<div id="orders_notif" class="notifs">
|
||||
<span id="orders_notif_number_wrapper" class="number_wrapper">
|
||||
<span id="orders_notif_value">0</span>
|
||||
@@ -120,8 +118,8 @@
|
||||
<p><a href="index.php?controller=AdminOrders&token={getAdminToken tab='AdminOrders'}">{l s='Show all orders'}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if ($show_new_customers == 1)}
|
||||
{/if}
|
||||
{if ($show_new_customers == 1)}
|
||||
<div id="customers_notif" class="notifs notifs_alternate">
|
||||
<span id="customers_notif_number_wrapper" class="number_wrapper">
|
||||
<span id="customers_notif_value">0</span>
|
||||
@@ -133,8 +131,8 @@
|
||||
<p><a href="index.php?controller=AdminCustomers&token={getAdminToken tab='AdminCustomers'}">{l s='Show all customers'}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if {$show_new_messages} == 1}
|
||||
{/if}
|
||||
{if {$show_new_messages} == 1}
|
||||
<div id="customer_messages_notif" class="notifs">
|
||||
<span id="customer_messages_notif_number_wrapper" class="number_wrapper">
|
||||
<span id="customer_messages_notif_value">0</span>
|
||||
@@ -146,9 +144,8 @@
|
||||
<p><a href="index.php?tab=AdminCustomerThreads&token={getAdminToken tab='AdminCustomerThreads'}">{l s='Show all messages'}</a></p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div id="employee_box">
|
||||
<div id="employee_infos">
|
||||
<div class="employee_name">{l s='Welcome,'} <strong>{$first_name} {$last_name}</strong></div>
|
||||
@@ -157,14 +154,13 @@
|
||||
<li><a href="{$link->getAdminLink('AdminEmployees')|escape:'htmlall':'UTF-8'}&id_employee={$employee->id}&updateemployee">{l s='My preferences'}</a></li>
|
||||
<li class="separator"> </li>
|
||||
<li><a id="header_logout" href="index.php?logout">{l s='logout'}</a></li>
|
||||
{if {$base_url}}
|
||||
<li class="separator"> </li>
|
||||
<a href="{$base_url}" id="header_foaccess" target="_blank" title="{l s='View my shop'}">{l s='View my shop'}</a>
|
||||
{/if}
|
||||
{if {$base_url}}
|
||||
<li class="separator"> </li>
|
||||
<a href="{$base_url}" id="header_foaccess" target="_blank" title="{l s='View my shop'}">{l s='View my shop'}</a>
|
||||
{/if}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="header_search">
|
||||
<form method="post" action="index.php?controller=AdminSearch&token={getAdminToken tab='AdminSearch'}">
|
||||
<input type="text" name="bo_query" id="bo_query" value="{$bo_query}" />
|
||||
@@ -183,8 +179,7 @@
|
||||
<input type="submit" id="bo_search_submit" class="button" value="{l s='Search'}"/>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{if count($quick_access) > 0}
|
||||
{if count($quick_access) > 0}
|
||||
<div id="header_quick">
|
||||
<select onchange="quickSelect(this);" id="quick_select" class="chosen no-search">
|
||||
<option value="0">{l s='Quick Access'}</option>
|
||||
@@ -193,19 +188,15 @@
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
{/if}
|
||||
{if isset($displayBackOfficeTop)}
|
||||
{$displayBackOfficeTop}
|
||||
{/if}
|
||||
{/if}
|
||||
{if isset($displayBackOfficeTop)}{$displayBackOfficeTop}{/if}
|
||||
</div>{* end header_infos*}
|
||||
|
||||
<ul id="menu">
|
||||
{if !$tab}
|
||||
<div class="mainsubtablist" style="display:none">
|
||||
</div>
|
||||
{/if}
|
||||
{foreach $tabs AS $t}
|
||||
{if $t.active}
|
||||
{if !$tab}
|
||||
<div class="mainsubtablist" style="display:none"></div>
|
||||
{/if}
|
||||
{foreach $tabs AS $t}
|
||||
{if $t.active}
|
||||
<li class="submenu_size maintab {if $t.current}active{/if}" id="maintab{$t.id_tab}">
|
||||
<a href="#" class="title">
|
||||
<img src="{$t.img}" alt="" />{if $t.name eq ''}{$t.class_name}{else}{$t.name}{/if}
|
||||
@@ -218,23 +209,20 @@
|
||||
{/foreach}
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
{/foreach}
|
||||
{/if}
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>{* end header*}
|
||||
|
||||
</div>{* end header*}
|
||||
{/if}
|
||||
<div id="main">
|
||||
<div id="content">
|
||||
{if $display_header && $install_dir_exists}
|
||||
<div style="background-color: #FFEBCC;border: 1px solid #F90;line-height: 20px;margin: 0px 0px 10px;padding: 10px 20px;">
|
||||
{l s='For security reasons, you must also:'} {l s='delete the /install folder'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)}
|
||||
<div class="multishop_toolbar">
|
||||
<span class="text_multishop">{l s='Multistore configuration for'}</span>
|
||||
{$shop_list}
|
||||
</div>
|
||||
{/if}
|
||||
{if $display_header && $install_dir_exists}
|
||||
<div style="background-color: #FFEBCC;border: 1px solid #F90;line-height: 20px;margin: 0px 0px 10px;padding: 10px 20px;">
|
||||
{l s='For security reasons, you must also:'} {l s='delete the /install folder'}
|
||||
</div>
|
||||
{/if}
|
||||
{if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)}
|
||||
<div class="multishop_toolbar">
|
||||
<span class="text_multishop">{l s='Multistore configuration for'}</span> {$shop_list}
|
||||
</div>
|
||||
{/if}
|
||||
@@ -116,6 +116,8 @@
|
||||
{if isset($params.color) && isset($tr.color)}
|
||||
</span>
|
||||
{/if}
|
||||
{/block}
|
||||
{block name="close_td"}
|
||||
</td>
|
||||
{/block}
|
||||
{/foreach}
|
||||
|
||||
@@ -189,8 +189,8 @@
|
||||
<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($value.0)}$value.0{/if}"{if isset($params.width)} style="width:70px"{/if}/><br />
|
||||
{l s='To'} <input type="text" class="filter datepicker" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($value.1)}$value.1{/if}"{if isset($params.width)} style="width:70px"{/if}/>
|
||||
{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 />
|
||||
{l s='To'} <input type="text" class="filter datepicker" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}"{if isset($params.width)} style="width:70px"{/if}/>
|
||||
{elseif $params.type == 'select'}
|
||||
{if isset($params.filter_key)}
|
||||
<select onchange="$('#submitFilterButton{$table}').focus();$('#submitFilterButton{$table}').click();" name="{$table}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
|
||||
|
||||
@@ -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
|
||||
*}
|
||||
{foreach from=$export_headers item=header}{$header};{/foreach}
|
||||
{$export_precontent}{foreach from=$export_headers item=header}{$header};{/foreach}
|
||||
{foreach from=$export_content item=line}
|
||||
|
||||
{foreach from=$line item=content}{$content};{/foreach}
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{if isset($informations) && count($informations) && $informations}
|
||||
<div class="hint clear" style="display:block;">
|
||||
<span id="see_more_infos">
|
||||
@@ -60,7 +59,6 @@
|
||||
</div>
|
||||
</div><br />
|
||||
{/if}
|
||||
|
||||
{if isset($confirmations) && count($confirmations) && $confirmations}
|
||||
<div class="conf" style="display:block;">
|
||||
{foreach $confirmations as $conf}
|
||||
@@ -68,7 +66,6 @@
|
||||
{/foreach}
|
||||
</div><br />
|
||||
{/if}
|
||||
|
||||
{if count($warnings)}
|
||||
<div class="warn">
|
||||
<span style="float:right">
|
||||
@@ -94,6 +91,5 @@
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{$page}
|
||||
{include file='footer.tpl'}
|
||||
{include file='footer.tpl'}
|
||||
@@ -128,7 +128,7 @@ class CarrierCore extends ObjectModel
|
||||
'max_width' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'max_height' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'max_depth' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'max_weight' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
|
||||
'max_weight' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'),
|
||||
'grade' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'size' => 1),
|
||||
'external_module_name' => array('type' => self::TYPE_STRING, 'size' => 64),
|
||||
'is_module' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
|
||||
@@ -953,6 +953,7 @@ class CartCore extends ObjectModel
|
||||
$this->update(true);
|
||||
$context = Context::getContext()->cloneContext();
|
||||
$context->cart = $this;
|
||||
Cache::clean('getContextualValue_*');
|
||||
if ($auto_add_cart_rule)
|
||||
CartRule::autoAddToCart($context);
|
||||
|
||||
@@ -1591,9 +1592,9 @@ class CartCore extends ObjectModel
|
||||
*/
|
||||
public function getPackageList($flush = false)
|
||||
{
|
||||
static $cache = false;
|
||||
if ($cache !== false && !$flush)
|
||||
return $cache;
|
||||
static $cache = array();
|
||||
if (isset($cache[(int)$this->id]) && $cache[(int)$this->id] !== false && !$flush)
|
||||
return $cache[(int)$this->id];
|
||||
|
||||
$product_list = $this->getProducts();
|
||||
// Step 1 : Get product informations (warehouse_list and carrier_list), count warehouse
|
||||
@@ -1821,7 +1822,7 @@ class CartCore extends ObjectModel
|
||||
);
|
||||
}
|
||||
}
|
||||
$cache = $final_package_list;
|
||||
$cache[(int)$this->id] = $final_package_list;
|
||||
return $final_package_list;
|
||||
}
|
||||
|
||||
@@ -2292,7 +2293,7 @@ class CartCore extends ObjectModel
|
||||
$this->id_carrier = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
Cache::clean('getContextualValue_*');
|
||||
$delivery_option_list = $this->getDeliveryOptionList(null, true);
|
||||
|
||||
foreach ($delivery_option_list as $id_address => $options)
|
||||
@@ -2869,8 +2870,12 @@ class CartCore extends ObjectModel
|
||||
{
|
||||
$cart_rule['value_real'] -= $total_shipping;
|
||||
$cart_rule['value_tax_exc'] -= $total_shipping_tax_exc;
|
||||
$total_discounts -= $total_shipping;
|
||||
$total_discounts_tax_exc -= $total_shipping_tax_exc;
|
||||
$cart_rule['value_real'] = Tools::ps_round($cart_rule['value_real'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
|
||||
$cart_rule['value_tax_exc'] = Tools::ps_round($cart_rule['value_tax_exc'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
|
||||
if ($total_discounts > $cart_rule['value_real'])
|
||||
$total_discounts -= $total_shipping;
|
||||
if ($total_discounts_tax_exc > $cart_rule['value_tax_exc'])
|
||||
$total_discounts_tax_exc -= $total_shipping_tax_exc;
|
||||
|
||||
// Update total shipping
|
||||
$total_shipping = 0;
|
||||
|
||||
@@ -912,7 +912,7 @@ class CartRuleCore extends ObjectModel
|
||||
if ($cart_vat_amount == 0 || $cart_amount_te == 0)
|
||||
$cart_average_vat_rate = 0;
|
||||
else
|
||||
$cart_average_vat_rate = $cart_vat_amount / $cart_amount_te;
|
||||
$cart_average_vat_rate = Tools::ps_round($cart_vat_amount / $cart_amount_te, 3);
|
||||
|
||||
if ($this->reduction_tax && !$use_tax)
|
||||
$reduction_value += $prorata * $reduction_amount / (1 + $cart_average_vat_rate);
|
||||
@@ -1079,12 +1079,12 @@ class CartRuleCore extends ObjectModel
|
||||
if (!CartRule::isFeatureActive() || !Validate::isLoadedObject($context->cart))
|
||||
return;
|
||||
|
||||
$result = Db::getInstance()->executeS('
|
||||
$sql = '
|
||||
SELECT cr.*
|
||||
FROM '._DB_PREFIX_.'cart_rule cr
|
||||
LEFT JOIN '._DB_PREFIX_.'cart_rule_shop crs ON cr.id_cart_rule = crs.id_cart_rule
|
||||
LEFT JOIN '._DB_PREFIX_.'cart_rule_carrier crca ON cr.id_cart_rule = crca.id_cart_rule
|
||||
'.($context->cart->id_carrier ? 'INNER JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crca.id_carrier AND c.deleted = 0)' : '').'
|
||||
'.($context->cart->id_carrier ? 'LEFT JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crca.id_carrier AND c.deleted = 0)' : '').'
|
||||
LEFT JOIN '._DB_PREFIX_.'cart_rule_country crco ON cr.id_cart_rule = crco.id_cart_rule
|
||||
WHERE cr.active = 1
|
||||
AND cr.code = ""
|
||||
@@ -1108,9 +1108,9 @@ class CartRuleCore extends ObjectModel
|
||||
'.($context->customer->id ? 'OR 0 < (
|
||||
SELECT cg.id_group
|
||||
FROM '._DB_PREFIX_.'customer_group cg
|
||||
LEFT JOIN '._DB_PREFIX_.'cart_rule_group crg ON cg.id_group = crg.id_group
|
||||
LEFT JOIN '._DB_PREFIX_.'cart_rule_group crg ON (cg.id_group = crg.id_group AND cg.id_group = '.(int)$context->customer->id_default_group.')
|
||||
WHERE cr.id_cart_rule = crg.id_cart_rule
|
||||
AND cg.id_customer = '.(int)$context->customer->id.'
|
||||
AND cg.id_customer = '.(int)$context->customer->id.' LIMIT 1
|
||||
)' : '').'
|
||||
)
|
||||
AND (
|
||||
@@ -1122,8 +1122,8 @@ class CartRuleCore extends ObjectModel
|
||||
)
|
||||
)
|
||||
AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.')
|
||||
ORDER BY priority');
|
||||
|
||||
ORDER BY priority';
|
||||
$result = Db::getInstance()->executeS($sql);
|
||||
if ($result)
|
||||
{
|
||||
$cart_rules = ObjectModel::hydrateCollection('CartRule', $result);
|
||||
|
||||
@@ -47,7 +47,6 @@ class ConfigurationTestCore
|
||||
'upload' => false,
|
||||
'gd' => false,
|
||||
'mysql_support' => false,
|
||||
'sessions' => false,
|
||||
'config_dir' => 'config',
|
||||
'cache_dir' => 'cache',
|
||||
'sitemap' => 'sitemap.xml',
|
||||
@@ -55,9 +54,9 @@ class ConfigurationTestCore
|
||||
'img_dir' => 'img',
|
||||
'mails_dir' => 'mails',
|
||||
'module_dir' => 'modules',
|
||||
'theme_lang_dir' => 'themes/'._THEME_NAME_.'/lang',
|
||||
'theme_lang_dir' => 'themes/'._THEME_NAME_.'/lang/',
|
||||
'theme_pdf_lang_dir' => 'themes/'._THEME_NAME_.'/pdf/lang/',
|
||||
'theme_cache_dir' => 'themes/'._THEME_NAME_.'/cache',
|
||||
'theme_cache_dir' => 'themes/'._THEME_NAME_.'/cache/',
|
||||
'translations_dir' => 'translations',
|
||||
'customizable_products_dir' => 'upload',
|
||||
'virtual_products_dir' => 'download'
|
||||
@@ -267,21 +266,24 @@ class ConfigurationTestCore
|
||||
|
||||
public static function test_theme_lang_dir($dir)
|
||||
{
|
||||
if (!file_exists($dir))
|
||||
return true;
|
||||
$absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/');
|
||||
if (!file_exists($absoluteDir))
|
||||
return true;
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_theme_pdf_lang_dir($dir)
|
||||
{
|
||||
if (!file_exists($dir))
|
||||
$absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/');
|
||||
if (!file_exists($absoluteDir))
|
||||
return true;
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
|
||||
public static function test_theme_cache_dir($dir)
|
||||
{
|
||||
if (!file_exists($dir))
|
||||
$absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/');
|
||||
if (!file_exists($absoluteDir))
|
||||
return true;
|
||||
return ConfigurationTest::test_dir($dir, true);
|
||||
}
|
||||
@@ -317,4 +319,4 @@ class ConfigurationTestCore
|
||||
{
|
||||
return extension_loaded('Dom');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -387,15 +387,15 @@ class DispatcherCore
|
||||
// Load custom routes from modules
|
||||
$modules_routes = Hook::exec('moduleRoutes', array(), null, true, false);
|
||||
if (is_array($modules_routes) && count($modules_routes))
|
||||
foreach($modules_routes as $module_route)
|
||||
foreach($module_route as $route => $route_details)
|
||||
if (array_key_exists('controller', $route_details) && array_key_exists('rule', $route_details)
|
||||
&& array_key_exists('keywords', $route_details) && array_key_exists('params', $route_details))
|
||||
{
|
||||
if (!isset($this->default_routes[$route]))
|
||||
$this->default_routes[$route] = array();
|
||||
$this->default_routes[$route] = array_merge($this->default_routes[$route], $route_details);
|
||||
}
|
||||
foreach($modules_routes as $module_route)
|
||||
foreach($module_route as $route => $route_details)
|
||||
if (array_key_exists('controller', $route_details) && array_key_exists('rule', $route_details)
|
||||
&& array_key_exists('keywords', $route_details) && array_key_exists('params', $route_details))
|
||||
{
|
||||
if (!isset($this->default_routes[$route]))
|
||||
$this->default_routes[$route] = array();
|
||||
$this->default_routes[$route] = array_merge($this->default_routes[$route], $route_details);
|
||||
}
|
||||
|
||||
// Set default routes
|
||||
foreach (Language::getLanguages() as $lang)
|
||||
@@ -675,38 +675,41 @@ class DispatcherCore
|
||||
if (!$this->request_uri)
|
||||
return strtolower($this->controller_not_found);
|
||||
$controller = $this->controller_not_found;
|
||||
|
||||
// If the request_uri matches a static file, then there is no need to check the routes, we keep "controller_not_found" (a static file should not go through the dispatcher)
|
||||
if (!preg_match('/\.(gif|jpe?g|png|css|js|ico)$/i', $this->request_uri))
|
||||
{
|
||||
// Add empty route as last route to prevent this greedy regexp to match request uri before right time
|
||||
if ($this->empty_route)
|
||||
$this->addRoute($this->empty_route['routeID'], $this->empty_route['rule'], $this->empty_route['controller'], Context::getContext()->language->id);
|
||||
|
||||
// Add empty route as last route to prevent this greedy regexp to match request uri before right time
|
||||
if ($this->empty_route)
|
||||
$this->addRoute($this->empty_route['routeID'], $this->empty_route['rule'], $this->empty_route['controller'], Context::getContext()->language->id);
|
||||
|
||||
if (isset($this->routes[Context::getContext()->language->id]))
|
||||
foreach ($this->routes[Context::getContext()->language->id] as $route)
|
||||
if (preg_match($route['regexp'], $this->request_uri, $m))
|
||||
{
|
||||
// Route found ! Now fill $_GET with parameters of uri
|
||||
foreach ($m as $k => $v)
|
||||
if (!is_numeric($k))
|
||||
$_GET[$k] = $v;
|
||||
|
||||
$controller = $route['controller'] ? $route['controller'] : $_GET['controller'];
|
||||
if (!empty($route['params']))
|
||||
foreach ($route['params'] as $k => $v)
|
||||
$_GET[$k] = $v;
|
||||
|
||||
// A patch for module friendly urls
|
||||
if (preg_match('#module-([a-z0-9_-]+)-([a-z0-9]+)$#i', $controller, $m))
|
||||
if (isset($this->routes[Context::getContext()->language->id]))
|
||||
foreach ($this->routes[Context::getContext()->language->id] as $route)
|
||||
if (preg_match($route['regexp'], $this->request_uri, $m))
|
||||
{
|
||||
$_GET['module'] = $m[1];
|
||||
$_GET['fc'] = 'module';
|
||||
$controller = $m[2];
|
||||
// Route found ! Now fill $_GET with parameters of uri
|
||||
foreach ($m as $k => $v)
|
||||
if (!is_numeric($k))
|
||||
$_GET[$k] = $v;
|
||||
|
||||
$controller = $route['controller'] ? $route['controller'] : $_GET['controller'];
|
||||
if (!empty($route['params']))
|
||||
foreach ($route['params'] as $k => $v)
|
||||
$_GET[$k] = $v;
|
||||
|
||||
// A patch for module friendly urls
|
||||
if (preg_match('#module-([a-z0-9_-]+)-([a-z0-9]+)$#i', $controller, $m))
|
||||
{
|
||||
$_GET['module'] = $m[1];
|
||||
$_GET['fc'] = 'module';
|
||||
$controller = $m[2];
|
||||
}
|
||||
|
||||
if (isset($_GET['fc']) && $_GET['fc'] == 'module')
|
||||
$this->front_controller = self::FC_MODULE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (isset($_GET['fc']) && $_GET['fc'] == 'module')
|
||||
$this->front_controller = self::FC_MODULE;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
if ($controller == 'index' || $this->request_uri == '/index.php')
|
||||
$controller = $this->default_controller;
|
||||
$this->controller = $controller;
|
||||
|
||||
@@ -66,8 +66,8 @@ class GenderCore extends ObjectModel
|
||||
|
||||
public function getImage($use_unknown = false)
|
||||
{
|
||||
if (!file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
|
||||
return ($use_unknown) ? _PS_ADMIN_IMG_.'unknown.gif' : false;
|
||||
if (!isset($this->id) || empty($this->id) || !file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
|
||||
return _THEME_GENDERS_DIR_.'Unknown.jpg';
|
||||
return _THEME_GENDERS_DIR_.$this->id.'.jpg';
|
||||
}
|
||||
}
|
||||
@@ -274,8 +274,9 @@ class HookCore extends ObjectModel
|
||||
// For payment modules, we check that they are available in the contextual country
|
||||
elseif ($frontend)
|
||||
{
|
||||
$sql->where(Module::getPaypalIgnore());
|
||||
if (Validate::isLoadedObject($context->country))
|
||||
$sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' LIMIT 1) = '.(int)$context->country->id.')');
|
||||
$sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' AND id_shop = '.(int)$context->shop->id.' LIMIT 1) = '.(int)$context->country->id.')');
|
||||
if (Validate::isLoadedObject($context->currency))
|
||||
$sql->where('(h.name = "displayPayment" AND (SELECT id_currency FROM '._DB_PREFIX_.'module_currency mcr WHERE mcr.id_module = m.id_module AND id_currency IN ('.(int)$context->currency->id.', -2) LIMIT 1) IN ('.(int)$context->currency->id.', -2))');
|
||||
}
|
||||
@@ -286,7 +287,6 @@ class HookCore extends ObjectModel
|
||||
{
|
||||
$sql->leftJoin('module_group', 'mg', 'mg.`id_module` = m.`id_module`');
|
||||
$sql->where('mg.`id_group` IN ('.implode(', ', $groups).')');
|
||||
$sql->where(Module::getPaypalIgnore());
|
||||
$sql->groupBy('hm.id_hook, hm.id_module');
|
||||
}
|
||||
|
||||
|
||||
@@ -801,6 +801,8 @@ class LanguageCore extends ObjectModel
|
||||
$files_list = $gz->listContent();
|
||||
if (!$gz->extract(_PS_TRANSLATIONS_DIR_.'../', false))
|
||||
$errors[] = Tools::displayError('Cannot decompress the translation file for the following language: ').(string)$iso;
|
||||
// Clear smarty modules cache
|
||||
Tools::clearCache();
|
||||
if (!Language::checkAndAddLanguage((string)$iso, $lang_pack, false, $params))
|
||||
$errors[] = Tools::displayError('An error occurred while creating the language: ').(string)$iso;
|
||||
else
|
||||
|
||||
@@ -51,7 +51,6 @@ class LocalizationPackCore
|
||||
$res &= $this->_installUnits($xml);
|
||||
$res &= $this->installConfiguration($xml);
|
||||
$res &= $this->installModules($xml);
|
||||
$res &= $this->updateDefaultGroupDisplayMethod($xml);
|
||||
$res &= $this->_installLanguages($xml, $install_mode);
|
||||
|
||||
if ($res && isset($this->iso_code_lang))
|
||||
@@ -233,7 +232,7 @@ class LocalizationPackCore
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return $this->updateDefaultGroupDisplayMethod($xml);
|
||||
}
|
||||
|
||||
protected function _installCurrencies($xml, $install_mode = false)
|
||||
@@ -391,10 +390,13 @@ class LocalizationPackCore
|
||||
$attributes = $xml->group_default->attributes();
|
||||
if (isset($attributes['price_display_method']) && in_array((int)$attributes['price_display_method'], array(0, 1)))
|
||||
{
|
||||
$group = new Group((int)Configuration::get('PS_CUSTOMER_GROUP'));
|
||||
$group->price_display_method = (int)$attributes['price_display_method'];
|
||||
if (!$group->save())
|
||||
$this->_errors[] = Tools::displayError('An error occurred during the default group update');
|
||||
foreach (array((int)Configuration::get('PS_CUSTOMER_GROUP'), (int)Configuration::get('PS_GUEST_GROUP'), (int)Configuration::get('PS_UNIDENTIFIED_GROUP')) as $id_group)
|
||||
{
|
||||
$group = new Group((int)$id_group);
|
||||
$group->price_display_method = (int)$attributes['price_display_method'];
|
||||
if (!$group->save())
|
||||
$this->_errors[] = Tools::displayError('An error occurred during the default group update');
|
||||
}
|
||||
}
|
||||
else
|
||||
$this->_errors[] = Tools::displayError('An error has occurred during the default group update');
|
||||
|
||||
@@ -251,7 +251,7 @@ class MailCore
|
||||
$template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo)));
|
||||
|
||||
$template_vars['{shop_name}'] = Tools::safeOutput(Configuration::get('PS_SHOP_NAME', null, null, $id_shop));
|
||||
$template_vars['{shop_url}'] = Tools::getShopDomain(true, true).__PS_BASE_URI__.'index.php';
|
||||
$template_vars['{shop_url}'] = Context::getContext()->link->getPageLink('index', true, Context::getContext()->language->id);
|
||||
$template_vars['{my_account_url}'] = Context::getContext()->link->getPageLink('my-account', true, Context::getContext()->language->id);
|
||||
$template_vars['{guest_tracking_url}'] = Context::getContext()->link->getPageLink('guest-tracking', true, Context::getContext()->language->id);
|
||||
$template_vars['{history_url}'] = Context::getContext()->link->getPageLink('history', true, Context::getContext()->language->id);
|
||||
|
||||
@@ -940,8 +940,8 @@ abstract class ObjectModelCore
|
||||
{
|
||||
global $_FIELDS;
|
||||
|
||||
if (file_exists(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php'))
|
||||
include(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php');
|
||||
if ($_FIELDS === null && file_exists(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php'))
|
||||
include_once(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php');
|
||||
|
||||
$key = $class.'_'.md5($field);
|
||||
return ((is_array($_FIELDS) && array_key_exists($key, $_FIELDS)) ? ($htmlentities ? htmlentities($_FIELDS[$key], ENT_QUOTES, 'utf-8') : $_FIELDS[$key]) : $field);
|
||||
@@ -1596,4 +1596,4 @@ abstract class ObjectModelCore
|
||||
{
|
||||
$this->update_fields = $fields;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -429,12 +429,14 @@ abstract class PaymentModuleCore extends Module
|
||||
|
||||
// Set the new voucher value
|
||||
if ($voucher->reduction_tax)
|
||||
$voucher->reduction_amount = $values['tax_incl'] - $order->total_products_wt;
|
||||
$voucher->reduction_amount = $values['tax_incl'] - $order->total_products_wt - $order->total_shipping_tax_incl;
|
||||
else
|
||||
$voucher->reduction_amount = $values['tax_excl'] - $order->total_products;
|
||||
$voucher->reduction_amount = $values['tax_excl'] - $order->total_products - $order->total_shipping_tax_excl;
|
||||
|
||||
$voucher->id_customer = $order->id_customer;
|
||||
$voucher->quantity = 1;
|
||||
$voucher->quantity_per_user = 1;
|
||||
$voucher->free_shipping = 0;
|
||||
if ($voucher->add())
|
||||
{
|
||||
// If the voucher has conditions, they are now copied to the new voucher
|
||||
|
||||
@@ -458,6 +458,10 @@ class ProductCore extends ObjectModel
|
||||
$this->tax_rate = $this->getTaxesRate(new Address($address));
|
||||
|
||||
$this->new = $this->isNew();
|
||||
|
||||
// keep base price
|
||||
$this->base_price = $this->price;
|
||||
|
||||
$this->price = Product::getPriceStatic((int)$this->id, false, null, 6, null, false, true, 1, false, null, null, null, $this->specificPrice);
|
||||
$this->unit_price = ($this->unit_price_ratio != 0 ? $this->price / $this->unit_price_ratio : 0);
|
||||
if ($this->id)
|
||||
@@ -2135,7 +2139,10 @@ class ProductCore extends ObjectModel
|
||||
|
||||
$sql = 'SELECT p.*, product_shop.*, stock.`out_of_stock` out_of_stock, pl.`description`, pl.`description_short`,
|
||||
pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`,
|
||||
p.`ean13`, p.`upc`, MAX(image_shop.`id_image`) id_image, il.`legend`
|
||||
p.`ean13`, p.`upc`, MAX(image_shop.`id_image`) id_image, il.`legend`,
|
||||
DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(),
|
||||
INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).'
|
||||
DAY)) > 0 AS new
|
||||
FROM `'._DB_PREFIX_.'product` p
|
||||
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (
|
||||
p.`id_product` = pl.`id_product`
|
||||
|
||||
@@ -175,7 +175,7 @@ class ProductDownloadCore extends ObjectModel
|
||||
{
|
||||
if (!ProductDownload::isFeatureActive())
|
||||
return false;
|
||||
if (array_key_exists($id_product, self::$_productIds))
|
||||
if (array_key_exists((int)$id_product, self::$_productIds))
|
||||
return self::$_productIds[$id_product];
|
||||
self::$_productIds[$id_product] = (int)Db::getInstance()->getValue('
|
||||
SELECT `id_product_download`
|
||||
|
||||
@@ -65,11 +65,9 @@ class ProductSaleCore
|
||||
{
|
||||
if ($page_number < 0) $page_number = 0;
|
||||
if ($nb_products < 1) $nb_products = 10;
|
||||
|
||||
$final_order_by = $order_by;
|
||||
if (empty($order_by) || $order_by == 'position' || $order_by = 'price') $order_by = 'sales';
|
||||
if (empty($order_way) || $order_by == 'sales') $order_way = 'DESC';
|
||||
|
||||
if (is_null($order_by) || $order_by == 'position' || $order_by == 'price') $order_by = 'sales';
|
||||
if (is_null($order_way) || $order_by == 'sales') $order_way == 'DESC';
|
||||
$groups = FrontController::getCurrentCustomerGroups();
|
||||
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
|
||||
$interval = Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20;
|
||||
|
||||
@@ -658,7 +658,7 @@ class SearchCore
|
||||
SELECT id_group FROM '._DB_PREFIX_.'customer_group
|
||||
WHERE id_customer = '.(int)$id_customer.')').'
|
||||
AND t.`name` LIKE \'%'.pSQL($tag).'%\'
|
||||
GROUP BY product_shop.id_image
|
||||
GROUP BY product_shop.id_product
|
||||
ORDER BY position DESC'.($orderBy ? ', '.$orderBy : '').($orderWay ? ' '.$orderWay : '').'
|
||||
LIMIT '.(int)(($pageNumber - 1) * $pageSize).','.(int)$pageSize;
|
||||
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql))
|
||||
|
||||
@@ -280,7 +280,7 @@ class SpecificPriceRuleCore extends ObjectModel
|
||||
$specific_price->id_currency = (int)$rule->id_currency;
|
||||
$specific_price->id_group = (int)$rule->id_group;
|
||||
$specific_price->from_quantity = (int)$rule->from_quantity;
|
||||
$specific_price->price = (int)$rule->price;
|
||||
$specific_price->price = (float)$rule->price;
|
||||
$specific_price->reduction_type = $rule->reduction_type;
|
||||
$specific_price->reduction = ($rule->reduction_type == 'percentage' ? $rule->reduction / 100 : (float)$rule->reduction);
|
||||
$specific_price->from = $rule->from;
|
||||
@@ -288,4 +288,4 @@ class SpecificPriceRuleCore extends ObjectModel
|
||||
|
||||
return $specific_price->add();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1562,6 +1562,9 @@ class ToolsCore
|
||||
fwrite($write_fd, "# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution\n");
|
||||
fwrite($write_fd, "# http://www.prestashop.com - http://www.prestashop.com/forums\n\n");
|
||||
|
||||
if ($disable_modsec)
|
||||
fwrite($write_fd, "<IfModule mod_security.c>\nSecFilterEngine Off\nSecFilterScanPOST Off\n</IfModule>\n");
|
||||
|
||||
// RewriteEngine
|
||||
fwrite($write_fd, "<IfModule mod_rewrite.c>\n");
|
||||
|
||||
@@ -1569,9 +1572,6 @@ class ToolsCore
|
||||
if ($disable_multiviews)
|
||||
fwrite($write_fd, "\n# Disable Multiviews\nOptions -Multiviews\n\n");
|
||||
|
||||
if ($disable_modsec)
|
||||
fwrite($write_fd, "<IfModule mod_security.c>\nSecFilterEngine Off\nSecFilterScanPOST Off\n</IfModule>");
|
||||
|
||||
fwrite($write_fd, "RewriteEngine on\n");
|
||||
|
||||
if (!$medias)
|
||||
@@ -1598,8 +1598,10 @@ class ToolsCore
|
||||
|
||||
// Webservice
|
||||
fwrite($write_fd, 'RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]'."\n\n");
|
||||
|
||||
$rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS', null, null, (int)$uri['id_shop']);
|
||||
|
||||
if (!$rewrite_settings)
|
||||
$rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS', null, null, (int)$uri['id_shop']);
|
||||
|
||||
$domain_rewrite_cond = 'RewriteCond %{HTTP_HOST} ^'.$domain.'$'."\n";
|
||||
// Rewrite virtual multishop uri
|
||||
if ($uri['virtual'])
|
||||
@@ -1629,10 +1631,10 @@ class ToolsCore
|
||||
{
|
||||
fwrite($write_fd, $media_domains);
|
||||
fwrite($write_fd, $domain_rewrite_cond);
|
||||
fwrite($write_fd, 'RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}'._PS_PROD_IMG_.'$1-$2$3$4.jpg [L]'."\n");
|
||||
fwrite($write_fd, 'RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1-$2$3$4.jpg [L]'."\n");
|
||||
fwrite($write_fd, $media_domains);
|
||||
fwrite($write_fd, $domain_rewrite_cond);
|
||||
fwrite($write_fd, 'RewriteRule ^([0-9]+)\-([0-9]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}'._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n");
|
||||
fwrite($write_fd, 'RewriteRule ^([0-9]+)\-([0-9]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1-$2$3.jpg [L]'."\n");
|
||||
}
|
||||
|
||||
// Rewrite product images < 100 millions
|
||||
@@ -1647,7 +1649,7 @@ class ToolsCore
|
||||
$img_name .= '$'.$j;
|
||||
fwrite($write_fd, $media_domains);
|
||||
fwrite($write_fd, $domain_rewrite_cond);
|
||||
fwrite($write_fd, 'RewriteRule ^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}'._PS_PROD_IMG_.$img_path.$img_name.'$'.($j + 1).".jpg [L]\n");
|
||||
fwrite($write_fd, 'RewriteRule ^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/'.$img_path.$img_name.'$'.($j + 1).".jpg [L]\n");
|
||||
}
|
||||
fwrite($write_fd, $media_domains);
|
||||
fwrite($write_fd, $domain_rewrite_cond);
|
||||
@@ -2115,11 +2117,14 @@ exit;
|
||||
*
|
||||
* @param Smarty $smarty
|
||||
*/
|
||||
public static function clearCache($smarty, $tpl = false, $cache_id = null, $compile_id = null)
|
||||
public static function clearCache($smarty = null, $tpl = false, $cache_id = null, $compile_id = null)
|
||||
{
|
||||
if (is_null($smarty))
|
||||
if ($smarty === null)
|
||||
$smarty = Context::getContext()->smarty;
|
||||
|
||||
|
||||
if ($smarty === null)
|
||||
return;
|
||||
|
||||
if (!$tpl && $cache_id === null && $compile_id === null)
|
||||
return $smarty->clearAllCache();
|
||||
|
||||
@@ -2345,16 +2350,16 @@ exit;
|
||||
$addons_url = 'api.addons.prestashop.com';
|
||||
$postData = '';
|
||||
$postDataArray = array(
|
||||
'version' => _PS_VERSION_,
|
||||
'iso_lang' => strtolower(Context::getContext()->language->iso_code),
|
||||
'iso_code' => strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
|
||||
'shop_url' => urlencode(Tools::getShopDomain()),
|
||||
'mail' => urlencode(Configuration::get('PS_SHOP_EMAIL'))
|
||||
'version' => isset($params['version']) ? $params['version'] : _PS_VERSION_,
|
||||
'iso_lang' => Tools::strtolower(isset($params['iso_lang']) ? $params['iso_lang'] : Context::getContext()->language->iso_code),
|
||||
'iso_code' => Tools::strtolower(isset($params['iso_country']) ? $params['iso_country'] : Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))),
|
||||
'shop_url' => urlencode(isset($params['shop_url']) ? $params['shop_url'] : Tools::getShopDomain()),
|
||||
'mail' => urlencode(isset($params['email']) ? $params['email'] : Configuration::get('email'))
|
||||
);
|
||||
foreach ($postDataArray as $postDataKey => $postDataValue)
|
||||
$postData .= '&'.$postDataKey.'='.$postDataValue;
|
||||
$postData = ltrim($postData, '&');
|
||||
|
||||
|
||||
// Config for each request
|
||||
if ($request == 'native')
|
||||
{
|
||||
@@ -2451,5 +2456,4 @@ function cmpPriceDesc($a, $b)
|
||||
elseif ((float)$a['price_tmp'] > (float)$b['price_tmp'])
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -129,7 +129,7 @@ class TranslateCore
|
||||
static $translations_merged = array();
|
||||
|
||||
$name = $module instanceof Module ? $module->name : $module;
|
||||
if (!isset($translations_merged[$name]))
|
||||
if (!isset($translations_merged[$name]) && isset(Context::getContext()->language))
|
||||
{
|
||||
$filesByPriority = array(
|
||||
// Translations in theme
|
||||
|
||||
13
classes/cache/Cache.php
vendored
13
classes/cache/Cache.php
vendored
@@ -205,7 +205,6 @@ abstract class CacheCore
|
||||
foreach ($this->keys as $k => $ttl)
|
||||
if (preg_match('#^'.$pattern.'$#', $k))
|
||||
$keys[] = $k;
|
||||
|
||||
}
|
||||
|
||||
// Delete keys
|
||||
@@ -235,13 +234,13 @@ abstract class CacheCore
|
||||
|
||||
if (is_null($this->sql_tables_cached))
|
||||
{
|
||||
$this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME);
|
||||
$this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME);
|
||||
if (!is_array($this->sql_tables_cached))
|
||||
$this->sql_tables_cached = array();
|
||||
}
|
||||
|
||||
// Store query results in cache if this query is not already cached
|
||||
$key = md5($query);
|
||||
$key = md5(_COOKIE_IV_.$query);
|
||||
if ($this->exists($key))
|
||||
return true;
|
||||
$this->set($key, $result);
|
||||
@@ -251,7 +250,7 @@ abstract class CacheCore
|
||||
foreach ($tables as $table)
|
||||
if (!isset($this->sql_tables_cached[$table][$key]))
|
||||
$this->sql_tables_cached[$table][$key] = true;
|
||||
$this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached);
|
||||
$this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached);
|
||||
}
|
||||
|
||||
protected function getTables($string)
|
||||
@@ -271,7 +270,7 @@ abstract class CacheCore
|
||||
{
|
||||
if (is_null($this->sql_tables_cached))
|
||||
{
|
||||
$this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME);
|
||||
$this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME);
|
||||
if (!is_array($this->sql_tables_cached))
|
||||
$this->sql_tables_cached = array();
|
||||
}
|
||||
@@ -287,7 +286,7 @@ abstract class CacheCore
|
||||
}
|
||||
unset($this->sql_tables_cached[$table]);
|
||||
}
|
||||
$this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached);
|
||||
$this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -326,7 +325,7 @@ abstract class CacheCore
|
||||
|
||||
public static function clean($key)
|
||||
{
|
||||
if (strpos($key, '*'))
|
||||
if (strpos($key, '*') !== false)
|
||||
{
|
||||
$regexp = str_replace('\\*', '.*', preg_quote($key, '#'));
|
||||
foreach (array_keys(Cache::$local) as $key)
|
||||
|
||||
@@ -443,7 +443,8 @@ class AdminControllerCore extends Controller
|
||||
if (isset($_GET) && !empty($_GET) && isset($this->table))
|
||||
foreach ($_GET as $key => $value)
|
||||
if (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0)
|
||||
$this->context->cookie->$key = $value;
|
||||
$this->context->cookie->{$prefix.$key} = $value;
|
||||
|
||||
$filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_');
|
||||
foreach ($filters as $key => $value)
|
||||
{
|
||||
@@ -593,6 +594,7 @@ class AdminControllerCore extends Controller
|
||||
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
'export_precontent' => "\xEF\xBB\xBF",
|
||||
'export_headers' => $headers,
|
||||
'export_content' => $content
|
||||
)
|
||||
@@ -885,11 +887,11 @@ class AdminControllerCore extends Controller
|
||||
if (isset($this->context->cookie->{'submitFilter'.$this->table}))
|
||||
unset($this->context->cookie->{'submitFilter'.$this->table});
|
||||
|
||||
if (isset($this->context->cookie->{$this->table.'Orderby'}))
|
||||
unset($this->context->cookie->{$this->table.'Orderby'});
|
||||
if (isset($this->context->cookie->{$prefix.$this->table.'Orderby'}))
|
||||
unset($this->context->cookie->{$prefix.$this->table.'Orderby'});
|
||||
|
||||
if (isset($this->context->cookie->{$this->table.'Orderway'}))
|
||||
unset($this->context->cookie->{$this->table.'Orderway'});
|
||||
if (isset($this->context->cookie->{$prefix.$this->table.'Orderway'}))
|
||||
unset($this->context->cookie->{$prefix.$this->table.'Orderway'});
|
||||
|
||||
unset($_POST);
|
||||
$this->_filter = false;
|
||||
@@ -2045,11 +2047,11 @@ class AdminControllerCore extends Controller
|
||||
|
||||
if (!Validate::isTableOrIdentifier($this->table))
|
||||
throw new PrestaShopException(sprintf('Table name %s is invalid:', $this->table));
|
||||
|
||||
$prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this)));
|
||||
if (empty($order_by))
|
||||
{
|
||||
if ($this->context->cookie->{$this->table.'Orderby'})
|
||||
$order_by = $this->context->cookie->{$this->table.'Orderby'};
|
||||
if ($this->context->cookie->{$prefix.$this->table.'Orderby'})
|
||||
$order_by = $this->context->cookie->{$prefix.$this->table.'Orderby'};
|
||||
elseif ($this->_orderBy)
|
||||
$order_by = $this->_orderBy;
|
||||
else
|
||||
@@ -2058,8 +2060,8 @@ class AdminControllerCore extends Controller
|
||||
|
||||
if (empty($order_way))
|
||||
{
|
||||
if ($this->context->cookie->{$this->table.'Orderway'})
|
||||
$order_way = $this->context->cookie->{$this->table.'Orderway'};
|
||||
if ($this->context->cookie->{$prefix.$this->table.'Orderway'})
|
||||
$order_way = $this->context->cookie->{$prefix.$this->table.'Orderway'};
|
||||
elseif ($this->_orderWay)
|
||||
$order_way = $this->_orderWay;
|
||||
else
|
||||
@@ -2298,7 +2300,7 @@ class AdminControllerCore extends Controller
|
||||
else
|
||||
{
|
||||
$fieldValue = $this->getFieldValue($obj, $input['name']);
|
||||
if (empty($fieldValue) && isset($input['default_value']))
|
||||
if ($fieldValue === false && isset($input['default_value']))
|
||||
$fieldValue = $input['default_value'];
|
||||
$this->fields_value[$input['name']] = $fieldValue;
|
||||
}
|
||||
@@ -2320,9 +2322,9 @@ class AdminControllerCore extends Controller
|
||||
public function getFieldValue($obj, $key, $id_lang = null)
|
||||
{
|
||||
if ($id_lang)
|
||||
$default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : '';
|
||||
$default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false;
|
||||
else
|
||||
$default_value = isset($obj->{$key}) ? $obj->{$key} : '';
|
||||
$default_value = isset($obj->{$key}) ? $obj->{$key} : false;
|
||||
|
||||
return Tools::getValue($key.($id_lang ? '_'.$id_lang : ''), $default_value);
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ abstract class ControllerCore
|
||||
if ($this->ajax)
|
||||
{
|
||||
$action = Tools::getValue('action');
|
||||
if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action, true)))
|
||||
if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action, true)))
|
||||
$this->{'displayAjax'.$action}();
|
||||
elseif (method_exists($this, 'displayAjax'))
|
||||
$this->displayAjax();
|
||||
|
||||
@@ -398,7 +398,7 @@ class FrontControllerCore extends Controller
|
||||
$this->displayRestrictedCountryPage();
|
||||
|
||||
if (Tools::isSubmit('live_edit') && !$this->checkLiveEditAccess())
|
||||
die(Tools::displayError());
|
||||
Tools::redirect('index.php?controller=404');
|
||||
|
||||
$this->iso = $iso;
|
||||
|
||||
@@ -705,7 +705,7 @@ class FrontControllerCore extends Controller
|
||||
$this->addJS(_THEME_MOBILE_JS_DIR_.'jqm-docs.js');
|
||||
$this->addJS(_PS_JS_DIR_.'tools.js');
|
||||
$this->addJS(_THEME_MOBILE_JS_DIR_.'global.js');
|
||||
$this->addjqueryPlugin('fancybox');
|
||||
$this->addjqueryPlugin('fancybox');
|
||||
|
||||
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'jquery.mobile-1.3.0.min.css', 'all');
|
||||
$this->addCSS(_THEME_MOBILE_CSS_DIR_.'jqm-docs.css', 'all');
|
||||
@@ -721,6 +721,9 @@ class FrontControllerCore extends Controller
|
||||
$this->setMobileMedia();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Tools::file_exists_cache(_PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, _THEME_CSS_DIR_.'grid_prestashop.css')))
|
||||
$this->addCSS(_THEME_CSS_DIR_.'grid_prestashop.css', 'all');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'global.css', 'all');
|
||||
$this->addjquery();
|
||||
$this->addjqueryPlugin('easing');
|
||||
|
||||
@@ -60,7 +60,7 @@ abstract class ModuleCore
|
||||
/** @var int need_instance */
|
||||
public $need_instance = 1;
|
||||
|
||||
/** @var string Admin tab correponding to the module */
|
||||
/** @var string Admin tab corresponding to the module */
|
||||
public $tab = null;
|
||||
|
||||
/** @var boolean Status */
|
||||
@@ -139,8 +139,9 @@ abstract class ModuleCore
|
||||
public function __construct($name = null, Context $context = null)
|
||||
{
|
||||
// Load context and smarty
|
||||
$this->context = $context ? $context : Context::getContext();
|
||||
$this->smarty = $this->context->smarty->createData($this->context->smarty);
|
||||
$this->context = $context ? $context : Context::getContext();
|
||||
if (is_object($this->context->smarty))
|
||||
$this->smarty = $this->context->smarty->createData($this->context->smarty);
|
||||
|
||||
// If the module has no name we gave him its id as name
|
||||
if ($this->name == null)
|
||||
@@ -152,8 +153,9 @@ abstract class ModuleCore
|
||||
// If cache is not generated, we generate it
|
||||
if (self::$modules_cache == null && !is_array(self::$modules_cache))
|
||||
{
|
||||
// Join clause is done to check if the module is activated in current shop context
|
||||
$sql_limit_shop = 'SELECT COUNT(*) FROM `'._DB_PREFIX_.'module_shop` ms WHERE m.`id_module` = ms.`id_module` AND ms.`id_shop` = '.(int)Context::getContext()->shop->id;
|
||||
// Join clause is done to check if the module is activated in current shop context
|
||||
$sql_limit_shop = 'SELECT COUNT(*) FROM `'._DB_PREFIX_.'module_shop` ms WHERE m.`id_module` = ms.`id_module` AND ms.`id_shop` = '.((is_object(Context::getContext()->shop) && $id = (int)Context::getContext()->shop->id) ? $id : 1);
|
||||
|
||||
$sql = 'SELECT m.`id_module`, m.`name`, ('.$sql_limit_shop.') as total FROM `'._DB_PREFIX_.'module` m';
|
||||
|
||||
// Result is cached
|
||||
@@ -1595,7 +1597,7 @@ abstract class ModuleCore
|
||||
{
|
||||
if ($name === null)
|
||||
$name = $this->name;
|
||||
return $name.'|'.(int)$this->context->shop->id.'_'.(int)Group::getCurrent()->id.'_'.(int)$this->context->language->id;
|
||||
return $name.'|'.(int)Tools::usingSecureMode().'|'.(int)$this->context->shop->id.'|'.(int)Group::getCurrent()->id.'|'.(int)$this->context->language->id;
|
||||
}
|
||||
|
||||
public function display($file, $template, $cacheId = null, $compileId = null)
|
||||
|
||||
@@ -175,7 +175,7 @@ class OrderCore extends ObjectModel
|
||||
'current_state' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),
|
||||
'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5'),
|
||||
'payment' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true),
|
||||
'module' => array('type' => self::TYPE_STRING),
|
||||
'module' => array('type' => self::TYPE_STRING, 'validate' => 'isModuleName', 'required' => true),
|
||||
'recyclable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'gift' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'),
|
||||
'gift_message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage'),
|
||||
|
||||
@@ -117,20 +117,30 @@ class OrderHistoryCore extends ObjectModel
|
||||
{
|
||||
$assign[$key]['name'] = $product_download->display_filename;
|
||||
$dl_link = $product_download->getTextLink(false, $virtual_product['download_hash'])
|
||||
.'&id_order='.$order->id
|
||||
.'&id_order='.(int)$order->id
|
||||
.'&secure_key='.$order->secure_key;
|
||||
$assign[$key]['link'] = $dl_link;
|
||||
if ($virtual_product['download_deadline'] != '0000-00-00 00:00:00')
|
||||
$assign[$key]['deadline'] = Tools::displayDate($virtual_product['download_deadline'], $order->id_lang);
|
||||
if ($virtual_product['date_expiration'] != '0000-00-00 00:00:00')
|
||||
$assign[$key]['deadline'] = Tools::displayDate($virtual_product['date_expiration '], $order->id_lang);
|
||||
if ($product_download->nb_downloadable != 0)
|
||||
$assign[$key]['downloadable'] = $product_download->nb_downloadable;
|
||||
$assign[$key]['downloadable'] = (int)$product_download->nb_downloadable;
|
||||
}
|
||||
}
|
||||
|
||||
$customer = new Customer((int)$order->id_customer);
|
||||
$context->smarty->assign('virtualProducts', $assign);
|
||||
$context->smarty->assign('id_order', $order->id);
|
||||
$iso = Language::getIsoById((int)($order->id_lang));
|
||||
$links = $context->smarty->fetch(_PS_MAIL_DIR_.$iso.'/download-product.tpl');
|
||||
|
||||
$links = '<ul>';
|
||||
foreach($assign as $product)
|
||||
{
|
||||
$links .= '<li>';
|
||||
$links .= '<a href="'.$product['link'].'">'.Tools::htmlentitiesUTF8($product['name']).'</a>';
|
||||
if (isset($product['deadline']))
|
||||
$links .= ' '.Tools::htmlentitiesUTF8(Tools::displayError('expires on')).' '.$product['deadline'];
|
||||
if (isset($product['downloadable']))
|
||||
$links .= ' '.Tools::htmlentitiesUTF8(sprintf(Tools::displayError('downloadable %d time(s)'), (int)$product['downloadable']));
|
||||
$links .= '</li>';
|
||||
}
|
||||
$links .= '<ul>';
|
||||
$data = array(
|
||||
'{lastname}' => $customer->lastname,
|
||||
'{firstname}' => $customer->firstname,
|
||||
|
||||
@@ -384,21 +384,22 @@ class OrderInvoiceCore extends ObjectModel
|
||||
*/
|
||||
public function getEcoTaxTaxesBreakdown()
|
||||
{
|
||||
$res = Db::getInstance()->executeS('
|
||||
$result = Db::getInstance()->executeS('
|
||||
SELECT `ecotax_tax_rate` as `rate`, SUM(`ecotax` * `product_quantity`) as `ecotax_tax_excl`, SUM(`ecotax` * `product_quantity`) as `ecotax_tax_incl`
|
||||
FROM `'._DB_PREFIX_.'order_detail`
|
||||
WHERE `id_order` = '.(int)$this->id_order.'
|
||||
AND `id_order_invoice` = '.(int)$this->id.'
|
||||
GROUP BY `ecotax_tax_rate`'
|
||||
);
|
||||
GROUP BY `ecotax_tax_rate`');
|
||||
|
||||
if ($res)
|
||||
foreach ($res as &$row)
|
||||
$taxes = array();
|
||||
foreach ($result as $row)
|
||||
if ($row['ecotax_tax_excl'] > 0)
|
||||
{
|
||||
$row['ecotax_tax_incl'] = Tools::ps_round($row['ecotax_tax_excl'] + ($row['ecotax_tax_excl'] * $row['rate'] / 100), 2);
|
||||
$row['ecotax_tax_excl'] = Tools::ps_round($row['ecotax_tax_excl'], 2);
|
||||
$taxes[] = $row;
|
||||
}
|
||||
return $res;
|
||||
return $taxes;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -308,7 +308,7 @@ class ShopCore extends ObjectModel
|
||||
WHERE (su.domain = \''.$host.'\' OR su.domain_ssl = \''.$host.'\')
|
||||
AND s.active = 1
|
||||
AND s.deleted = 0
|
||||
ORDER BY LENGTH(uri) DESC';
|
||||
ORDER BY LENGTH(CONCAT(su.physical_uri, su.virtual_uri)) DESC';
|
||||
|
||||
$id_shop = '';
|
||||
$found_uri = '';
|
||||
|
||||
@@ -33,7 +33,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
/**
|
||||
* @var string The extension of the image to display
|
||||
*/
|
||||
protected $imgExtension = 'jpg';
|
||||
protected $imgExtension;
|
||||
|
||||
/**
|
||||
* @var array The type of images (general, categories, manufacturers, suppliers, stores...)
|
||||
@@ -119,10 +119,18 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage
|
||||
// display image content if needed
|
||||
else if ($this->imgToDisplay)
|
||||
{
|
||||
if(empty($this->imgExtension)){
|
||||
$imginfo = getimagesize($this->imgToDisplay);
|
||||
$this->imgExtension = image_type_to_extension($imginfo[2],false);
|
||||
}
|
||||
|
||||
$imageResource = false;
|
||||
$types = array('jpg' => array('function' => 'imagecreatefromjpeg', 'Content-Type' => 'image/jpeg'),
|
||||
'gif' => array('function' => 'imagecreatefromgif', 'Content-Type' => 'image/gif')
|
||||
);
|
||||
$types = array(
|
||||
'jpg' => array('function' => 'imagecreatefromjpeg', 'Content-Type' => 'image/jpeg'),
|
||||
'jpeg' => array('function' => 'imagecreatefromjpeg', 'Content-Type' => 'image/jpeg'),
|
||||
'png' => array('function' => 'imagecreatefrompng', 'Content-Type' => 'image/png'),
|
||||
'gif' => array('function' => 'imagecreatefromgif', 'Content-Type' => 'image/gif')
|
||||
);
|
||||
|
||||
if (array_key_exists($this->imgExtension, $types))
|
||||
$imageResource = @$types[$this->imgExtension]['function']($this->imgToDisplay);
|
||||
|
||||
@@ -71,11 +71,11 @@ define('_THEME_LANG_DIR_', _PS_IMG_.'l/');
|
||||
define('_THEME_COL_DIR_', _PS_IMG_.'co/');
|
||||
define('_THEME_GENDERS_DIR_', _PS_IMG_.'genders/');
|
||||
define('_SUPP_DIR_', _PS_IMG_.'su/');
|
||||
define('_PS_PROD_IMG_', 'img/p/');
|
||||
define('_PS_PROD_IMG_', _PS_IMG_.'p/');
|
||||
|
||||
/* Other URLs */
|
||||
define('_PS_JS_DIR_', __PS_BASE_URI__.'js/');
|
||||
define('_PS_CSS_DIR_', __PS_BASE_URI__.'css/');
|
||||
define('_THEME_PROD_PIC_DIR_', __PS_BASE_URI__.'upload/');
|
||||
define('_MAIL_DIR_', __PS_BASE_URI__.'mails/');
|
||||
define('_MODULE_DIR_', __PS_BASE_URI__.'modules/');
|
||||
define('_MODULE_DIR_', __PS_BASE_URI__.'modules/');
|
||||
|
||||
@@ -32,6 +32,8 @@ global $smarty;
|
||||
$smarty = new Smarty();
|
||||
$smarty->setCompileDir(_PS_CACHE_DIR_.'smarty/compile');
|
||||
$smarty->setCacheDir(_PS_CACHE_DIR_.'smarty/cache');
|
||||
if (!Tools::getSafeModeStatus())
|
||||
$smarty->use_sub_dirs = true;
|
||||
$smarty->setConfigDir(_PS_SMARTY_DIR_.'configs');
|
||||
$smarty->caching = false;
|
||||
$smarty->force_compile = (Configuration::get('PS_SMARTY_FORCE_COMPILE') == _PS_SMARTY_FORCE_COMPILE_) ? true : false;
|
||||
|
||||
@@ -101,15 +101,15 @@ class AdminCartsControllerCore extends AdminController
|
||||
{
|
||||
if (!($cart = $this->loadObject(true)))
|
||||
return;
|
||||
|
||||
$customer = new Customer($cart->id_customer);
|
||||
$currency = new Currency($cart->id_currency);
|
||||
$this->context->cart = $cart;
|
||||
$this->context->currency = $currency;
|
||||
$this->context->customer = $customer;
|
||||
$products = $cart->getProducts();
|
||||
$customized_datas = Product::getAllCustomizedDatas((int)$cart->id);
|
||||
Product::addCustomizationPrice($products, $customized_datas);
|
||||
$summary = $cart->getSummaryDetails();
|
||||
$currency = new Currency($cart->id_currency);
|
||||
|
||||
/* Display order information */
|
||||
$id_order = (int)Order::getOrderByCartId($cart->id);
|
||||
@@ -739,6 +739,7 @@ class AdminCartsControllerCore extends AdminController
|
||||
{
|
||||
$context = Context::getContext();
|
||||
$context->cart = new Cart($id_cart);
|
||||
$context->currency = new Currency((int)$context->cart->id_currency);
|
||||
$context->customer = new Customer((int)$context->cart->id_customer);
|
||||
return Cart::getTotalCart($id_cart, true, Cart::BOTH_WITHOUT_SHIPPING);
|
||||
}
|
||||
|
||||
@@ -542,9 +542,14 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
{
|
||||
$id_category = (int)Tools::getValue('id_category');
|
||||
$id_parent = (int)Tools::getValue('id_parent');
|
||||
|
||||
// if true, we are in a root category creation
|
||||
if (!$id_parent && !Tools::isSubmit('is_root_category'))
|
||||
$_POST['is_root_category'] = $_POST['level_depth'] = $_POST['id_parent'] = $id_parent = 1;
|
||||
{
|
||||
$_POST['is_root_category'] = $_POST['level_depth'] = 1;
|
||||
$_POST['id_parent'] = $id_parent = (int)Configuration::get('PS_ROOT_CATEGORY');
|
||||
}
|
||||
|
||||
if ($id_category)
|
||||
{
|
||||
if ($id_category != $id_parent)
|
||||
|
||||
@@ -219,22 +219,12 @@ class AdminCmsControllerCore extends AdminController
|
||||
/* Close list table and submit button */
|
||||
$this->displayListFooter($token);
|
||||
}
|
||||
|
||||
/**
|
||||
* Modifying initial getList method to display position feature (drag and drop)
|
||||
*/
|
||||
public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false)
|
||||
{
|
||||
if ($order_by && $this->context->cookie->__get($this->table.'Orderby'))
|
||||
$order_by = $this->context->cookie->__get($this->table.'Orderby');
|
||||
else
|
||||
$order_by = 'position';
|
||||
|
||||
parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop);
|
||||
}
|
||||
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit($this->table.'Orderby') || Tools::isSubmit($this->table.'Orderway'))
|
||||
$this->filter = true;
|
||||
|
||||
if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms))
|
||||
{
|
||||
$redir = $this->context->link->getCMSLink($cms);
|
||||
|
||||
@@ -442,7 +442,7 @@ class AdminCountriesControllerCore extends AdminController
|
||||
$html .= '<li>
|
||||
<a href="javascript:void(0);" onClick="displayAvailableFields(\''.$class_name.'\')">'.$class_name.'</a>';
|
||||
foreach (AddressFormat::getValidateFields($class_name) as $name)
|
||||
$fields[] = '<a style="color:#4B8;" href="javascript:void(0);" class="addPattern" '.$name.' id="'.($class_name == 'Address' ? $name : $class_name.':'.$name).'">
|
||||
$fields[] = '<a style="color:#4B8;" href="javascript:void(0);" class="addPattern" id="'.($class_name == 'Address' ? $name : $class_name.':'.$name).'">
|
||||
'.$name.'</a>';
|
||||
$html .= '
|
||||
<div class="availableFieldsList" id="availableListFieldsFor_'.$class_name.'" style="width:300px;">
|
||||
|
||||
@@ -458,7 +458,7 @@ class AdminCustomerThreadsControllerCore extends AdminController
|
||||
|
||||
$extension = false;
|
||||
foreach ($extensions as $key => $val)
|
||||
if (substr($filename, -4) == $key || substr($filename, -5) == $key)
|
||||
if (substr(Tools::strtolower($filename), -4) == $key || substr(Tools::strtolower($filename), -5) == $key)
|
||||
{
|
||||
$extension = $val;
|
||||
break;
|
||||
|
||||
@@ -227,7 +227,7 @@ class AdminEmployeesControllerCore extends AdminController
|
||||
'name' => 'id_lang',
|
||||
'required' => true,
|
||||
'options' => array(
|
||||
'query' => Language::getLanguages(),
|
||||
'query' => Language::getLanguages(false),
|
||||
'id' => 'id_lang',
|
||||
'name' => 'name'
|
||||
)
|
||||
|
||||
@@ -28,6 +28,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
{
|
||||
protected $start_time = 0;
|
||||
protected $max_execution_time = 7200;
|
||||
protected $display_move;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@@ -50,6 +51,9 @@ class AdminImagesControllerCore extends AdminController
|
||||
'scenes' => array('title' => $this->l('Scenes'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false),
|
||||
'stores' => array('title' => $this->l('Stores'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false)
|
||||
);
|
||||
|
||||
// No need to display the old image system if the install has been made later than 2013-03-26
|
||||
$this->display_move = (defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true;
|
||||
|
||||
$this->fields_options = array(
|
||||
'images' => array(
|
||||
@@ -141,20 +145,22 @@ class AdminImagesControllerCore extends AdminController
|
||||
'type' => 'text',
|
||||
'height' => 'px',
|
||||
'visibility' => Shop::CONTEXT_ALL
|
||||
),
|
||||
'PS_LEGACY_IMAGES' => array(
|
||||
'title' => $this->l('Use the legacy image filesystem'),
|
||||
'desc' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'required' => false,
|
||||
'type' => 'bool',
|
||||
'visibility' => Shop::CONTEXT_ALL
|
||||
),
|
||||
)
|
||||
),
|
||||
'submit' => array('title' => $this->l('Save '), 'class' => 'button'),
|
||||
),
|
||||
);
|
||||
|
||||
if ($this->display_move)
|
||||
$this->fields_options['product_images']['fields']['PS_LEGACY_IMAGES'] = array(
|
||||
'title' => $this->l('Use the legacy image filesystem'),
|
||||
'desc' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'required' => false,
|
||||
'type' => 'bool',
|
||||
'visibility' => Shop::CONTEXT_ALL
|
||||
);
|
||||
|
||||
$this->fields_form = array(
|
||||
'legend' => array(
|
||||
@@ -670,7 +676,7 @@ class AdminImagesControllerCore extends AdminController
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'display_regenerate' => true,
|
||||
'display_move' => true
|
||||
'display_move' => $this->display_move
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
@@ -70,18 +70,23 @@ class AdminLoginControllerCore extends AdminController
|
||||
|
||||
if (file_exists(_PS_ADMIN_DIR_.'/../install'))
|
||||
$this->context->smarty->assign('wrong_install_name', true);
|
||||
if (file_exists(_PS_ADMIN_DIR_.'/../admin'))
|
||||
|
||||
if (basename(_PS_ADMIN_DIR_) == 'admin' && file_exists(_PS_ADMIN_DIR_.'/../admin/'))
|
||||
{
|
||||
$rand = sprintf('%04d', rand(0, 9999));
|
||||
if (@rename(_PS_ADMIN_DIR_.'/../admin', _PS_ADMIN_DIR_.'/../admin'.$rand))
|
||||
Tools::redirectAdmin('../admin'.$rand);
|
||||
$rand = 'admin'.sprintf('%04d', rand(0, 9999)).'/';
|
||||
if (@rename(_PS_ADMIN_DIR_.'/../admin/', _PS_ADMIN_DIR_.'/../'.$rand))
|
||||
Tools::redirectAdmin('../'.$rand);
|
||||
else
|
||||
$this->context->smarty->assign(array(
|
||||
'wrong_folder_name' => true
|
||||
));
|
||||
}
|
||||
else
|
||||
$rand = basename(_PS_ADMIN_DIR_).'/';
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'randomNb' => rand(0, 9999)
|
||||
'randomNb' => $rand,
|
||||
'adminUrl' => Tools::getCurrentUrlProtocolPrefix().Tools::getShopDomain().__PS_BASE_URI__.$rand
|
||||
));
|
||||
|
||||
// Redirect to admin panel
|
||||
|
||||
@@ -66,7 +66,7 @@ class AdminMetaControllerCore extends AdminController
|
||||
),
|
||||
'PS_ALLOW_ACCENTED_CHARS_URL' => array(
|
||||
'title' => $this->l('Accented URL'),
|
||||
'desc' => $this->l('Enable if you want to allow accented characters in your friendly URLs.'),
|
||||
'desc' => $this->l('Enable if you want to allow accented characters in your friendly URLs.').' '.$this->l('You should only activate this option if you are using non-latin characters ; for all the latin charsets, your SEO will be better without this option.'),
|
||||
'validation' => 'isBool',
|
||||
'cast' => 'intval',
|
||||
'type' => 'bool'
|
||||
|
||||
@@ -391,6 +391,8 @@ class AdminModulesControllerCore extends AdminController
|
||||
$this->recursiveDeleteOnDisk($tmp_folder);
|
||||
if ($success && $redirect)
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=8&anchor=anchor'.ucfirst($folder).'&token='.$this->token);
|
||||
|
||||
return $success;
|
||||
}
|
||||
|
||||
protected function recursiveDeleteOnDisk($dir)
|
||||
@@ -600,25 +602,14 @@ class AdminModulesControllerCore extends AdminController
|
||||
foreach ($modules as $name)
|
||||
{
|
||||
$full_report = null;
|
||||
if ($key == 'update')
|
||||
{
|
||||
if (ConfigurationTest::test_dir('modules/'.$name, true, $full_report))
|
||||
Tools::deleteDirectory('../modules/'.$name.'/');
|
||||
else
|
||||
{
|
||||
$module = Module::getInstanceByName(urldecode($name));
|
||||
$this->errors[] = $this->l(sprintf("Module %s can't be upgraded : ", $module->displayName)).$full_report;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// If Addons module, download and unzip it before installing it
|
||||
if (!file_exists('../modules/'.$name.'/'.$name.'.php'))
|
||||
if (!file_exists('../modules/'.$name.'/'.$name.'.php') || $key == 'update')
|
||||
{
|
||||
$filesList = array(
|
||||
array('type' => 'addonsNative', 'file' => Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 'loggedOnAddons' => 0),
|
||||
array('type' => 'addonsBought', 'file' => Module::CACHE_FILE_CUSTOMER_MODULES_LIST, 'loggedOnAddons' => 1),
|
||||
);
|
||||
|
||||
foreach ($filesList as $f)
|
||||
if (file_exists(_PS_ROOT_DIR_.$f['file']))
|
||||
{
|
||||
@@ -628,12 +619,19 @@ class AdminModulesControllerCore extends AdminController
|
||||
foreach ($xml->module as $modaddons)
|
||||
if ($name == $modaddons->name && isset($modaddons->id) && ($this->logged_on_addons || $f['loggedOnAddons'] == 0))
|
||||
{
|
||||
$download_ok = false;
|
||||
if ($f['loggedOnAddons'] == 0)
|
||||
if (file_put_contents('../modules/'.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id)))))
|
||||
$this->extractArchive('../modules/'.$modaddons->name.'.zip', false);
|
||||
if ($f['loggedOnAddons'] == 1 && $this->logged_on_addons)
|
||||
if (file_put_contents('../modules/'.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons))))))
|
||||
$this->extractArchive('../modules/'.$modaddons->name.'.zip', false);
|
||||
if (file_put_contents(_PS_MODULE_DIR_.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id)))))
|
||||
$download_ok = true;
|
||||
elseif ($f['loggedOnAddons'] == 1 && $this->logged_on_addons)
|
||||
if (file_put_contents(_PS_MODULE_DIR_.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons))))))
|
||||
$download_ok = true;
|
||||
|
||||
if (!$download_ok)
|
||||
$this->errors[] = $this->l('Error on downloading the lastest version');
|
||||
else
|
||||
if(!$this->extractArchive(_PS_MODULE_DIR_.$modaddons->name.'.zip', false))
|
||||
$this->errors[] = $this->l(sprintf("Module %s can't be upgraded: ", $modaddons->name));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1005,6 +1003,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
$this->nb_modules_total = count($modules);
|
||||
$module_errors = array();
|
||||
$module_success = array();
|
||||
$upgrade_available = array();
|
||||
|
||||
// Browse modules list
|
||||
foreach ($modules as $km => $module)
|
||||
@@ -1015,7 +1014,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
unset($modules[$km]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Upgrade Module process, init check if a module could be upgraded
|
||||
if (Module::initUpgradeModule($module))
|
||||
{
|
||||
@@ -1085,6 +1084,8 @@ class AdminModulesControllerCore extends AdminController
|
||||
$modules[$km]->preferences = $modules_preferences[$modules[$km]->name];
|
||||
}
|
||||
unset($object);
|
||||
if (isset($module->version_addons))
|
||||
$upgrade_available[] = array('anchor' => ucfirst($module->name), 'name' => $module->displayName);;
|
||||
}
|
||||
|
||||
// Don't display categories without modules
|
||||
@@ -1109,6 +1110,7 @@ class AdminModulesControllerCore extends AdminController
|
||||
$tpl_vars = array();
|
||||
|
||||
$tpl_vars['token'] = $this->token;
|
||||
$tpl_vars['upgrade_available'] = $upgrade_available;
|
||||
$tpl_vars['currentIndex'] = self::$currentIndex;
|
||||
$tpl_vars['dirNameCurrentIndex'] = dirname(self::$currentIndex);
|
||||
$tpl_vars['ajaxCurrentIndex'] = str_replace('index', 'ajax-tab', self::$currentIndex);
|
||||
|
||||
@@ -303,7 +303,7 @@ class AdminModulesPositionsControllerCore extends AdminController
|
||||
{
|
||||
$url = $this->context->shop->getBaseURL().Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params);
|
||||
if (Configuration::get('PS_REWRITING_SETTINGS'))
|
||||
$url = str_replace('index.php', Language::getIsoById($this->context->employee->id_lang).'/', $url);
|
||||
$url = str_replace('index.php', ((count(Language::getLanguages(true)) > 1)? Language::getIsoById($this->context->employee->id_lang).'/' : ''), $url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
||||
@@ -568,9 +568,9 @@ class AdminOrdersControllerCore extends AdminController
|
||||
{
|
||||
if ($this->tabAccess['delete'] === '1')
|
||||
{
|
||||
if (!Tools::isSubmit('id_order_detail'))
|
||||
if (!Tools::isSubmit('id_order_detail') && !Tools::isSubmit('id_customization'))
|
||||
$this->errors[] = Tools::displayError('You must select a product.');
|
||||
elseif (!Tools::isSubmit('cancelQuantity'))
|
||||
elseif (!Tools::isSubmit('cancelQuantity') && !Tools::isSubmit('cancelCustomizationQuantity'))
|
||||
$this->errors[] = Tools::displayError('You must enter a quantity.');
|
||||
else
|
||||
{
|
||||
@@ -597,7 +597,8 @@ class AdminOrdersControllerCore extends AdminController
|
||||
foreach ($customizationList as $key => $id_order_detail)
|
||||
{
|
||||
$full_product_list[(int)$id_order_detail] = $id_order_detail;
|
||||
$full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key];
|
||||
if (isset($customizationQtyList[$key]))
|
||||
$full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key];
|
||||
}
|
||||
|
||||
if ($productList || $customizationList)
|
||||
|
||||
@@ -223,7 +223,7 @@ class AdminPPreferencesControllerCore extends AdminController
|
||||
|
||||
public function beforeUpdateOptions()
|
||||
{
|
||||
if (!Tools::getValue('PS_STOCK_MANAGEMENT'))
|
||||
if (!Tools::getValue('PS_STOCK_MANAGEMENT', true))
|
||||
{
|
||||
$_POST['PS_ORDER_OUT_OF_STOCK'] = 1;
|
||||
$_POST['PS_DISPLAY_QTIES'] = 0;
|
||||
|
||||
@@ -26,6 +26,13 @@
|
||||
|
||||
class AdminPerformanceControllerCore extends AdminController
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->className = 'Configuration';
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function initFieldsetSmarty()
|
||||
{
|
||||
$this->fields_form[0]['form'] = array(
|
||||
@@ -541,6 +548,7 @@ class AdminPerformanceControllerCore extends AdminController
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
|
||||
/* PrestaShop demo mode */
|
||||
if (_PS_MODE_DEMO_)
|
||||
{
|
||||
@@ -617,6 +625,9 @@ class AdminPerformanceControllerCore extends AdminController
|
||||
{
|
||||
if ($this->tabAccess['edit'] === '1')
|
||||
{
|
||||
$theme_cache_directory = _PS_ALL_THEMES_DIR_.$this->context->shop->theme_directory.'/cache/';
|
||||
if (((bool)Tools::getValue('PS_CSS_THEME_CACHE') || (bool)Tools::getValue('PS_JS_THEME_CACHE')) && !is_writable($theme_cache_directory))
|
||||
$this->errors[] = Tools::displayError(sprintf($this->l('To use Smart Cache directory %s must be writable.'), realpath($theme_cache_directory)));
|
||||
if (!Configuration::updateValue('PS_CSS_THEME_CACHE', (int)Tools::getValue('PS_CSS_THEME_CACHE')) ||
|
||||
!Configuration::updateValue('PS_JS_THEME_CACHE', (int)Tools::getValue('PS_JS_THEME_CACHE')) ||
|
||||
!Configuration::updateValue('PS_HTML_THEME_COMPRESSION', (int)Tools::getValue('PS_HTML_THEME_COMPRESSION')) ||
|
||||
@@ -665,9 +676,8 @@ class AdminPerformanceControllerCore extends AdminController
|
||||
else
|
||||
$this->errors[] = Tools::displayError('You do not have permission to edit this.');
|
||||
}
|
||||
|
||||
if ((bool)Tools::getValue('ciphering_up') && Configuration::get('PS_CIPHER_ALGORITHM') != (int)Tools::getValue('PS_CIPHER_ALGORITHM'))
|
||||
{
|
||||
{
|
||||
if ($this->tabAccess['edit'] === '1')
|
||||
{
|
||||
$algo = (int)Tools::getValue('PS_CIPHER_ALGORITHM');
|
||||
@@ -793,8 +803,6 @@ class AdminPerformanceControllerCore extends AdminController
|
||||
Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => ''));
|
||||
Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4');
|
||||
}
|
||||
else
|
||||
return parent::postProcess();
|
||||
}
|
||||
|
||||
public function ajaxProcess()
|
||||
|
||||
@@ -193,7 +193,7 @@ class AdminProductsControllerCore extends AdminController
|
||||
$this->_join .= ($join_category ? 'INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.')' : '').'
|
||||
LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0
|
||||
'.StockAvailable::addSqlShopRestriction(null, null, 'sav').') ';
|
||||
$this->_select .= 'cl.name `name_category` '.($join_category ? ', cp.`position`' : '').', '.$alias_image.'.`id_image`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`';
|
||||
$this->_select .= 'cl.name `name_category` '.($join_category ? ', cp.`position`' : '').', '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`';
|
||||
|
||||
$this->_group = 'GROUP BY '.$alias.'.id_product';
|
||||
|
||||
|
||||
@@ -206,7 +206,7 @@ class AdminScenesControllerCore extends AdminController
|
||||
$this->addJqueryPlugin('autocomplete');
|
||||
$this->addJqueryPlugin('imgareaselect');
|
||||
$this->addJs(_PS_JS_DIR_.'admin-scene-cropping.js' );
|
||||
$image_to_map_desc .= '<br /><img id="large_scene_image" style="clear:both;border:1px solid black;" alt="" src="'.
|
||||
$image_to_map_desc .= '<br /><img id="large_scene_image" alt="" src="'.
|
||||
_THEME_SCENE_DIR_.$obj->id.'-scene_default.jpg" /><br />';
|
||||
|
||||
$image_to_map_desc .= '
|
||||
|
||||
@@ -52,9 +52,6 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
/** @var array : List of theme by translation type : FRONT, BACK, ERRORS... */
|
||||
protected $translations_informations = array();
|
||||
|
||||
/** @var array : List of theme by translation type : FRONT, BACK, ERRORS... */
|
||||
protected $translations_type_for_theme = array('front', 'modules', 'pdf', 'mails');
|
||||
|
||||
/** @var array : List of all languages */
|
||||
protected $languages;
|
||||
|
||||
@@ -199,7 +196,6 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
'token' => $this->token,
|
||||
'languages' => $this->languages,
|
||||
'translations_type' => $this->translations_informations,
|
||||
'translations_type_for_theme' => $this->translations_type_for_theme,
|
||||
'packs_to_install' => $packs_to_install,
|
||||
'packs_to_update' => $packs_to_update,
|
||||
'url_submit' => self::$currentIndex.'&token='.$this->token,
|
||||
@@ -586,7 +582,6 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
{
|
||||
// Get instance of this tab by class name
|
||||
$tab = Tab::getInstanceFromClassName($class_name);
|
||||
|
||||
//Check if class name exists
|
||||
if (isset($tab->class_name) && !empty($tab->class_name))
|
||||
{
|
||||
@@ -687,6 +682,9 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
if (pathinfo($file2check['filename'], PATHINFO_BASENAME) == 'index.php' && file_put_contents(_PS_TRANSLATIONS_DIR_.'../'.$file2check['filename'], Tools::getDefaultIndexContent()))
|
||||
continue;
|
||||
|
||||
// Clear smarty modules cache
|
||||
Tools::clearCache();
|
||||
|
||||
if (Validate::isLanguageFileName($filename))
|
||||
{
|
||||
if (!Language::checkAndAddLanguage($iso_code))
|
||||
@@ -736,13 +734,14 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$this->errors[] = Tools::displayError('The archive cannot be extracted.'). ' '.$error->message;
|
||||
else
|
||||
{
|
||||
|
||||
if (!Language::checkAndAddLanguage($arr_import_lang[0]))
|
||||
$conf = 20;
|
||||
else
|
||||
{
|
||||
// Reset cache
|
||||
Language::loadLanguages();
|
||||
// Clear smarty modules cache
|
||||
Tools::clearCache();
|
||||
|
||||
AdminTranslationsController::checkAndAddMailsFiles($arr_import_lang[0], $files_list);
|
||||
if ($tab_errors = AdminTranslationsController::addNewTabs($arr_import_lang[0], $files_list))
|
||||
@@ -758,7 +757,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$this->errors[] = sprintf(Tools::displayError('Cannot delete the archive %s.'), $file);
|
||||
}
|
||||
else
|
||||
$this->errors[] = Tools::displayError('The server does not have permissions for writing.'. ' '.sprintf(Tools::displayError('Please check rights for %s'), dirname($file)));
|
||||
$this->errors[] = Tools::displayError('The server does not have permissions for writing.').' '.sprintf(Tools::displayError('Please check rights for %s'), dirname($file));
|
||||
}
|
||||
else
|
||||
$this->errors[] = Tools::displayError('Language not found.');
|
||||
@@ -785,14 +784,13 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
static $str_write = '';
|
||||
static $array_check_duplicate = array();
|
||||
|
||||
// Default translations and Prestashop overriding themes are distinguish
|
||||
$is_default = $theme_name === self::DEFAULT_THEME_NAME ? true : false;
|
||||
|
||||
// Set file_name in static var, this allow to open and wright the file just one time
|
||||
if (!isset($cache_file[$theme_name.'-'.$file_name]))
|
||||
{
|
||||
$str_write = '';
|
||||
$cache_file[$theme_name.'-'.$file_name] = true;
|
||||
if (!Tools::file_exists_cache(dirname($file_name)))
|
||||
mkdir(dirname($file_name), 0777, true);
|
||||
if (!Tools::file_exists_cache($file_name))
|
||||
file_put_contents($file_name, '');
|
||||
if (!is_writable($file_name))
|
||||
@@ -808,10 +806,10 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
|
||||
foreach ($files as $file)
|
||||
{
|
||||
if (preg_match('/^(.*).(tpl|php)$/', $file) && Tools::file_exists_cache($file_path = $dir.$file) && !in_array($file, self::$ignore_folder))
|
||||
if (preg_match('/^(.*).(tpl|php)$/', $file) && Tools::file_exists_cache($dir.$file) && !in_array($file, self::$ignore_folder))
|
||||
{
|
||||
// Get content for this file
|
||||
$content = file_get_contents($file_path);
|
||||
$content = file_get_contents($dir.$file);
|
||||
|
||||
// Get file type
|
||||
$type_file = substr($file, -4) == '.tpl' ? 'tpl' : 'php';
|
||||
@@ -824,16 +822,16 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
|
||||
foreach ($matches as $key)
|
||||
{
|
||||
if ($is_default)
|
||||
{
|
||||
$post_key = md5(strtolower($module_name).'_'.self::DEFAULT_THEME_NAME.'_'.strtolower($template_name).'_'.md5($key));
|
||||
$pattern = '\'<{'.strtolower($module_name).'}prestashop>'.strtolower($template_name).'_'.md5($key).'\'';
|
||||
}
|
||||
else
|
||||
if ($theme_name)
|
||||
{
|
||||
$post_key = md5(strtolower($module_name).'_'.strtolower($theme_name).'_'.strtolower($template_name).'_'.md5($key));
|
||||
$pattern = '\'<{'.strtolower($module_name).'}'.strtolower($theme_name).'>'.strtolower($template_name).'_'.md5($key).'\'';
|
||||
}
|
||||
else
|
||||
{
|
||||
$post_key = md5(strtolower($module_name).'_'.strtolower($template_name).'_'.md5($key));
|
||||
$pattern = '\'<{'.strtolower($module_name).'}prestashop>'.strtolower($template_name).'_'.md5($key).'\'';
|
||||
}
|
||||
|
||||
if (array_key_exists($post_key, $_POST) && !empty($_POST[$post_key]) && !in_array($pattern, $array_check_duplicate))
|
||||
{
|
||||
@@ -897,9 +895,6 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
// added for compatibility
|
||||
$GLOBALS[$name_var] = array_change_key_case($GLOBALS[$name_var]);
|
||||
|
||||
// Default translations and Prestashop overriding themes are distinguish
|
||||
$is_default = $theme_name === self::DEFAULT_THEME_NAME ? true : false;
|
||||
|
||||
// Thank to this var similar keys are not duplicate
|
||||
// in AndminTranslation::modules_translations array
|
||||
// see below
|
||||
@@ -926,19 +921,22 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
|
||||
foreach ($matches as $key)
|
||||
{
|
||||
$module_key = '<{'.Tools::strtolower($module_name).'}'.
|
||||
strtolower($is_default ? 'prestashop' : $theme_name).'>'.Tools::strtolower($template_name).'_'.md5($key);
|
||||
$md5_key = md5($key);
|
||||
$module_key = '<{'.Tools::strtolower($module_name).'}'.strtolower($theme_name).'>'.Tools::strtolower($template_name).'_'.$md5_key;
|
||||
$default_key = '<{'.Tools::strtolower($module_name).'}prestashop>'.Tools::strtolower($template_name).'_'.$md5_key;
|
||||
// to avoid duplicate entry
|
||||
if (!in_array($module_key, $array_check_duplicate))
|
||||
{
|
||||
$array_check_duplicate[] = $module_key;
|
||||
if (!isset($this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad']))
|
||||
$this->total_expression++;
|
||||
|
||||
if (array_key_exists($module_key, $GLOBALS[$name_var]))
|
||||
if ($theme_name && array_key_exists($module_key, $GLOBALS[$name_var]))
|
||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$module_key], ENT_COMPAT, 'UTF-8');
|
||||
elseif (array_key_exists($default_key, $GLOBALS[$name_var]))
|
||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$default_key], ENT_COMPAT, 'UTF-8');
|
||||
else
|
||||
{
|
||||
//d(array($module_key, $default_key, $key, $GLOBALS[$name_var]));
|
||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = '';
|
||||
$this->missing_translations++;
|
||||
}
|
||||
@@ -1125,7 +1123,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
'front' => array(
|
||||
'name' => $this->l('Front Office translations'),
|
||||
'var' => '_LANG',
|
||||
'dir' => _PS_THEME_SELECTED_DIR_.'lang/',
|
||||
'dir' => defined('_PS_THEME_SELECTED_DIR_') ? _PS_THEME_SELECTED_DIR_.'lang/' : '',
|
||||
'file' => $this->lang_selected->iso_code.'.php'
|
||||
),
|
||||
'back' => array(
|
||||
@@ -1150,33 +1148,28 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
'name' => $this->l('Installed modules translations'),
|
||||
'var' => '_MODULES',
|
||||
'dir' => _PS_MODULE_DIR_,
|
||||
'file' => '',
|
||||
'override' => array(
|
||||
'dir' => _PS_THEME_SELECTED_DIR_.'modules/',
|
||||
'file' => ''
|
||||
)
|
||||
'file' => ''
|
||||
),
|
||||
'pdf' => array(
|
||||
'name' => $this->l('PDF translations'),
|
||||
'var' => '_LANGPDF',
|
||||
'dir' => _PS_TRANSLATIONS_DIR_.$this->lang_selected->iso_code.'/',
|
||||
'file' => 'pdf.php',
|
||||
'override' => array(
|
||||
'dir' => _PS_THEME_SELECTED_DIR_.'pdf/lang/',
|
||||
'file' => $this->lang_selected->iso_code.'.php'
|
||||
)
|
||||
'file' => 'pdf.php'
|
||||
),
|
||||
'mails' => array(
|
||||
'name' => $this->l('Email templates translations'),
|
||||
'var' => '_LANGMAIL',
|
||||
'dir' => _PS_MAIL_DIR_.$this->lang_selected->iso_code.'/',
|
||||
'file' => 'lang.php',
|
||||
'override' => array(
|
||||
'dir' => _PS_THEME_SELECTED_DIR_.'mails/'.$this->lang_selected->iso_code.'/',
|
||||
'file' => 'lang.php'
|
||||
)
|
||||
'file' => 'lang.php'
|
||||
)
|
||||
);
|
||||
|
||||
if (defined('_PS_THEME_SELECTED_DIR_'))
|
||||
{
|
||||
$this->translations_informations['modules']['override'] = array('dir' => _PS_THEME_SELECTED_DIR_.'modules/', 'file' => '');
|
||||
$this->translations_informations['pdf']['override'] = array('dir' => _PS_THEME_SELECTED_DIR_.'pdf/lang/', 'file' => $this->lang_selected->iso_code.'.php');
|
||||
$this->translations_informations['mails']['override'] = array('dir' => _PS_THEME_SELECTED_DIR_.'mails/'.$this->lang_selected->iso_code.'/', 'file' => 'lang.php');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1197,20 +1190,15 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
// Get folder name of theme
|
||||
if (($theme = Tools::getValue('theme')) && !is_array($theme))
|
||||
{
|
||||
$theme_exists = false;
|
||||
foreach ($this->themes as $existing_theme)
|
||||
if ($existing_theme->directory == $theme)
|
||||
$theme_exists = true;
|
||||
if ($theme_exists)
|
||||
$this->theme_selected = Tools::safeOutput($theme);
|
||||
else
|
||||
$theme_exists = $this->theme_exists($theme);
|
||||
if (!$theme_exists)
|
||||
throw new PrestaShopException(sprintf(Tools::displayError('Invalid theme "%s"'), $theme));
|
||||
$this->theme_selected = Tools::safeOutput($theme);
|
||||
}
|
||||
else
|
||||
$this->theme_selected = self::DEFAULT_THEME_NAME;
|
||||
|
||||
// Set the path of selected theme
|
||||
define('_PS_THEME_SELECTED_DIR_', _PS_ROOT_DIR_.'/themes/'.$this->theme_selected.'/');
|
||||
if ($this->theme_selected)
|
||||
define('_PS_THEME_SELECTED_DIR_', _PS_ROOT_DIR_.'/themes/'.$this->theme_selected.'/');
|
||||
|
||||
// Get type of translation
|
||||
if (($type = Tools::getValue('type')) && !is_array($type))
|
||||
@@ -1291,7 +1279,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
{
|
||||
if ($this->tabAccess['edit'] === '1')
|
||||
// Only the PrestaShop team should write the translations into the _PS_TRANSLATIONS_DIR_
|
||||
if (($this->theme_selected == self::DEFAULT_THEME_NAME) && _PS_MODE_DEV_)
|
||||
if (!$this->theme_selected)
|
||||
$this->writeTranslationFile();
|
||||
else
|
||||
$this->writeTranslationFile(true);
|
||||
@@ -1331,22 +1319,19 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
{
|
||||
if ($this->tabAccess['edit'] === '1')
|
||||
{
|
||||
// Get a good path for module directory
|
||||
if ($this->theme_selected == self::DEFAULT_THEME_NAME && _PS_MODE_DEV_)
|
||||
$i18n_dir = $this->translations_informations[$this->type_selected]['dir'];
|
||||
else
|
||||
$i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir'];
|
||||
|
||||
// Get list of modules
|
||||
if ($modules = $this->getListModules())
|
||||
{
|
||||
// Get files of all modules
|
||||
$arr_files = $this->getAllModuleFiles($modules, $i18n_dir, $this->lang_selected->iso_code, true);
|
||||
|
||||
$arr_files = $this->getAllModuleFiles($modules, null, $this->lang_selected->iso_code, true);
|
||||
|
||||
// Find and write all translation modules files
|
||||
foreach ($arr_files as $value)
|
||||
$this->findAndWriteTranslationsIntoFile($value['file_name'], $value['files'], $value['theme'], $value['module'], $value['dir']);
|
||||
|
||||
// Clear modules cache
|
||||
Tools::clearCache();
|
||||
|
||||
// Redirect
|
||||
if (Tools::getValue('submitTranslationsModulesAndStay'))
|
||||
$this->redirect(true);
|
||||
@@ -1409,7 +1394,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$arr_mail_content['core_mail'] = Tools::getValue('core_mail');
|
||||
|
||||
// Get path of directory for find a good path of translation file
|
||||
if ($this->theme_selected == self::DEFAULT_THEME_NAME && _PS_MODE_DEV_)
|
||||
if (!$this->theme_selected)
|
||||
$arr_mail_path['core_mail'] = $this->translations_informations[$this->type_selected]['dir'];
|
||||
else
|
||||
$arr_mail_path['core_mail'] = $this->translations_informations[$this->type_selected]['override']['dir'];
|
||||
@@ -1420,7 +1405,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$arr_mail_content['module_mail'] = Tools::getValue('module_mail');
|
||||
|
||||
// Get path of directory for find a good path of translation file
|
||||
if ($this->theme_selected == self::DEFAULT_THEME_NAME && _PS_MODE_DEV_)
|
||||
if (!$this->theme_selected)
|
||||
$arr_mail_path['module_mail'] = $this->translations_informations['modules']['dir'].'{module}/mails/'.$this->lang_selected->iso_code.'/';
|
||||
else
|
||||
$arr_mail_path['module_mail'] = $this->translations_informations['modules']['override']['dir'].'{module}/mails/'.$this->lang_selected->iso_code.'/';
|
||||
@@ -1601,6 +1586,12 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
*/
|
||||
public function initFormFront()
|
||||
{
|
||||
if (!$this->theme_exists(Tools::getValue('theme')))
|
||||
{
|
||||
$this->errors[] = sprintf(Tools::displayError('Invalid theme "%s"'), Tools::getValue('theme'));
|
||||
return;
|
||||
}
|
||||
|
||||
$missing_translations_front = array();
|
||||
$name_var = $this->translations_informations[$this->type_selected]['var'];
|
||||
$GLOBALS[$name_var] = $this->fileExists();
|
||||
@@ -1882,24 +1873,10 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
throw new PrestaShopException(Tools::displayError('The module directory must be writable.'));
|
||||
|
||||
$modules = array();
|
||||
if (!_PS_MODE_DEV_ && $this->theme_selected == self::DEFAULT_THEME_NAME)
|
||||
{
|
||||
// Get all module which are installed for to have a minimum of POST
|
||||
$modules = Module::getModulesInstalled();
|
||||
|
||||
foreach ($modules as &$module)
|
||||
$module = $module['name'];
|
||||
}
|
||||
else if ($this->theme_selected == self::DEFAULT_THEME_NAME)
|
||||
if (Tools::file_exists_cache($this->translations_informations['modules']['dir']))
|
||||
$modules = scandir($this->translations_informations['modules']['dir']);
|
||||
else
|
||||
$this->displayWarning(Tools::displayError('There are no active modules in this copy of PrestaShop. Please use the Modules page to activate, or visit the PrestaShop Addons Store to download them.'));
|
||||
else
|
||||
if (Tools::file_exists_cache($this->translations_informations['modules']['override']['dir']))
|
||||
$modules = scandir($this->translations_informations['modules']['override']['dir']);
|
||||
else
|
||||
$this->displayWarning(Tools::displayError('There are no active modules in this copy of PrestaShop. Please use the Modules page to activate, or visit the PrestaShop Addons Store to download them.'));
|
||||
// Get all module which are installed for to have a minimum of POST
|
||||
$modules = Module::getModulesInstalled();
|
||||
foreach ($modules as &$module)
|
||||
$module = $module['name'];
|
||||
|
||||
return $modules;
|
||||
}
|
||||
@@ -2314,7 +2291,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
if (!in_array($module_dir, self::$ignore_folder))
|
||||
{
|
||||
$dir = false;
|
||||
if (($this->theme_selected != self::DEFAULT_THEME_NAME || !_PS_MODE_DEV_) && Tools::file_exists_cache($this->translations_informations['modules']['override']['dir'].$module_dir.'/mails/'))
|
||||
if ($this->theme_selected && Tools::file_exists_cache($this->translations_informations['modules']['override']['dir'].$module_dir.'/mails/'))
|
||||
$dir = $this->translations_informations['modules']['override']['dir'].$module_dir.'/';
|
||||
elseif (Tools::file_exists_cache($this->translations_informations['modules']['dir'].$module_dir.'/mails/'))
|
||||
$dir = $this->translations_informations['modules']['dir'].$module_dir.'/';
|
||||
@@ -2373,7 +2350,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$subject_mail = $this->getSubjectMail($dir, $file, $subject_mail);
|
||||
|
||||
// Get path of directory for find a good path of translation file
|
||||
if (($this->theme_selected != self::DEFAULT_THEME_NAME || !_PS_MODE_DEV_) && @filemtime($this->translations_informations[$this->type_selected]['override']['dir']))
|
||||
if ($this->theme_selected && @filemtime($this->translations_informations[$this->type_selected]['override']['dir']))
|
||||
$i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir'];
|
||||
else
|
||||
$i18n_dir = $this->translations_informations[$this->type_selected]['dir'];
|
||||
@@ -2539,19 +2516,46 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
* @param boolean $is_default set it if modules are located in root/prestashop/modules folder
|
||||
* This allow to distinguish overrided prestashop theme and original module
|
||||
*/
|
||||
protected function getAllModuleFiles($modules, $root_dir, $lang, $is_default = false)
|
||||
protected function getAllModuleFiles($modules, $root_dir = null, $lang, $is_default = false)
|
||||
{
|
||||
$array_files = array();
|
||||
$initial_root_dir = $root_dir;
|
||||
foreach ($modules as $module)
|
||||
{
|
||||
if ($module{0} != '.' && is_dir($root_dir.$module))
|
||||
$root_dir = $initial_root_dir;
|
||||
if ($module{0} == '.')
|
||||
continue;
|
||||
|
||||
// First we load the default translation file
|
||||
if ($root_dir == null)
|
||||
{
|
||||
if (Tools::file_exists_cache($root_dir.$module.'/translations/'.$lang.'.php'))
|
||||
$lang_file = $root_dir.$module.'/translations/'.$lang.'.php';
|
||||
else
|
||||
$i18n_dir = $this->translations_informations[$this->type_selected]['dir'];
|
||||
if (is_dir($i18n_dir.$module))
|
||||
$root_dir = $i18n_dir;
|
||||
|
||||
$lang_file = $root_dir.$module.'/translations/'.$lang.'.php';
|
||||
if (!Tools::file_exists_cache($root_dir.$module.'/translations/'.$lang.'.php') && Tools::file_exists_cache($root_dir.$module.'/'.$lang.'.php'))
|
||||
$lang_file = $root_dir.$module.'/'.$lang.'.php';
|
||||
@include($lang_file);
|
||||
$this->getModuleTranslations();
|
||||
// If a theme is selected, then the destination translation file must be in the theme
|
||||
if ($this->theme_selected)
|
||||
$lang_file = $this->translations_informations[$this->type_selected]['override']['dir'].$module.'/translations/'.$lang.'.php';
|
||||
$this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $lang_file, $is_default);
|
||||
}
|
||||
|
||||
$root_dir = $initial_root_dir;
|
||||
// Then we load the overriden translation file
|
||||
if ($this->theme_selected && isset($this->translations_informations[$this->type_selected]['override']))
|
||||
{
|
||||
$i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir'];
|
||||
if (is_dir($i18n_dir.$module))
|
||||
$root_dir = $i18n_dir;
|
||||
if (Tools::file_exists_cache($root_dir.$module.'/translations/'.$lang.'.php'))
|
||||
$lang_file = $root_dir.$module.'/translations/'.$lang.'.php';
|
||||
elseif (Tools::file_exists_cache($root_dir.$module.'/'.$lang.'.php'))
|
||||
$lang_file = $root_dir.$module.'/'.$lang.'.php';
|
||||
@include($lang_file);
|
||||
$this->getModuleTranslations();
|
||||
$this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $lang_file, $is_default);
|
||||
}
|
||||
@@ -2564,20 +2568,13 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
*/
|
||||
public function initFormModules()
|
||||
{
|
||||
// Get path of directory for find a good path of translation file
|
||||
if ($this->theme_selected != self::DEFAULT_THEME_NAME || !_PS_MODE_DEV_)
|
||||
$i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir'];
|
||||
else
|
||||
$i18n_dir = $this->translations_informations[$this->type_selected]['dir'];
|
||||
|
||||
// Get list of modules
|
||||
$modules = $this->getListModules();
|
||||
|
||||
if (!empty($modules))
|
||||
{
|
||||
// Get all modules files and include all translation files
|
||||
$arr_files = $this->getAllModuleFiles($modules, $i18n_dir, $this->lang_selected->iso_code, true);
|
||||
|
||||
$arr_files = $this->getAllModuleFiles($modules, null, $this->lang_selected->iso_code, true);
|
||||
foreach ($arr_files as $value)
|
||||
$this->findAndFillTranslations($value['files'], $value['theme'], $value['module'], $value['dir']);
|
||||
|
||||
@@ -2644,7 +2641,7 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
$i18n_dir = $this->translations_informations[$this->type_selected]['dir'];
|
||||
$default_i18n_file = $i18n_dir.$this->translations_informations[$this->type_selected]['file'];
|
||||
|
||||
if (($this->theme_selected == self::DEFAULT_THEME_NAME) && _PS_MODE_DEV_)
|
||||
if (!$this->theme_selected)
|
||||
$i18n_file = $default_i18n_file;
|
||||
else
|
||||
{
|
||||
@@ -2739,5 +2736,16 @@ class AdminTranslationsControllerCore extends AdminController
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
protected function theme_exists($theme)
|
||||
{
|
||||
if (!is_array($this->themes))
|
||||
$this->themes = Theme::getThemes();
|
||||
|
||||
$theme_exists = false;
|
||||
foreach ($this->themes as $existing_theme)
|
||||
if ($existing_theme->directory == $theme)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -104,12 +104,21 @@ class AuthControllerCore extends FrontController
|
||||
$countries = Carrier::getDeliveredCountries($this->context->language->id, true, true);
|
||||
else
|
||||
$countries = Country::getCountries($this->context->language->id, true);
|
||||
|
||||
|
||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||
{
|
||||
$array = preg_split('/,|-/', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
if (!Validate::isLanguageIsoCode($array[0]) || !($sl_country = Country::getByIso($array[0])))
|
||||
$sl_country = (int)Configuration::get('PS_COUNTRY_DEFAULT');
|
||||
}
|
||||
else
|
||||
$sl_country = (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'inOrderProcess' => true,
|
||||
'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'),
|
||||
'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'),
|
||||
'sl_country' => (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT')),
|
||||
'sl_country' => (int)$sl_country,
|
||||
'countries' => $countries
|
||||
));
|
||||
}
|
||||
@@ -307,7 +316,7 @@ class AuthControllerCore extends FrontController
|
||||
$this->context->cart->secure_key = $customer->secure_key;
|
||||
$this->context->cart->save();
|
||||
$this->context->cookie->id_cart = (int)$this->context->cart->id;
|
||||
$this->context->cookie->update();
|
||||
$this->context->cookie->write();
|
||||
$this->context->cart->autosetProductAddress();
|
||||
|
||||
Hook::exec('actionAuthentication');
|
||||
@@ -379,8 +388,8 @@ class AuthControllerCore extends FrontController
|
||||
$this->errors[] = Tools::displayError('An account using this email address has already been registered.', false);
|
||||
// Preparing customer
|
||||
$customer = new Customer();
|
||||
$lastnameAddress = $_POST['lastname'];
|
||||
$firstnameAddress = $_POST['firstname'];
|
||||
$lastnameAddress = Tools::getValue('lastname');
|
||||
$firstnameAddress = Tools::getValue('firstname');
|
||||
$_POST['lastname'] = Tools::getValue('customer_lastname');
|
||||
$_POST['firstname'] = Tools::getValue('customer_firstname');
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ class CompareControllerCore extends FrontController
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addCSS(_THEME_CSS_DIR_.'/comparator.css');
|
||||
$this->addCSS(_THEME_CSS_DIR_.'comparator.css');
|
||||
|
||||
if (Configuration::get('PS_COMPARATOR_MAX_ITEM') > 0)
|
||||
$this->addJS(_THEME_JS_DIR_.'products-comparison.js');
|
||||
|
||||
@@ -57,7 +57,7 @@ class ContactControllerCore extends FrontController
|
||||
$this->errors[] = Tools::displayError('Please select a subject from the list provided. ');
|
||||
else if (!empty($_FILES['fileUpload']['name']) && $_FILES['fileUpload']['error'] != 0)
|
||||
$this->errors[] = Tools::displayError('An error occurred during the file-upload process.');
|
||||
else if (!empty($_FILES['fileUpload']['name']) && !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) && !in_array(substr($_FILES['fileUpload']['name'], -5), $extension))
|
||||
else if (!empty($_FILES['fileUpload']['name']) && !in_array(substr(Tools::strtolower($_FILES['fileUpload']['name']), -4), $extension) && !in_array(substr(Tools::strtolower($_FILES['fileUpload']['name']), -5), $extension))
|
||||
$this->errors[] = Tools::displayError('Bad file extension');
|
||||
else
|
||||
{
|
||||
|
||||
@@ -347,7 +347,6 @@ class OrderControllerCore extends ParentOrderController
|
||||
|
||||
$this->context->smarty->assign(
|
||||
array(
|
||||
'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only
|
||||
'is_guest' => (isset($this->context->customer->is_guest) ? $this->context->customer->is_guest : 0)
|
||||
));
|
||||
}
|
||||
|
||||
@@ -190,6 +190,13 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$this->context->cart->id_address_invoice = Tools::isSubmit('same') ? $this->context->cart->id_address_delivery : (int)(Tools::getValue('id_address_invoice'));
|
||||
if (!$this->context->cart->update())
|
||||
$this->errors[] = Tools::displayError('An error occurred while updating your cart.');
|
||||
|
||||
$infos = Address::getCountryAndState((int)($this->context->cart->id_address_delivery));
|
||||
if (isset($infos['id_country']) && $infos['id_country'])
|
||||
{
|
||||
$country = new Country((int)$infos['id_country']);
|
||||
$this->context->country = $country;
|
||||
}
|
||||
|
||||
// Address has changed, so we check if the cart rules still apply
|
||||
CartRule::autoRemoveFromCart($this->context);
|
||||
@@ -316,7 +323,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
// If a rule offer free-shipping, force hidding shipping prices
|
||||
$free_shipping = false;
|
||||
foreach ($this->context->cart->getCartRules() as $rule)
|
||||
if ($rule['free_shipping'])
|
||||
if ($rule['free_shipping'] && !$rule['carrier_restriction'])
|
||||
{
|
||||
$free_shipping = true;
|
||||
break;
|
||||
@@ -357,7 +364,8 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
$this->_assignPayment();
|
||||
Tools::safePostVars();
|
||||
|
||||
$this->context->smarty->assign('newsletter', (int)Module::getInstanceByName('blocknewsletter')->active);
|
||||
$blocknewsletter = Module::getInstanceByName('blocknewsletter');
|
||||
$this->context->smarty->assign('newsletter', (bool)($blocknewsletter && $blocknewsletter->active));
|
||||
|
||||
$this->_processAddressFormat();
|
||||
$this->setTemplate(_PS_THEME_DIR_.'order-opc.tpl');
|
||||
@@ -405,9 +413,11 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
if (!$this->isLogged)
|
||||
{
|
||||
$carriers = $this->context->cart->simulateCarriersOutput();
|
||||
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
|
||||
$this->context->smarty->assign(array(
|
||||
'HOOK_EXTRACARRIER' => null,
|
||||
'HOOK_EXTRACARRIER_ADDR' => null,
|
||||
'oldMessage' => isset($oldMessage['message'])? $oldMessage['message'] : '',
|
||||
'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array(
|
||||
'carriers' => $carriers,
|
||||
'checked' => $this->context->cart->simulateCarrierSelectedOutput(),
|
||||
@@ -494,9 +504,20 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
|
||||
$wrapping_fees = $this->context->cart->getGiftWrappingPrice(false);
|
||||
$wrapping_fees_tax_inc = $wrapping_fees = $this->context->cart->getGiftWrappingPrice();
|
||||
$oldMessage = Message::getMessageByCartId((int)($this->context->cart->id));
|
||||
|
||||
$free_shipping = false;
|
||||
foreach ($this->context->cart->getCartRules() as $rule)
|
||||
{
|
||||
if ($rule['free_shipping'] && !$rule['carrier_restriction'])
|
||||
{
|
||||
$free_shipping = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$vars = array(
|
||||
'free_shipping' => false, // Deprecated since a cart rule can be applied the specific carriers only
|
||||
'free_shipping' => $free_shipping,
|
||||
'checkedTOS' => (int)($this->context->cookie->checkedTOS),
|
||||
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
|
||||
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
|
||||
@@ -513,6 +534,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
'delivery_option' => $delivery_option,
|
||||
'address_collection' => $this->context->cart->getAddressCollection(),
|
||||
'opc' => true,
|
||||
'oldMessage' => isset($oldMessage['message'])? $oldMessage['message'] : '',
|
||||
'HOOK_BEFORECARRIER' => Hook::exec('displayBeforeCarrier', array(
|
||||
'carriers' => $carriers,
|
||||
'delivery_option_list' => $this->context->cart->getDeliveryOptionList(),
|
||||
@@ -538,6 +560,7 @@ class OrderOpcControllerCore extends ParentOrderController
|
||||
)),
|
||||
'carrier_block' => $this->context->smarty->fetch(_PS_THEME_DIR_.'order-carrier.tpl')
|
||||
);
|
||||
|
||||
Cart::addExtraCarriers($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
class FreeOrder extends PaymentModule
|
||||
{
|
||||
public $active = 1;
|
||||
public $name = 'free_order';
|
||||
public $displayName = 'free_order';
|
||||
}
|
||||
|
||||
class ParentOrderControllerCore extends FrontController
|
||||
@@ -454,15 +456,15 @@ class ParentOrderControllerCore extends FrontController
|
||||
}
|
||||
|
||||
protected function _assignCarrier()
|
||||
{
|
||||
{
|
||||
$address = new Address($this->context->cart->id_address_delivery);
|
||||
$id_zone = Address::getZoneById($address->id);
|
||||
$carriers = $this->context->cart->simulateCarriersOutput();
|
||||
$checked = $this->context->cart->simulateCarrierSelectedOutput();
|
||||
$delivery_option_list = $this->context->cart->getDeliveryOptionList();
|
||||
$this->setDefaultCarrierSelection($delivery_option_list);
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'address_collection' => $this->context->cart->getAddressCollection(),
|
||||
'delivery_option_list' => $delivery_option_list,
|
||||
'carriers' => $carriers,
|
||||
@@ -497,8 +499,18 @@ class ParentOrderControllerCore extends FrontController
|
||||
$this->link_conditions .= '?content_only=1';
|
||||
else
|
||||
$this->link_conditions .= '&content_only=1';
|
||||
|
||||
|
||||
$free_shipping = false;
|
||||
foreach ($this->context->cart->getCartRules() as $rule)
|
||||
{
|
||||
if ($rule['free_shipping'] && !$rule['carrier_restriction'])
|
||||
{
|
||||
$free_shipping = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$this->context->smarty->assign(array(
|
||||
'free_shipping' => $free_shipping,
|
||||
'checkedTOS' => (int)($this->context->cookie->checkedTOS),
|
||||
'recyclablePackAllowed' => (int)(Configuration::get('PS_RECYCLABLE_PACK')),
|
||||
'giftAllowed' => (int)(Configuration::get('PS_GIFT_WRAPPING')),
|
||||
|
||||
@@ -257,9 +257,9 @@ class ProductControllerCore extends FrontController
|
||||
'HOOK_EXTRA_LEFT' => Hook::exec('displayLeftColumnProduct'),
|
||||
'HOOK_EXTRA_RIGHT' => Hook::exec('displayRightColumnProduct'),
|
||||
'HOOK_PRODUCT_OOS' => Hook::exec('actionProductOutOfStock', array('product' => $this->product)),
|
||||
'HOOK_PRODUCT_ACTIONS' => Hook::exec('displayProductButtons'),
|
||||
'HOOK_PRODUCT_TAB' => Hook::exec('displayProductTab'),
|
||||
'HOOK_PRODUCT_TAB_CONTENT' => Hook::exec('displayProductTabContent'),
|
||||
'HOOK_PRODUCT_ACTIONS' => Hook::exec('displayProductButtons', array('product' => $this->product)),
|
||||
'HOOK_PRODUCT_TAB' => Hook::exec('displayProductTab', array('product' => $this->product)),
|
||||
'HOOK_PRODUCT_TAB_CONTENT' => Hook::exec('displayProductTabContent', array('product' => $this->product)),
|
||||
'display_qties' => (int)Configuration::get('PS_DISPLAY_QTIES'),
|
||||
'display_ht' => !Tax::excludeTaxeOption(),
|
||||
'currencySign' => $this->context->currency->sign,
|
||||
@@ -340,26 +340,39 @@ class ProductControllerCore extends FrontController
|
||||
{
|
||||
$images = $this->product->getImages((int)$this->context->cookie->id_lang);
|
||||
$product_images = array();
|
||||
|
||||
if(isset($images[0]))
|
||||
$this->context->smarty->assign('mainImage', $images[0]);
|
||||
foreach ($images as $k => $image)
|
||||
{
|
||||
if ($image['cover'])
|
||||
{
|
||||
$this->context->smarty->assign('mainImage', $images[0]);
|
||||
$this->context->smarty->assign('mainImage', $image);
|
||||
$cover = $image;
|
||||
$cover['id_image'] = (Configuration::get('PS_LEGACY_IMAGES') ? ($this->product->id.'-'.$image['id_image']) : $image['id_image']);
|
||||
$cover['id_image_only'] = (int)$image['id_image'];
|
||||
}
|
||||
$product_images[(int)$image['id_image']] = $image;
|
||||
}
|
||||
|
||||
if (!isset($cover))
|
||||
$cover = array(
|
||||
'id_image' => $this->context->language->iso_code.'-default',
|
||||
'legend' => 'No picture',
|
||||
'title' => 'No picture'
|
||||
{
|
||||
if(isset($images[0]))
|
||||
{
|
||||
$cover = $images[0];
|
||||
$cover['id_image'] = (Configuration::get('PS_LEGACY_IMAGES') ? ($this->product->id.'-'.$images[0]['id_image']) : $images[0]['id_image']);
|
||||
$cover['id_image_only'] = (int)$images[0]['id_image'];
|
||||
}
|
||||
else
|
||||
$cover = array(
|
||||
'id_image' => $this->context->language->iso_code.'-default',
|
||||
'legend' => 'No picture',
|
||||
'title' => 'No picture'
|
||||
);
|
||||
}
|
||||
$size = Image::getSize(ImageType::getFormatedName('large'));
|
||||
$this->context->smarty->assign(array(
|
||||
'have_image' => Product::getCover((int)Tools::getValue('id_product')),
|
||||
'have_image' => isset($cover['id_image'])? array((int)$cover['id_image']) : Product::getCover((int)Tools::getValue('id_product')),
|
||||
'cover' => $cover,
|
||||
'imgWidth' => (int)$size['width'],
|
||||
'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')),
|
||||
@@ -432,11 +445,37 @@ class ProductControllerCore extends FrontController
|
||||
else
|
||||
$combinations[$row['id_product_attribute']]['available_date'] = '';
|
||||
|
||||
if (isset($combination_images[$row['id_product_attribute']][0]['id_image']))
|
||||
$combinations[$row['id_product_attribute']]['id_image'] = $combination_images[$row['id_product_attribute']][0]['id_image'];
|
||||
else
|
||||
if (!isset($combination_images[$row['id_product_attribute']][0]['id_image']))
|
||||
$combinations[$row['id_product_attribute']]['id_image'] = -1;
|
||||
else
|
||||
{
|
||||
$combinations[$row['id_product_attribute']]['id_image'] = $id_image = (int)$combination_images[$row['id_product_attribute']][0]['id_image'];
|
||||
if ($row['default_on'] && $id_image > 0)
|
||||
{
|
||||
if (isset($this->context->smarty->tpl_vars['images']->value))
|
||||
$product_images = $this->context->smarty->tpl_vars['images']->value;
|
||||
if (is_array($product_images) && isset($product_images[$id_image]))
|
||||
{
|
||||
$product_images[$id_image]['cover'] = 1;
|
||||
$this->context->smarty->assign('mainImage', $product_images[$id_image]);
|
||||
if (count($product_images))
|
||||
$this->context->smarty->assign('images', $product_images);
|
||||
}
|
||||
if (isset($this->context->smarty->tpl_vars['cover']->value))
|
||||
$cover = $this->context->smarty->tpl_vars['cover']->value;
|
||||
if (is_array($cover) && is_array($product_images))
|
||||
{
|
||||
$product_images[$cover['id_image']]['cover'] = 0;
|
||||
if (isset($product_images[$id_image]))
|
||||
$cover = $product_images[$id_image];
|
||||
$cover['id_image'] = (Configuration::get('PS_LEGACY_IMAGES') ? ($this->product->id.'-'.$id_image) : (int)$id_image);
|
||||
$cover['id_image_only'] = (int)$id_image;
|
||||
$this->context->smarty->assign('cover', $cover);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// wash attributes list (if some attributes are unavailables and if allowed to wash it)
|
||||
if (!Product::isAvailableWhenOutOfStock($this->product->out_of_stock) && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0)
|
||||
{
|
||||
@@ -616,4 +655,4 @@ class ProductControllerCore extends FrontController
|
||||
}
|
||||
return $specific_prices;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -199,6 +199,8 @@ background: -moz-linear-gradient(center top , #F9F9F9, #ECECEC) repeat-x scroll
|
||||
color: #7F7F7F;
|
||||
font-size: 0.85em;
|
||||
}
|
||||
|
||||
|
||||
.margin-form .normal-text {
|
||||
display: block;
|
||||
padding-top: 0.2em;
|
||||
@@ -761,7 +763,6 @@ tr.deleted td {
|
||||
}
|
||||
|
||||
.row {
|
||||
background: #F4E6C9 url(../img/admin/news-bg.gif) repeat-x top left;
|
||||
}
|
||||
|
||||
.uppercase {
|
||||
@@ -844,6 +845,9 @@ tr.deleted td {
|
||||
font-weight:bold;
|
||||
font-size:16px;
|
||||
}
|
||||
|
||||
span.hint {position: relative;}
|
||||
|
||||
div.hint {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
129
docs/CHANGELOG.txt
Normal file → Executable file
129
docs/CHANGELOG.txt
Normal file → Executable file
@@ -23,6 +23,135 @@ International Registred Trademark & Property of PrestaShop SA
|
||||
|
||||
Release Notes for PrestaShop 1.5
|
||||
--------------------------------
|
||||
####################################
|
||||
# v1.5.4.1 - (2013-04-25) #
|
||||
####################################
|
||||
|
||||
Fixed bugs:
|
||||
|
||||
[-] Installer: installer now work even if no settings.inc.php file is created with an installer session already here
|
||||
[-] Installer : do not select activity if not defined
|
||||
[-] INSTALLER : add counter loop in update_order_messages
|
||||
[-] Installer : Fix bug #PSCFV-8606 bad performance when updating messages
|
||||
[-] INSTALLER : fix bug #PSCFV-7688 mailalert_customer_oos not existing in database
|
||||
[-] Installer: fix installer in PT languahe
|
||||
[-] Installer : Missing directory separator when upgrading images types
|
||||
[-] Installer: Switch test of session.save_path to optional test
|
||||
[-] INSTALLER : Fix bug, can not check rights on theme folders
|
||||
[-] INSTALLER : Fix bug #PSCFV-8167 duplicates product_sqlstock INDEX
|
||||
|
||||
[-] FO : do not use dispatcher routes for static files
|
||||
[-] FO : invoice: do not display taxes table if there is not tax to display
|
||||
[-] FO : Fixed product comparator CSS
|
||||
[-] Fo : Remove additionnal space in phone field value
|
||||
[-] FO : fix bug #PSCFV-8684, phone not required in guest checkout when not set in BO
|
||||
[-] FO: send current product to some hook like displayProductTabContent on product page #PSCFV-8825
|
||||
[-] FO : Fix bug #PSCFV-8728 context country not updated after changing delivery address in OPC
|
||||
[-] FO: fixed some css bug for ie7
|
||||
[-] FO: Add the protocol content to the cache id of modules #PSCFV-8810
|
||||
[-] FO : empty cache getContextualValue_ when updating cart quantity
|
||||
[-] FO : Disable confirm order when already clicked
|
||||
[-] FO : address alias lost
|
||||
[-] FO : Undefined free_shipping in POC when updateQty
|
||||
[-] Fo : Fix big pic alt with jqzoom
|
||||
[-] FO : Class free order name for validateOrder
|
||||
[-] FO : First part of fix #PSCFV-8636, cart rule on specifice carrier / all carriers
|
||||
[-] FO : Fix bug #PSCFV-8623 : Cart rule without code is applied automatically
|
||||
[-] FO : add cart rul when cart rul has several groups
|
||||
[-] FO: Fix bug too much call of updateCartSummary when OPC and cart rule
|
||||
[-] Fo : Fix undefined var in cart-summary when updating id_address_delivery
|
||||
[-] FO : Fix login cookie issues
|
||||
[-] FO: fixed bug #PSCFV-3238 - compareController typo
|
||||
[-] FO: Fix #PSCFV-8722 displayed specific prices on product page was sometimes wrong
|
||||
[-] FO : Fix bug #PSCFV-8589 do not loose max level depth when upgrading
|
||||
[-] FO : standardize behavior of selected country in the list when create a new address
|
||||
[-] FO: fixed bug DOCTYPE line - #PSCFV-8602
|
||||
[-] FO: Fix htaccess generation when disable mod_security is selected #PSCFV-8675
|
||||
[-] FO: Don't display vat_number field if not required for the country on address.tpl
|
||||
[-] FO: Extension test on file attachment for contact form should not be case sensitive #PSCFV-8616
|
||||
[-] FO : Do not fade out on bigpic source change
|
||||
[-] FO : Fix bug #PSCFV-7743 and #PSCFV-8286, bigpic source change
|
||||
[-] FO: fixed bug Cart Summery Borders - #PSCFV-8421
|
||||
[-] FO : Fix bug #PSCFV-8286, displayImage bad selector called
|
||||
[-] FO: fixed bug Solved a problem with JSON.stringify problem with IE8 - #PSCFV-8340
|
||||
[-] FO : Fix bug #PSCFV-7825 removing import of grid_prestashop.css and displaying errors in AdminPerformances
|
||||
[-] FO: fixed bug missing <div class="clear"></div> in product.tpl - #PSCFV-8164
|
||||
[-] FO : Add ccs and js to frontcontroller for old modules
|
||||
[-] FO: change logo position
|
||||
[-] FO : Fix bug #PSCFV-8183 lost order message in OPC
|
||||
|
||||
[-] BO: Fix htaccess generation for subfolders installation
|
||||
[-] BO : Fix bug witth shop address and no state in country
|
||||
[-] BO : Fix bug for csv export
|
||||
[-] BO : Can not set PS_ORDER_OUT_OF_STOCK in one shop
|
||||
[-] BO : Bad gender image when no gender
|
||||
[-] BO: Fix #PSCFV-8827 fixed price of specific price rules should be a float
|
||||
[-] BO: Fix admin carts currency prices on view and listing
|
||||
[-] BO : Remove typo in address formating fields links
|
||||
[-] BO : Remove undefined name when module can not be installed
|
||||
[-] BO: Don't delete the directory of modules before upgrade them
|
||||
[-] BO: fixed bug css - #PSCFV-8737 - AdminScenes.php ~~ remove inline css forcing a border to #large_scene_image
|
||||
[-] BO: Fix #PSCFV-8730 display of selected dates on the backoffice listings header - thank to pitt phunsanit for the patch
|
||||
[-] BO : Deactivate backwardcompatibility module
|
||||
[-] BO: PSCFV-7685 parent category for root categories after upgrade
|
||||
[-] BO : Fix bug #PSCFV-8626 rename actual admin folder
|
||||
[-] BO: fixed bug Cart rules - Javascript error - #PSCFV-5045
|
||||
[-] BO : Fix bug #PSCFV-8620 returns with customized product
|
||||
[-] BO: Fix #PSCFV-8683 order_way collusion on listing between 2 tabs
|
||||
[-] BO : Fix bug : #PSCFV-8631 no download-product.tpl in languages packs
|
||||
[-] BO : Fix bug #PSCFV-8540 setting cookie key in cache key
|
||||
[-] BO: fixed bug In back office, in product modification page, image pane, the image list appears broken in IE8 - #PSCFV-8024
|
||||
[-] BO: Fix the Htaccess rewriting generation when one shop has the rewriting enabled and the last one on the same domain not
|
||||
[-] BO: fixed bug #PSCFV-8258
|
||||
[-] BO: Clear cart when customer is changed in back office orders #PSCFV-8520
|
||||
[-] BO : Remove warning on ProductDownload
|
||||
[-] BO : fixed field value saving when value is equal to 0 #PSCFV-8530
|
||||
[-] BO : Fix bug #PSCFV-8481 no live edit on index when one language is active only
|
||||
[-] BO : fixed bug #PSCFV-8095 now maximum weigh for carrier is float
|
||||
|
||||
[-] Classes : Bug fix : OrderOpcController, check instance of blocknewsletter module
|
||||
[-] Classes : Bug fix : Mobile hooks, check PayPal for payments only
|
||||
|
||||
[-] Core: fix redirection loop for bugged versions of mysql using column name aliases on order by
|
||||
[-] CORE : Fix bug #PSCFV-8636 again, cart rule with a reduction and free shipping
|
||||
[-] CORE : Fix bug last part #PSCFV-8636, cart rule with a reduction and free shipping
|
||||
[-] CORE : Fix bug #PSCFV-5624 set order reference to CHAR(10)
|
||||
[-] CORE : fixed bug #PSCFV-8475 - Email templates with {shop_url} append url with index.php
|
||||
[-] Core: Cache of Cart::getPackageList is now per cart
|
||||
[-] Core: Local cache could never be totally cleaned
|
||||
|
||||
[-] MO: homefeatured - numbers are now the same
|
||||
[-] MO: Fix product cover image on blockviewed with multishop
|
||||
[-] MO : Fix rand parameter in favorite module js
|
||||
[-] MO : Fix bug #PSCFV-8430 bad post type ajax request, thanks to maofree
|
||||
[-] MO : Fix bug #PSCFV-8399 dictinct categegories in module blockcategories
|
||||
|
||||
Improved/changed features:
|
||||
|
||||
[*] Installer : Set context in upgrader
|
||||
[*] Installer: Add PHP CLI installer
|
||||
|
||||
[*] FO : one_phone_at_least should be set
|
||||
[*] FO : add steps to authentication pull request 002f468958 thanks to radovanx
|
||||
[*] FO: use subdirectory per template for smarty cache
|
||||
[*] FO : Check if grid_prestashop.css is available in theme before including
|
||||
[*] FO : Retrocompat for default theme 1.4.10
|
||||
|
||||
[*] BO : Add block "close_td" in list_content.tpl [*] BO : Add block "close_td" in list_content.tpl {block name="td_content"} ..... {/block} {block name="close_td"} {/block} So now we can override "td" and "/td" tags. So we can create "td" "a" ... content.... "/a" "/td" when overriding the block open-td and close-td and we can use "a" tag with "href" rather than "onclick" to create view links in the list. And the user can choose to open the link in another tab or window.
|
||||
[*] BO: The translation of modules are now made in the theme if modules are overrided or directly in the module folder
|
||||
[*] BO: List all modules with an upgrade available on AdminModules header
|
||||
|
||||
[*] TR : Removed hard-coded dot in history.tpl
|
||||
[*] TR : Improved English text of installer
|
||||
[*] TR : added russian installer tabs
|
||||
[*] TR : Fixed wrong use of translation functions in AdminTranslationsController
|
||||
[*] TR : Added tab translations for installer languages
|
||||
|
||||
Added Features:
|
||||
|
||||
[+] BO: show all languages in setting of employee
|
||||
|
||||
|
||||
####################################
|
||||
# v1.5.4.0 - (2013-03-26) #
|
||||
####################################
|
||||
|
||||
@@ -21,8 +21,8 @@ needs please refer to http://www.prestashop.com for more information.
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
NAME: Prestashop 1.5.4.0
|
||||
VERSION: 1.5.4.0
|
||||
NAME: Prestashop 1.5.4.1
|
||||
VERSION: 1.5.4.1
|
||||
|
||||
VORBEREITUNG
|
||||
===========
|
||||
|
||||
@@ -21,8 +21,8 @@ needs please refer to http://www.prestashop.com for more information.
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
NAME: Prestashop 1.5.4.0
|
||||
VERSION: 1.5.4.0
|
||||
NAME: Prestashop 1.5.4.1
|
||||
VERSION: 1.5.4.1
|
||||
|
||||
PREPARATION
|
||||
===========
|
||||
|
||||
@@ -21,8 +21,8 @@ needs please refer to http://www.prestashop.com for more information.
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
NAME: Prestashop 1.5.4.0
|
||||
VERSION: 1.5.4.0
|
||||
NAME: Prestashop 1.5.4.1
|
||||
VERSION: 1.5.4.1
|
||||
|
||||
PREPARACI<EFBFBD>N
|
||||
===========
|
||||
|
||||
@@ -21,8 +21,8 @@ needs please refer to http://www.prestashop.com for more information.
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
NAME: Prestashop 1.5.4.0
|
||||
VERSION: 1.5.4.0
|
||||
NAME: Prestashop 1.5.4.1
|
||||
VERSION: 1.5.4.1
|
||||
|
||||
PREPARATION
|
||||
===========
|
||||
|
||||
@@ -21,8 +21,8 @@ needs please refer to http://www.prestashop.com for more information.
|
||||
@license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
International Registered Trademark & Property of PrestaShop SA
|
||||
|
||||
NAME: Prestashop 1.5.4.0
|
||||
VERSION: 1.5.4.0
|
||||
NAME: Prestashop 1.5.4.1
|
||||
VERSION: 1.5.4.1
|
||||
|
||||
PREPARAZIONE
|
||||
===========
|
||||
|
||||
18
error500.html
Normal file
18
error500.html
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<meta name="description" content="Boutique propulsée par PrestaShop" />
|
||||
<link rel="shortcut icon" href="/img/favicon.ico" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="maintenance" style="margin:0 auto;width:940px;font:normal 30px Arial, Verdana, sans-serif;color:#333;">
|
||||
<p><img src="/img/logo.jpg" width="209" height="52" alt="logo" /><br /><br /></p>
|
||||
<p id="message" style="margin:0 20px;padding:50px 310px 0 0;height:360px;background:url(/img/bg_500.png) no-repeat 100% 0 #fff">
|
||||
Oops, something went wrong.<br /><br />
|
||||
Try to refresh this page or feel free to contact us if the problem persists.
|
||||
</p>
|
||||
<span style="clear:both;"> </span>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -34,6 +34,7 @@ else
|
||||
{
|
||||
$controller = new FrontController();
|
||||
$controller->init();
|
||||
$controller->setMedia();
|
||||
}
|
||||
Tools::displayFileAsDeprecated();
|
||||
$controller->displayHeader();
|
||||
|
||||
BIN
img/bg_500.png
Normal file
BIN
img/bg_500.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
176
install-dev/classes/controllerConsole.php
Normal file
176
install-dev/classes/controllerConsole.php
Normal file
@@ -0,0 +1,176 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
abstract class InstallControllerConsole
|
||||
{
|
||||
/**
|
||||
* @var array List of installer steps
|
||||
*/
|
||||
protected static $steps = array('process');
|
||||
|
||||
protected static $instances = array();
|
||||
|
||||
/**
|
||||
* @var string Current step
|
||||
*/
|
||||
public $step;
|
||||
|
||||
/**
|
||||
* @var array List of errors
|
||||
*/
|
||||
public $errors = array();
|
||||
|
||||
/**
|
||||
* @var InstallController
|
||||
*/
|
||||
public $controller;
|
||||
|
||||
/**
|
||||
* @var InstallSession
|
||||
*/
|
||||
public $session;
|
||||
|
||||
/**
|
||||
* @var InstallLanguages
|
||||
*/
|
||||
public $language;
|
||||
|
||||
/**
|
||||
* @var InstallAbstractModel
|
||||
*/
|
||||
public $model;
|
||||
|
||||
/**
|
||||
* Validate current step
|
||||
*/
|
||||
abstract public function validate();
|
||||
|
||||
final public static function execute($argc, $argv)
|
||||
{
|
||||
if (!($argc-1))
|
||||
{
|
||||
$available_arguments = Datas::getInstance()->getArgs();
|
||||
echo 'Arguments available:'."\n";
|
||||
foreach ($available_arguments as $key => $arg)
|
||||
{
|
||||
$name = isset($arg['name']) ? $arg['name'] : $key;
|
||||
echo '--'.$name."\t".(isset($arg['help']) ? $arg['help'] : '').(isset($arg['default']) ? "\t".'(Default: '.$arg['default'].')' : '')."\n";
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
$errors = Datas::getInstance()->getAndCheckArgs($argv);
|
||||
if (Datas::getInstance()->show_license)
|
||||
{
|
||||
echo strip_tags(file_get_contents(_PS_INSTALL_PATH_.'theme/views/license_content.phtml'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($errors !== true)
|
||||
{
|
||||
if (count($errors))
|
||||
foreach ($errors as $error)
|
||||
echo $error."\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
// Include all controllers
|
||||
foreach (self::$steps as $step)
|
||||
{
|
||||
if (!file_exists(_PS_INSTALL_CONTROLLERS_PATH_.'console/'.$step.'.php'))
|
||||
throw new PrestashopInstallerException("Controller file 'console/{$step}.php' not found");
|
||||
|
||||
require_once _PS_INSTALL_CONTROLLERS_PATH_.'console/'.$step.'.php';
|
||||
$classname = 'InstallControllerConsole'.$step;
|
||||
self::$instances[$step] = new $classname($step);
|
||||
}
|
||||
|
||||
$datas = Datas::getInstance();
|
||||
|
||||
/* redefine HTTP_HOST */
|
||||
$_SERVER['HTTP_HOST'] = $datas->http_host;
|
||||
|
||||
@date_default_timezone_set($datas->timezone);
|
||||
|
||||
if (!$current_step = $datas->step)
|
||||
return false;
|
||||
|
||||
self::$instances[$current_step]->process();
|
||||
}
|
||||
|
||||
final public function __construct($step)
|
||||
{
|
||||
$this->step = $step;
|
||||
$this->datas = Datas::getInstance();
|
||||
|
||||
// Set current language
|
||||
$this->language = InstallLanguages::getInstance();
|
||||
if (!$this->datas->language)
|
||||
die('No language defined');
|
||||
$this->language->setLanguage($this->datas->language);
|
||||
|
||||
$this->init();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize model
|
||||
*/
|
||||
public function init()
|
||||
{
|
||||
}
|
||||
|
||||
public function printErrors()
|
||||
{
|
||||
$errors = $this->model_install->getErrors();
|
||||
if (count($errors))
|
||||
{
|
||||
if (!is_array($errors))
|
||||
$errors = array($errors);
|
||||
echo 'Errors :'."\n";
|
||||
foreach ($errors as $error_process)
|
||||
foreach ($error_process as $error)
|
||||
echo $error."\n";
|
||||
die;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get translated string
|
||||
*
|
||||
* @param string $str String to translate
|
||||
* @param ... All other params will be used with sprintf
|
||||
* @return string
|
||||
*/
|
||||
public function l($str)
|
||||
{
|
||||
$args = func_get_args();
|
||||
return call_user_func_array(array($this->language, 'l'), $args);
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
}
|
||||
}
|
||||
203
install-dev/classes/datas.php
Normal file
203
install-dev/classes/datas.php
Normal file
@@ -0,0 +1,203 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class Datas
|
||||
{
|
||||
private static $instance = null;
|
||||
protected static $available_args = array(
|
||||
'step' => array(
|
||||
'name' => 'step',
|
||||
'default' => 'process',
|
||||
'validate' => 'isGenericName',
|
||||
),
|
||||
'language' => array(
|
||||
'default' => 'en',
|
||||
'validate' => 'isLanguageIsoCode',
|
||||
'alias' => 'l',
|
||||
'help' => 'language iso code',
|
||||
),
|
||||
'timezone' => array(
|
||||
'default' => 'Europe/Paris',
|
||||
'alias' => 't',
|
||||
),
|
||||
'http_host' => array(
|
||||
'name' => 'domain',
|
||||
'validate' => 'isGenericName',
|
||||
'default' => 'localhost',
|
||||
),
|
||||
'database_server' => array(
|
||||
'name' => 'db_server',
|
||||
'default' => 'localhost',
|
||||
'validate' => 'isGenericName',
|
||||
'alias' => 'h',
|
||||
),
|
||||
'database_login' => array(
|
||||
'name' => 'db_user',
|
||||
'alias' => 'u',
|
||||
'default' => 'root',
|
||||
'validate' => 'isGenericName',
|
||||
),
|
||||
'database_password' => array(
|
||||
'name' => 'db_password',
|
||||
'alias' => 'p',
|
||||
'default' => '',
|
||||
),
|
||||
'database_name' => array(
|
||||
'name' => 'db_name',
|
||||
'alias' => 'd',
|
||||
'default' => 'prestashop',
|
||||
'validate' => 'isGenericName',
|
||||
),
|
||||
'database_clear' => array(
|
||||
'name' => 'db_clear',
|
||||
'default' => '1',
|
||||
'validate' => 'isInt',
|
||||
'help' => 'Drop existing tables'
|
||||
),
|
||||
'database_prefix' => array(
|
||||
'name' => 'prefix',
|
||||
'default' => 'ps_',
|
||||
'validate' => 'isGenericName',
|
||||
),
|
||||
'database_engine' => array(
|
||||
'name' => 'engine',
|
||||
'validate' => 'isMySQLEngine',
|
||||
'default' => 'InnoDB',
|
||||
'help' => 'InnoDB/MyISAM',
|
||||
),
|
||||
'shop_name' => array(
|
||||
'name' => 'name',
|
||||
'validate' => 'isGenericName',
|
||||
'default' => 'PrestaShop',
|
||||
),
|
||||
'shop_activity' => array(
|
||||
'name' => 'activity',
|
||||
'default' => 0,
|
||||
'validate' => 'isInt',
|
||||
),
|
||||
'shop_country' => array(
|
||||
'name' => 'country',
|
||||
'validate' => 'isLanguageIsoCode',
|
||||
'default' => 'fr',
|
||||
),
|
||||
'admin_firstname' => array(
|
||||
'name' => 'firstname',
|
||||
'validate' => 'isName',
|
||||
'default' => 'John',
|
||||
),
|
||||
'admin_lastname' => array(
|
||||
'name' => 'lastname',
|
||||
'validate' => 'isName',
|
||||
'default' => 'Doe',
|
||||
),
|
||||
'admin_password' => array(
|
||||
'name' => 'password',
|
||||
'validate' => 'isPasswd',
|
||||
'default' => '0123456789',
|
||||
),
|
||||
'admin_email' => array(
|
||||
'name' => 'email',
|
||||
'validate' => 'isEmail',
|
||||
'default' => 'pub@prestashop.com'
|
||||
),
|
||||
'show_license' => array(
|
||||
'name' => 'license',
|
||||
'default' => 0,
|
||||
'help' => 'show PrestaShop license'
|
||||
),
|
||||
'newsletter' => array(
|
||||
'name' => 'newsletter',
|
||||
'default' => 1,
|
||||
'help' => 'get news from PrestaShop',
|
||||
),
|
||||
);
|
||||
|
||||
protected $datas = array();
|
||||
|
||||
public function __get($key)
|
||||
{
|
||||
if (isset($this->datas[$key]))
|
||||
return $this->datas[$key];
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public function __set($key, $value)
|
||||
{
|
||||
$this->datas[$key] = $value;
|
||||
}
|
||||
|
||||
public static function getInstance()
|
||||
{
|
||||
if (Datas::$instance === null)
|
||||
Datas::$instance = new Datas();
|
||||
return Datas::$instance;
|
||||
}
|
||||
|
||||
public static function getArgs()
|
||||
{
|
||||
return Datas::$available_args;
|
||||
}
|
||||
|
||||
public function getAndCheckArgs($argv)
|
||||
{
|
||||
if (!$argv)
|
||||
return false;
|
||||
|
||||
$args_ok = array();
|
||||
foreach ($argv as $arg)
|
||||
{
|
||||
if (!preg_match('/^--([^=\'"><|`]+)(?:=([^=\'"><|`]+)|(?!license))/i', trim($arg), $res))
|
||||
continue;
|
||||
|
||||
if ($res[1] == 'license' && !isset($res[2]))
|
||||
$res[2] = 1;
|
||||
$args_ok[$res[1]] = $res[2];
|
||||
}
|
||||
|
||||
$errors = array();
|
||||
foreach (Datas::getArgs() as $key => $row)
|
||||
{
|
||||
if (isset($row['name']))
|
||||
$name = $row['name'];
|
||||
else
|
||||
$name = $key;
|
||||
if (!isset($args_ok[$name]))
|
||||
{
|
||||
if (!isset($row['default']))
|
||||
$errors[] = 'Field '.$row['name'].' is empty';
|
||||
else
|
||||
$this->$key = $row['default'];
|
||||
}
|
||||
elseif (isset($row['validate']) && !call_user_func(array('Validate', $row['validate']), $args_ok[$name]))
|
||||
$errors[] = 'Field '.$row['name'].' is not valid';
|
||||
else
|
||||
$this->$key = $args_ok[$name];
|
||||
}
|
||||
|
||||
return count($errors) ? $errors : true;
|
||||
}
|
||||
}
|
||||
288
install-dev/controllers/console/process.php
Normal file
288
install-dev/controllers/console/process.php
Normal file
@@ -0,0 +1,288 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2013 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Open Software License (OSL 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/osl-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-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class InstallControllerConsoleProcess extends InstallControllerConsole
|
||||
{
|
||||
const SETTINGS_FILE = 'config/settings.inc.php';
|
||||
|
||||
/**
|
||||
* @var InstallModelInstall
|
||||
*/
|
||||
protected $model_install;
|
||||
|
||||
public $process_steps = array();
|
||||
|
||||
public $previous_button = false;
|
||||
|
||||
public function init()
|
||||
{
|
||||
require_once _PS_INSTALL_MODELS_PATH_.'install.php';
|
||||
require_once _PS_INSTALL_MODELS_PATH_.'database.php';
|
||||
$this->model_install = new InstallModelInstall();
|
||||
$this->model_database = new InstallModelDatabase();
|
||||
}
|
||||
|
||||
/**
|
||||
* @see InstallAbstractModel::processNextStep()
|
||||
*/
|
||||
public function processNextStep()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* @see InstallAbstractModel::validate()
|
||||
*/
|
||||
public function validate()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public function initializeContext()
|
||||
{
|
||||
global $smarty;
|
||||
// Clean all cache values
|
||||
Cache::clean('*');
|
||||
|
||||
Context::getContext()->shop = new Shop(1);
|
||||
Shop::setContext(Shop::CONTEXT_SHOP, 1);
|
||||
Configuration::loadConfiguration();
|
||||
if (!isset(Context::getContext()->language) || !Validate::isLoadedObject(Context::getContext()->language))
|
||||
if ($id_lang = (int)Configuration::get('PS_LANG_DEFAULT'))
|
||||
Context::getContext()->language = new Language($id_lang);
|
||||
if (!isset(Context::getContext()->country) || !Validate::isLoadedObject(Context::getContext()->country))
|
||||
if ($id_country = (int)Configuration::get('PS_COUNTRY_DEFAULT'))
|
||||
Context::getContext()->country = new Country((int)$id_country);
|
||||
|
||||
Context::getContext()->cart = new Cart();
|
||||
Context::getContext()->employee = new Employee(1);
|
||||
if (!defined('_PS_SMARTY_FAST_LOAD_'))
|
||||
define('_PS_SMARTY_FAST_LOAD_', true);
|
||||
require_once _PS_ROOT_DIR_.'/config/smarty.config.inc.php';
|
||||
|
||||
Context::getContext()->smarty = $smarty;
|
||||
}
|
||||
|
||||
public function process()
|
||||
{
|
||||
/*if (file_exists(_PS_ROOT_DIR_.'/'.self::SETTINGS_FILE))
|
||||
@require_once _PS_ROOT_DIR_.'/'.self::SETTINGS_FILE;*/
|
||||
|
||||
if (!$this->processGenerateSettingsFile())
|
||||
$this->printErrors();
|
||||
if (!$this->model_database->testDatabaseSettings($this->datas->database_server, $this->datas->database_name, $this->datas->database_login, $this->datas->database_password, $this->datas->database_prefix, $this->datas->database_engine, $this->datas->database_clear))
|
||||
$this->printErrors();
|
||||
if (!$this->processInstallDatabase())
|
||||
$this->printErrors();
|
||||
if (!$this->processInstallDefaultData())
|
||||
$this->printErrors();
|
||||
if (!$this->processPopulateDatabase())
|
||||
$this->printErrors();
|
||||
if (!$this->processConfigureShop())
|
||||
$this->printErrors();
|
||||
if (!$this->processInstallModules())
|
||||
$this->printErrors();
|
||||
if (!$this->processInstallAddonsModules())
|
||||
$this->printErrors();
|
||||
if (!$this->processInstallFixtures())
|
||||
$this->printErrors();
|
||||
if (!$this->processInstallTheme())
|
||||
$this->printErrors();
|
||||
if (!$this->processSendEmail())
|
||||
$this->printErrors();
|
||||
|
||||
$params = http_build_query(array(
|
||||
'email' => $this->datas->admin_email,
|
||||
'method' => 'addMemberToNewsletter',
|
||||
'language' => $this->datas->lang,
|
||||
'visitorType' => 1,
|
||||
'source' => 'installer'
|
||||
));
|
||||
Tools::file_get_contents('http://www.prestashop.com/ajax/controller.php?'.$params);
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : generateSettingsFile
|
||||
*/
|
||||
public function processGenerateSettingsFile()
|
||||
{
|
||||
return $this->model_install->generateSettingsFile(
|
||||
$this->datas->database_server,
|
||||
$this->datas->database_login,
|
||||
$this->datas->database_password,
|
||||
$this->datas->database_name,
|
||||
$this->datas->database_prefix,
|
||||
$this->datas->database_engine
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installDatabase
|
||||
* Create database structure
|
||||
*/
|
||||
public function processInstallDatabase()
|
||||
{
|
||||
$this->initializeContext();
|
||||
return $this->model_install->installDatabase($this->datas->database_clear);
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installDefaultData
|
||||
* Create default shop and languages
|
||||
*/
|
||||
public function processInstallDefaultData()
|
||||
{
|
||||
$this->initializeContext();
|
||||
return $this->model_install->installDefaultData($this->datas->shop_name, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : populateDatabase
|
||||
* Populate database with default data
|
||||
*/
|
||||
public function processPopulateDatabase()
|
||||
{
|
||||
$this->initializeContext();
|
||||
|
||||
$this->model_install->xml_loader_ids = $this->datas->xml_loader_ids;
|
||||
$result = $this->model_install->populateDatabase();
|
||||
$this->datas->xml_loader_ids = $this->model_install->xml_loader_ids;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : configureShop
|
||||
* Set default shop configuration
|
||||
*/
|
||||
public function processConfigureShop()
|
||||
{
|
||||
$this->initializeContext();
|
||||
|
||||
return $this->model_install->configureShop(array(
|
||||
'shop_name' => $this->datas->shop_name,
|
||||
'shop_activity' => $this->datas->shop_activity,
|
||||
'shop_country' => $this->datas->shop_country,
|
||||
'shop_timezone' => $this->datas->timezone,
|
||||
'use_smtp' => false,
|
||||
'smtp_server' => null,
|
||||
'smtp_login' => null,
|
||||
'smtp_password' => null,
|
||||
'smtp_encryption' => null,
|
||||
'smtp_port' => null,
|
||||
'admin_firstname' => $this->datas->admin_firstname,
|
||||
'admin_lastname' => $this->datas->admin_lastname,
|
||||
'admin_password' => $this->datas->admin_password,
|
||||
'admin_email' => $this->datas->admin_email,
|
||||
'configuration_agrement' => true,
|
||||
));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installModules
|
||||
* Install all modules in ~/modules/ directory
|
||||
*/
|
||||
public function processInstallModules()
|
||||
{
|
||||
$this->initializeContext();
|
||||
|
||||
return $this->model_install->installModules();
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installFixtures
|
||||
* Install fixtures (E.g. demo products)
|
||||
*/
|
||||
public function processInstallFixtures()
|
||||
{
|
||||
$this->initializeContext();
|
||||
|
||||
$this->model_install->xml_loader_ids = $this->datas->xml_loader_ids;
|
||||
$result = $this->model_install->installFixtures();
|
||||
$this->datas->xml_loader_ids = $this->model_install->xml_loader_ids;
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installTheme
|
||||
* Install theme
|
||||
*/
|
||||
public function processInstallTheme()
|
||||
{
|
||||
$this->initializeContext();
|
||||
|
||||
return $this->model_install->installTheme();
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : sendEmail
|
||||
* Send information e-mail
|
||||
*/
|
||||
public function processSendEmail()
|
||||
{
|
||||
require_once _PS_INSTALL_MODELS_PATH_.'mail.php';
|
||||
$mail = new InstallModelMail(
|
||||
$this->datas->use_smtp,
|
||||
$this->datas->smtp_server,
|
||||
$this->datas->smtp_login,
|
||||
$this->datas->smtp_password,
|
||||
$this->datas->smtp_port,
|
||||
$this->datas->smtp_encryption,
|
||||
$this->datas->admin_email
|
||||
);
|
||||
|
||||
if (file_exists(_PS_INSTALL_LANGS_PATH_.$this->language->getLanguageIso().'/mail_identifiers.txt'))
|
||||
$content = file_get_contents(_PS_INSTALL_LANGS_PATH_.$this->language->getLanguageIso().'/mail_identifiers.txt');
|
||||
else
|
||||
$content = file_get_contents(_PS_INSTALL_LANGS_PATH_.InstallLanguages::DEFAULT_ISO.'/mail_identifiers.txt');
|
||||
|
||||
$vars = array(
|
||||
'{firstname}' => $this->datas->admin_firstname,
|
||||
'{lastname}' => $this->datas->admin_lastname,
|
||||
'{shop_name}' => $this->datas->shop_name,
|
||||
'{passwd}' => $this->datas->admin_password,
|
||||
'{email}' => $this->datas->admin_email,
|
||||
'{shop_url}' => Tools::getHttpHost(true).__PS_BASE_URI__,
|
||||
);
|
||||
$content = str_replace(array_keys($vars), array_values($vars), $content);
|
||||
|
||||
$mail->send(
|
||||
$this->l('%s - Login information', $this->datas->shop_name),
|
||||
$content
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* PROCESS : installModulesAddons
|
||||
* Install modules from addons
|
||||
*/
|
||||
public function processInstallAddonsModules()
|
||||
{
|
||||
return $this->model_install->installModulesAddons();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,28 +227,29 @@ class InstallControllerHttpConfigure extends InstallControllerHttp
|
||||
{
|
||||
// List of activities
|
||||
$list_activities = array(
|
||||
$this->l('Lingerie and Adult'),
|
||||
$this->l('Animals and Pets'),
|
||||
$this->l('Art and Culture'),
|
||||
$this->l('Babies'),
|
||||
$this->l('Beauty and Personal Care'),
|
||||
$this->l('Cars'),
|
||||
$this->l('Computer Hardware and Software'),
|
||||
$this->l('Download'),
|
||||
$this->l('Fashion and accessories'),
|
||||
$this->l('Flowers, Gifts and Crafts'),
|
||||
$this->l('Food and beverage'),
|
||||
$this->l('HiFi, Photo and Video'),
|
||||
$this->l('Home and Garden'),
|
||||
$this->l('Home Appliances'),
|
||||
$this->l('Jewelry'),
|
||||
$this->l('Mobile and Telecom'),
|
||||
$this->l('Services'),
|
||||
$this->l('Shoes and accessories'),
|
||||
$this->l('Sports and Entertainment'),
|
||||
$this->l('Travel'),
|
||||
1 => $this->l('Lingerie and Adult'),
|
||||
2 => $this->l('Animals and Pets'),
|
||||
3 => $this->l('Art and Culture'),
|
||||
4 => $this->l('Babies'),
|
||||
5 => $this->l('Beauty and Personal Care'),
|
||||
6 => $this->l('Cars'),
|
||||
7 => $this->l('Computer Hardware and Software'),
|
||||
8 => $this->l('Download'),
|
||||
9 => $this->l('Fashion and accessories'),
|
||||
10 => $this->l('Flowers, Gifts and Crafts'),
|
||||
11 => $this->l('Food and beverage'),
|
||||
12 => $this->l('HiFi, Photo and Video'),
|
||||
13 => $this->l('Home and Garden'),
|
||||
14 => $this->l('Home Appliances'),
|
||||
15 => $this->l('Jewelry'),
|
||||
16 => $this->l('Mobile and Telecom'),
|
||||
17 => $this->l('Services'),
|
||||
18 => $this->l('Shoes and accessories'),
|
||||
19 => $this->l('Sports and Entertainment'),
|
||||
20 => $this->l('Travel'),
|
||||
);
|
||||
sort($list_activities);
|
||||
|
||||
asort($list_activities);
|
||||
$this->list_activities = $list_activities;
|
||||
|
||||
// Countries list
|
||||
|
||||
@@ -66,7 +66,7 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
Shop::setContext(Shop::CONTEXT_SHOP, 1);
|
||||
Configuration::loadConfiguration();
|
||||
Context::getContext()->language = new Language(Configuration::get('PS_LANG_DEFAULT'));
|
||||
Context::getContext()->country = new Country('PS_COUNTRY_DEFAULT');
|
||||
Context::getContext()->country = new Country(Configuration::get('PS_COUNTRY_DEFAULT'));
|
||||
Context::getContext()->cart = new Cart();
|
||||
Context::getContext()->employee = new Employee(1);
|
||||
define('_PS_SMARTY_FAST_LOAD_', true);
|
||||
@@ -95,7 +95,9 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
$this->processConfigureShop();
|
||||
elseif (Tools::getValue('installModules') && !empty($this->session->process_validated['configureShop']))
|
||||
$this->processInstallModules();
|
||||
elseif (Tools::getValue('installFixtures') && !empty($this->session->process_validated['installModules']))
|
||||
elseif (Tools::getValue('installModulesAddons') && !empty($this->session->process_validated['installModules']))
|
||||
$this->processInstallAddonsModules();
|
||||
elseif (Tools::getValue('installFixtures') && !empty($this->session->process_validated['installModulesAddons']))
|
||||
$this->processInstallFixtures();
|
||||
elseif (Tools::getValue('installTheme') && !empty($this->session->process_validated['installModules']))
|
||||
$this->processInstallTheme();
|
||||
@@ -231,6 +233,23 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
$this->session->process_validated = array_merge($this->session->process_validated, array('installModules' => true));
|
||||
$this->ajaxJsonAnswer(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installModulesAddons
|
||||
* Install modules from addons
|
||||
*/
|
||||
public function processInstallAddonsModules()
|
||||
{
|
||||
$this->initializeContext();
|
||||
if ($module = Tools::getValue('module') && $id_module = Tools::getValue('id_module'))
|
||||
$result = $this->model_install->installModulesAddons(array('name' => $module, 'id_module' => $id_module));
|
||||
else
|
||||
$result = $this->model_install->installModulesAddons();
|
||||
if (!$result || $this->model_install->getErrors())
|
||||
$this->ajaxJsonAnswer(false, $this->model_install->getErrors());
|
||||
$this->session->process_validated = array_merge($this->session->process_validated, array('installModulesAddons' => true));
|
||||
$this->ajaxJsonAnswer(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* PROCESS : installFixtures
|
||||
@@ -333,12 +352,24 @@ class InstallControllerHttpProcess extends InstallControllerHttp
|
||||
$this->process_steps[] = $populate_step;
|
||||
$this->process_steps[] = array('key' => 'configureShop', 'lang' => $this->l('Configure shop information'));
|
||||
|
||||
|
||||
$install_modules = array('key' => 'installModules', 'lang' => $this->l('Install modules'));
|
||||
if ($low_memory)
|
||||
foreach ($this->model_install->getModulesList() as $module)
|
||||
$install_modules['subtasks'][] = array('module' => $module);
|
||||
$this->process_steps[] = $install_modules;
|
||||
|
||||
$install_modules = array('key' => 'installModulesAddons', 'lang' => $this->l('Install modules Addons'));
|
||||
|
||||
$params = array('iso_lang' => $this->language->getLanguageIso(),
|
||||
'iso_country' => $this->session->shop_country,
|
||||
'email' => $this->session->admin_email,
|
||||
'shop_url' => Tools::getHttpHost(),
|
||||
'version' => _PS_INSTALL_VERSION_);
|
||||
|
||||
if ($low_memory)
|
||||
foreach ($this->model_install->getAddonsModulesList($params) as $module)
|
||||
$install_modules['subtasks'][] = array('module' => (string)$module['name'], 'id_module' => (string)$module['id_module']);
|
||||
$this->process_steps[] = $install_modules;
|
||||
|
||||
// Fixtures are installed only if option is selected
|
||||
if ($this->session->install_type == 'full')
|
||||
|
||||
@@ -74,7 +74,6 @@ class InstallControllerHttpSystem extends InstallControllerHttp
|
||||
if (!isset($this->tests['optional']))
|
||||
$this->tests['optional'] = $this->model_system->checkOptionalTests();
|
||||
|
||||
$session_path = @ini_get('session.save_path');
|
||||
// Generate display array
|
||||
$this->tests_render = array(
|
||||
'required' => array(
|
||||
@@ -87,7 +86,6 @@ class InstallControllerHttpSystem extends InstallControllerHttp
|
||||
'system' => $this->l('Cannot create new files and folders'),
|
||||
'gd' => $this->l('GD Library is not installed'),
|
||||
'mysql_support' => $this->l('MySQL support is not activated'),
|
||||
'sessions' => $this->l('Your PHP sessions path is not writable - check with your hosting provider:').' '.$session_path,
|
||||
)
|
||||
),
|
||||
array(
|
||||
@@ -139,5 +137,4 @@ class InstallControllerHttpSystem extends InstallControllerHttp
|
||||
|
||||
$this->displayTemplate('system');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -144,7 +144,7 @@ CREATE TABLE `PREFIX_carrier` (
|
||||
`max_width` int(10) DEFAULT 0,
|
||||
`max_height` int(10) DEFAULT 0,
|
||||
`max_depth` int(10) DEFAULT 0,
|
||||
`max_weight` int(10) DEFAULT 0,
|
||||
`max_weight` DECIMAL(20,6) DEFAULT 0,
|
||||
`grade` int(10) DEFAULT 0,
|
||||
PRIMARY KEY (`id_carrier`),
|
||||
KEY `deleted` (`deleted`,`active`),
|
||||
|
||||
@@ -42,13 +42,13 @@
|
||||
<attribute id="Black">
|
||||
<name>Black</name>
|
||||
</attribute>
|
||||
<attribute id="8Go">
|
||||
<attribute id="8GB">
|
||||
<name>8Go</name>
|
||||
</attribute>
|
||||
<attribute id="16Go">
|
||||
<attribute id="16GB">
|
||||
<name>16Go</name>
|
||||
</attribute>
|
||||
<attribute id="32Go">
|
||||
<attribute id="32GB">
|
||||
<name>32Go</name>
|
||||
</attribute>
|
||||
<attribute id="Purple">
|
||||
|
||||
@@ -4,10 +4,10 @@
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* This source file is subject to the Open Software License (OSL 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
|
||||
* http://opensource.org/licenses/osl-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.
|
||||
@@ -20,16 +20,22 @@
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2013 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
|
||||
header("Location: ../");
|
||||
exit;
|
||||
|
||||
/* Redefine REQUEST_URI */
|
||||
$_SERVER['REQUEST_URI'] = '/install/index_cli.php';
|
||||
require_once dirname(__FILE__).'/init.php';
|
||||
require_once _PS_INSTALL_PATH_.'classes/datas.php';
|
||||
ini_set('memory_limit', '128M');
|
||||
try
|
||||
{
|
||||
require_once _PS_INSTALL_PATH_.'classes/controllerConsole.php';
|
||||
InstallControllerConsole::execute($argc, $argv);
|
||||
echo '-- Installation successfull! --'."\n";
|
||||
}
|
||||
catch (PrestashopInstallerException $e)
|
||||
{
|
||||
$e->displayMessage();
|
||||
}
|
||||
@@ -24,4 +24,4 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
define('_PS_INSTALL_VERSION_', '1.5.4.0');
|
||||
define('_PS_INSTALL_VERSION_', '1.5.4.1');
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user