19 Commits

Author SHA1 Message Date
François Gaillard
e3d9613abf // Development branch merged 2013-03-27 10:43:43 +01:00
Damien Metzger
1d03f35748 Merge pull request #267 from dSkrbic/patch-1
// translations
2013-02-27 00:48:46 -08:00
dSkrbic
808fec8f4c // translations 2013-02-11 18:42:50 +01:00
Damien Metzger
3310d7582c // Fix upgrade 2012-12-31 15:17:35 +01:00
Damien Metzger
15b26ee239 // Changelog, readme and install_version.php 2012-12-31 14:37:29 +01:00
Rémi Gaillard
92a64c0c76 // oups.... 2012-12-31 13:52:28 +01:00
Rémi Gaillard
17aed56146 // small fix 2012-12-31 13:52:28 +01:00
Rémi Gaillard
7744068783 [-] FO: Fix retrocompatibility for modules and old themes 2012-12-31 13:52:27 +01:00
Damien Metzger
41798f3d8b // Just to be sure... 2012-12-31 13:52:27 +01:00
Damien Metzger
03101f3bab [-] BO : fixed accentuated URLs in products 2012-12-31 13:52:27 +01:00
PrestaEdit
1986ed9fef [-] Project: Fix bug when you want to upload (and resize) an image 2012-12-31 13:52:26 +01:00
Damien Metzger
a18eb5bebe // Missing part of a fix 2012-12-31 13:52:26 +01:00
Rémi Gaillard
23ecbcbeaa [-] FO: Fix PHP warning on category controller 2012-12-31 13:52:15 +01:00
Rémi Gaillard
2903ab096a [-] Installer: Fix #PSCFV-6392 redirect_type was missing on upgrade 2012-12-31 13:52:15 +01:00
vAugagneur
d571f91e74 Merge branch 'release' 2012-12-28 16:16:40 +01:00
vAugagneur
5cfd0c6f9a Merge branch 'release' 2012-12-28 10:40:40 +01:00
vAugagneur
e36548ad3c //updated CONTRIBUTING.md & CONTRIBUTORS.md thanks to @all 2012-11-30 10:56:18 +01:00
François Gaillard
4f269e87a4 // .DS_Store files added to .gitignore 2012-11-26 11:21:23 +01:00
vAugagneur
3eebb2d620 //added CONTRIBUTING.md CONTRIBUTORS.md README.md 2012-11-22 14:57:18 +01:00
818 changed files with 6376 additions and 15338 deletions

77
.gitignore vendored
View File

@@ -7,15 +7,6 @@
.DS_Store
robots.txt
sitemap.xml
cache/cachefs/*
!cache/cachefs/index.php
download/*
!download/index.php
upload/*
!upload/index.php
admin-dev/autoupgrade/*
admin-dev/backups/*
!admin-dev/backups/index.php
cache/smarty/cache/*
!cache/smarty/cache/index.php
cache/smarty/compile/*
@@ -25,7 +16,6 @@ cache/tcpdf/*
!cache/tcpdf/index.php
config/xml/*.xml
config/settings.inc.php
config/settings.old.php
log/*.log
img/*
!img/index.php
@@ -37,71 +27,6 @@ tools/smarty*/compile/*.php
override/classes/*.php
themes/default/cache/*.js
themes/default/cache/*.css
themes/default/modules/*/*.php
!themes/default/modules/*/index.php
themes/default/lang/*.php
!themes/default/lang/index.php
modules/*/translations/*.php
!modules/*/translations/index.php
mails/*
!mails/en
modules/*/mails/*
!modules/*/mails/en
translations/*
!translations/*.gzip
modules/atos/*
modules/addshoppers
modules/alliedwallet
modules/authorizeaim
modules/autoupgrade
modules/avalaratax
modules/backwardcompatibility
modules/canadapost
modules/cloudcache
modules/ebay
modules/fedexcarrier
modules/fianetfraud
modules/fianetsceau
modules/fidbag
modules/firstdata
modules/gadwords
modules/gamification
modules/ganalytics
modules/gsitemap
modules/hipay
modules/iadvize
modules/itembase
modules/jirafe
modules/kiala
modules/kialasmall
modules/klarnaprestashop
modules/kwixo
modules/livezilla
modules/mailjet
modules/merchantware
modules/mobile_theme
modules/mondialrelay
modules/moneybookers
modules/nqgatewayneteven
modules/ogone
modules/pagseguro
modules/paypal
modules/payulatam
modules/prediggo
modules/prestafraud
modules/shipwire
modules/shoppingfeedexport
modules/shoppingfluxexport
modules/socolissimo
modules/stripejs
modules/themeinstallator
modules/tntcarrier
modules/treepodia
modules/trustedshops
modules/trustly
modules/twenga
modules/upscarrier
modules/uspscarrier
modules/wexpay
modules/yotpo
modules/zingaya

View File

@@ -8,5 +8,5 @@ All core files you commit in your pull request must have Open Software License (
All modules files you commit in your pull request must have Academic Free License (AFL 3.0)
[1]: https://help.github.com/articles/using-pull-requests
[2]: http://docs.prestashop.com/display/PS15/Coding+Standards
[3]: http://docs.prestashop.com/display/PS15/How+to+write+a+commit+message
[2]: http://docs.prestashop.com/display/PS15/Coding+Standard
[3]: http://docs.prestashop.com/display/PS15/How+to+write+a+commit+message

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=address'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
Tools::redirect('index.php?controller=address'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=addresses'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
Tools::redirect('index.php?controller=addresses'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

View File

@@ -60,7 +60,7 @@
$tem[$k] = $v;
}
$tem['path'] = addslashes(backslashToSlash($path));
$tem['path'] = backslashToSlash($path);
$tem['type'] = "file";
$tem['size'] = transformFileSize($tem['size']);
$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
@@ -73,7 +73,7 @@
$info .= sprintf(", %s:'%s'", $k, $v);
}
$info .= sprintf(", url:'%s'", addslashes(getFileUrl($path)));
$info .= sprintf(", url:'%s'", getFileUrl($path));
$info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME);

View File

@@ -99,9 +99,9 @@
{
$v = transformFileSize($v);
}
echo (($j++ > 1)?",":'') . "'" . addslashes($k) . "':'" . addslashes($v) . "'";
echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'";
}
echo (($j++ > 1)?",":'') . "'url':'" . addslashes(getFileUrl($file['path'])) . "'";
echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'";
echo "}\n";
}
echo "};</script>\n";

View File

@@ -33,15 +33,15 @@
$this->fileInfo['atime'] = $this->fileStat[8];
$this->fileInfo['ctime'] = $this->fileStat[10];
$this->fileInfo['mtime'] = $this->fileStat[9];
$this->fileInfo['path'] = addslashes($path);
$this->fileInfo['name'] = addslashes(basename($path));
$this->fileInfo['path'] = $path;
$this->fileInfo['name'] = basename($path);
$this->fileInfo['is_writable'] = $this->isWritable();
$this->fileInfo['is_readable'] = $this->isReadable();
}elseif(is_dir($this->filePath))
{
$this->fileStat = @stat($path);
$this->fileInfo['name'] = addslashes(basename($path));
$this->fileInfo['path'] = addslashes($path);
$this->fileInfo['name'] = basename($path);
$this->fileInfo['path'] = $path;
$this->fileInfo['atime'] = $this->fileStat[8];
$this->fileInfo['ctime'] = $this->fileStat[10];
$this->fileInfo['mtime'] = $this->fileStat[9];

View File

@@ -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)

View File

@@ -25,5 +25,5 @@
*/
define('_PS_ADMIN_DIR_', getcwd());
require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require(_PS_ADMIN_DIR_.'/config/config.inc.php');
Controller::getController('GetFileController')->run();

View File

@@ -25,15 +25,12 @@ select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disab
.double_select select{width:300px;height:160px;}
.double_select a{text-align:center;display:block;border:1px solid #aaa;text-decoration:none;background-color:#fafafa;color:#123456;margin:2px;padding:2px}
.icon {vertical-align:middle}
.icon-top {vertical-align:top}
/*BUTTON*/
.button{
background: #e3e3e3 url('../img/bg-button-degrade.png') repeat-x scroll left top;
background: -moz-linear-gradient(center top , #F9F9F9, #E3E3E3) repeat scroll 0 0 transparent;
background: -webkit-gradient(linear, center top ,center bottom, from(#F9F9F9), to(#E3E3E3)) repeat scroll 0 0 transparent;
border-color: #CCCCCC #BBBBBB #A0A0A0;border-left: 1px solid #BBBBBB;border-radius: 3px 3px 3px 3px;border-right: 1px solid #BBBBBB;border-style: solid;border-width: 1px;color: #000000;margin: 0;outline: medium none;padding: 3px 8px;text-align: center;vertical-align: middle;white-space: nowrap; text-shadow:0 1px 0 #fff;}
border-color: #CCCCCC #BBBBBB #A0A0A0;border-left: 1px solid #BBBBBB;border-radius: 3px 3px 3px 3px;border-right: 1px solid #BBBBBB;border-style: solid;border-width: 1px;color: #000000;margin: 0; outline: medium none;padding: 3px 8px;text-align: center;vertical-align: middle;white-space: nowrap; text-shadow:0 1px 0 #fff;}
.button[disabled=disabled]{color:#8C8C8C}
.button.bt-icon { display:inline-block; margin-bottom:7px;}
.button.bt-icon span {padding-left:5px;}
@@ -121,8 +118,6 @@ input.button[disabled=disabled]:hover{background-color:#FFF6D3}
#header #menu .submenu li{list-style:none;margin:0;padding:0;display:block;min-width:150px;}
#header #menu .submenu li a{ font-size:12px;display:block;padding: 5px 15px 5px 10px; color:#666666;border-top:1px solid #fff; border-bottom:1px solid #ccc;}
#header #menu .submenu li a:hover { background-color:#eee; text-shadow:0 1px 0 #fff;}
#header #menu .submenu li.active a { color: #fff;}
#header #menu .submenu li.active a:hover { color:#666666}
/*SEPARATION*/
.separation { background-color:#ccc;border-bottom:1px solid #fff; width:100%; height:1px; margin:10px 0;}
@@ -537,7 +532,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
margin:0;
white-space: nowrap;
overflow: auto;
height: 370px;
height: 335px;
}
#modules_list_container_tab #modules_list_container_content li{display:inline-block;}
#modules_list_container_tab table tr th { height:40px;}
@@ -553,7 +548,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
#modules_list_container_tab .moduleDesc .metadata dl dd { padding-right:10px;}
#modules_list_container_tab .moduleDesc .metadata dl dt { font-weight:bold; padding-right:5px;}
#modules_list_container_tab .moduleDesc p.desc { color:#666; font-family: Georgia; font-style: italic; font-size:12px; text-align: left;white-space: normal;}
#modules_list_container_tab .setup {background-color:#6db300; font-weight:bold; font-size:10px; color:#fff; text-transform:uppercase; padding:0 10px; display: inline-block; border-radius:3px;}
#modules_list_container_tab .setup {background-color:#6db300; font-weight:bold; font-size:10px; color:#fff; text-transform:uppercase; padding:2px 10px; display: inline-block; border-radius:3px;}
#modules_list_container_tab .row-actions-module {float: right;}
#modules_list_container_tab .setup.non-install { background-color:#ec7000;}
#modules_list_container_tab .setup.must-have { background-color: #ec7000;}
@@ -567,8 +562,8 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
#modules_list_container_tab ul.listing-grid-module li select { position:absolute; top:0; right:0px; }
.default_modules_list_display_type #modules_list_container_content li table tr td{border: none}
.default_modules_list_display_type #modules_list_container_content li table {border:solid 1px #ccc;height:105px;width:100%;margin-bottom:10px}
#modules_list_container_tab ul li {height:105px}
.default_modules_list_display_type #modules_list_container_content li table {border: solid 1px #ccc; height: 140px;width: 100%;margin-bottom:15px}
#modules_list_container_tab ul li {height:140px}
/******** ie7 ******/
.ie7 #modules_list_container_tab #modules_list_container_content li{zoom:1;display:inline;}
@@ -669,8 +664,4 @@ ul.listForm li {padding-bottom:3px;}
/******** CREATE AN ORDER **************/
#carrier_form label{padding-top:0}
#carrier_form input{margin-top:3px}
/************** SCENE *****************/
#large_scene_image{clear:both;border:1px solid transparent;}
#carrier_form input{margin-top:3px}

View File

@@ -49,12 +49,10 @@
if (perm == 'all' && $(this).parent().parent().hasClass('parent'))
{
if (enabled)
$(this).parent().parent().parent().find('.child-'+id_tab+' input[type=checkbox]').attr('checked', 'checked');
else
$(this).parent().parent().parent().find('.child-'+id_tab+' input[type=checkbox]').removeAttr('checked');
checked = enabled ? 'checked': '';
$(this).parent().parent().parent().find('.child-'+id_tab+' input[type=checkbox]').attr('checked', checked);
$.ajax({
url: "{$link->getAdminLink('AdminAccess')|addslashes}",
url: "{$link->getAdminLink('AdminAccess')}",
cache: false,
data : {
ajaxMode : '1',
@@ -70,12 +68,15 @@
},
success : function(res,textStatus,jqXHR)
{
try {
try
{
if (res == 'ok')
showSuccessMessage("{l s='Update successful'}");
else
showErrorMessage("{l s='Update error'}");
} catch(e) {
}
catch(e)
{
jAlert('Technical error');
}
}
@@ -84,7 +85,7 @@
perfect_access_js_gestion(this, perm, id_tab, tabsize, tabnumber, table);
$.ajax({
url: "{$link->getAdminLink('AdminAccess')|addslashes}",
url: "{$link->getAdminLink('AdminAccess')}",
cache: false,
data : {
ajaxMode : '1',
@@ -133,7 +134,7 @@
});
$.ajax({
url: "{$link->getAdminLink('AdminAccess')|addslashes}",
url: "{$link->getAdminLink('AdminAccess')}",
cache: false,
data : {
ajaxMode: '1',
@@ -302,7 +303,7 @@
{assign var=is_child value=true}
{assign var=result_accesses value=0}
<tr class="child-{$child.id_parent}">
<td{if !$is_child} class="bold"{/if}>{if $is_child} &raquo; {/if}{$child.name}</td>
<td{if !$is_child} class="bold"{/if}>{if $is_child} &raquo; {/if}<strong>{$child.name}</strong></td>
{foreach $perms as $perm}
{if $access_edit == 1}
<td>

View File

@@ -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}

View File

@@ -1,39 +0,0 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/form/form.tpl"}
{block name="script"}
var string_price = '{l s="Will be applied when the price will be:" js=1}';
var string_weight = '{l s="Will be applied when the weight will be:" js=1}';
{/block}
{block name="field"}
{if $input.name == 'zones'}
{include file='controllers/carrier_wizard/helpers/form/form_ranges.tpl'}
<div class="new_range">
<a href="#" onclick="add_new_range();return false;" class="button" id="add_new_range">{l s="Add new range"}<img src="../img/admin/add.gif"/></a>
</div>
{/if}
{$smarty.block.parent}
{/block}

View File

@@ -1,56 +0,0 @@
<div style="float:left" id="zone_ranges">
<table cellpadding="5" cellspacing="0" id="zones_table">
<tr class="range_inf">
<td class="range_type"></td>
<td class="border_left border_bottom">>=</td>
{foreach from=$ranges key=r item=range}
<td class="border_bottom center"><input name="range_inf[{$range.id_range|intval}]" type="text" value="{$range.delimiter1|string_format:"%.6f"}" /></td>
{foreachelse}
<td class="border_bottom center"><input name="range_inf[{$range.id_range|intval}]" type="text" /></td>
{/foreach}
</tr>
<tr class="range_sup">
<td class="center range_type"></td>
<td class="border_left "><</td>
{foreach from=$ranges key=r item=range}
<td class="center"><input name="range_sup[{$range.id_range|intval}]" type="text" value="{$range.delimiter2|string_format:"%.6f"}" /></td>
{foreachelse}
<td class="center"><input name="range_sup[{$range.id_range|intval}]" type="text" /></td>
{/foreach}
</tr>
<tr class="fees_all">
<td class="border_top border_bottom border_bold"><span class="fees_all" {if $ranges|count == 0}style="display:none" {/if}>All</span></td>
<td></td>
{foreach from=$ranges key=r item=range}
<td class="center border_top border_bottom">
<input type="text" />
</td>
{foreachelse}
<td class="center border_top border_bottom">
<input style="display:none" type="text" />
<button class="button">{l s="Validate"}</button>
</td>
{/foreach}
</tr>
{foreach from=$zones key=i item=zone}
<tr class="fees {if $i is odd}alt_row{/if}" data-zoneid="{$zone.id_zone}">
<td>{$zone.name}</td>
<td class="zone"><input class="input_zone" name="zone_{$zone.id_zone}" value="1" type="checkbox" {if isset($fields_value[$input.name][$zone.id_zone])} checked="checked"{/if}/></td>
{foreach from=$ranges key=r item=range}
<td class="center"><input name="fees[{$zone.id_zone|intval}][{$range.id_range|intval}]" type="text" value="{if isset($price_by_range[$range.id_range][$zone.id_zone])} {$price_by_range[$range.id_range][$zone.id_zone]|string_format:"%.6f"} {/if}" /></td>
{/foreach}
</tr>
{/foreach}
<tr class="delete_range">
<td>&nbsp;</td>
<td>&nbsp;</td>
{foreach from=$ranges name=ranges key=r item=range}
{if $smarty.foreach.ranges.first}
<td class="center">&nbsp;</td>
{else}
<td class="center"><button class="button">{l s="Delete"}</button</td>
{/if}
{/foreach}
</tr>
</table>
</div>

View File

@@ -1,35 +0,0 @@
<?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
*/
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;

View File

@@ -1,59 +0,0 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{extends file="helpers/view/view.tpl"}
{block name="override_tpl"}
<script>
var labelNext = '{$labels.next|addslashes}';
var labelPrevious = '{$labels.previous|addslashes}';
var labelFinish = '{$labels.finish|addslashes}';
var labelDelete = '{l s="Delete" js=1}';
var labelValidate = '{l s="Validate" js=1}';
var validate_url = '{$validate_url|addslashes}';
var carrierlist_url = '{$carrierlist_url|addslashes}';
var nbr_steps = {$wizard_steps.steps|count};
var enableAllSteps = {if $enableAllSteps|intval == 1}true{else}false{/if};
</script>
<div id="carrier_wizard" class="swMain">
<ul class="nbr_steps_{$wizard_steps.steps|count}">
{foreach from=$wizard_steps.steps key=step_nbr item=step}
<li>
<a href="#step-{$step_nbr + 1}">
<label class="stepNumber">{$step_nbr + 1}</label>
<span class="stepDesc">
{$step.title}<br />
{if isset($step.desc)}<small>{$step.desc}</small>{/if}
</span>
</a>
</li>
{/foreach}
</ul>
{foreach from=$wizard_contents.contents key=step_nbr item=content}
<div id="step-{$step_nbr + 1}" style="padding-bottom:10px">
{$content}
</div>
{/foreach}
</div>
{/block}

View File

@@ -1,98 +0,0 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
<div id="carrier_logo_block" style="position:absolute;top:15px;right:15px">
<img id="carrier_logo_img" src="{if $carrier_logo}{$carrier_logo}{else}../img/404.gif{/if}" />
<p>
<input id="carrier_logo_input" type="file" onchange="uploadCarrierLogo();" name="carrier_logo_input" />
<input type="hidden" id="logo" name="logo" value="" />
</p>
<a id="carrier_logo_remove" {if !$carrier_logo}style="display:none"{/if} href="javascript:removeCarrierLogo();"><img src="../img/admin/disabled.gif" /> {l s='Remove the logo'}</a>
<p>
{l s='Format:'} JPG, GIF, PNG. {l s='Filesize:'} {$max_image_size|string_format:"%.2f"} {l s='MB max.'}
<br />{l s='Current size:'} <span id="carrier_logo_size">{l s='undefined'}</span>.
</p>
</div>
<script type="text/javascript">
var carrier_translation_undefined = '{l s='undefined' js='1'}';
function removeCarrierLogo()
{
$('#carrier_logo_img').attr('src', '../img/404.gif');
$('#logo').val('null');
fixCarrierLogoDisplay();
$('#carrier_logo_remove').hide();
}
function uploadCarrierLogo()
{
$.ajaxFileUpload({
url: 'ajax-tab.php?tab=AdminCarrierWizard&token={$token|addslashes}&action=uploadLogo',
secureuri: false,
fileElementId: 'carrier_logo_input',
dataType: 'xml',
success: function (data, status) {
data = data.getElementsByTagName('return')[0];
var message = data.getAttribute("message");
if (data.getAttribute("result") == "success")
{
$('#carrier_logo_img').attr('src', message);
$('#logo').val(message);
$('#carrier_logo_remove').show();
fixCarrierLogoDisplay();
}
else
alert(message);
}
});
}
function fixCarrierLogoDisplay()
{
$('<img/>').attr('src', $('#carrier_logo_img').attr('src')).load(function(){
var maxHeight = 200;
var maxWidth = 200;
var res = this.width / this.height;
$('#carrier_logo_size').text(this.width + 'x' + this.height + ' px');
$('#carrier_logo_img').width(this.width);
$('#carrier_logo_img').height(this.height);
if ($('#carrier_logo_img').width() > maxWidth)
{
$('#carrier_logo_img').width(maxWidth);
$('#carrier_logo_img').height(maxWidth / res);
}
if ($('#carrier_logo_img').height() > maxHeight)
{
$('#carrier_logo_img').height(maxHeight);
$('#carrier_logo_img').width(maxHeight * res);
}
if ($('#logo').val() == 'null')
$('#carrier_logo_size').text(carrier_translation_undefined);
});
}
fixCarrierLogoDisplay();
</script>

View File

@@ -1,63 +0,0 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @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 summary_translation_undefined = '{l s='[undefined]' js='1'}';
var summary_translation_meta_informations = '{l s='This carrier is @s1 and display to the customers the following delay: @s2.' js='1'}';
var summary_translation_free = '<strong>{l s='free' js='1'}</strong>';
var summary_translation_paid = '<strong>{l s='paid' js='1'}</strong>';
var summary_translation_range = '{l s='This carrier can deliver orders from @s1 to @s2. If the order is out of range, the behavior is to @s3.' js='1'}';
var summary_translation_shipping_cost = '{l s='The shipping cost is calculated @s1 and the tax rule @s2 is applied.' js='1'}';
var summary_translation_price = '<strong>{l s='according to the price' js='1'}</strong>';
var summary_translation_weight = '<strong>{l s='according to the weight' js='1'}</strong>';
</script>
<fieldset>
{l s='Carrier name:'} <strong id="summary_name"></strong>
<div class="clear">&nbsp;</div>
<div id="summary_meta_informations"></div>
<div class="clear">&nbsp;</div>
<div id="summary_shipping_cost"></div>
<div class="clear">&nbsp;</div>
<div id="summary_range"></div>
<div class="clear">&nbsp;</div>
<div>
{l s='It will be displayed only for the following zones:'}
<ul id="summary_zones"></ul>
</div>
<div class="clear">&nbsp;</div>
<div>
{l s='It will be displayed only for the following groups:'}
<ul id="summary_groups"></ul>
</div>
<div class="clear">&nbsp;</div>
<div>
{l s='It will be displayed only for the following shops:'}
<ul id="summary_shops"></ul>
</div>
</fieldset>

View File

@@ -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;display:none" 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" cellpadding="0" cellspacing="0">
{foreach from=$product_rule_groups item='product_rule_group'}
{$product_rule_group}
{/foreach}
</table>
<a href="javascript:addProductRuleGroup();" style="margin-top:5px;display:block">
<a href="javascript:addProductRuleGroup();">
<img src="../img/admin/add.gif" alt="{l s='Add'}" title="{l s='Add'}" /> {l s='Product selection'}
</a>
</div>

View File

@@ -25,7 +25,6 @@
function addProductRuleGroup()
{
$('#product_rule_group_table').show();
product_rule_groups_counter += 1;
product_rule_counters[product_rule_groups_counter] = 0;
@@ -85,13 +84,6 @@ 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;

View File

@@ -33,9 +33,9 @@
&nbsp;<img src="../img/admin/home.gif" alt="" />
{assign var=params_url value=""}
{else}
{assign var=params_url value="&id_category={$category.id_category|intval}&viewcategory"}
{assign var=params_url value="&id_category={$category.id_category}&viewcategory"}
{/if}
{if $category.id_category == $categories_tree_current_id}
{if $key == 0}
{$category.name}
{else}
<a href="{$currentIndex}{$params_url}&token={$token}">{$category.name}</a>&nbsp;>&nbsp;
@@ -43,7 +43,7 @@
{/foreach}
</div>
{if isset($delete_category) && $delete_category}
<form action="{$REQUEST_URI|escape:'htmlall':'UTF-8'}" method="post">
<form action="{$REQUEST_URI}" method="post">
<div class="warn">
<h2>
{if $need_delete_mode}
@@ -74,10 +74,10 @@
{if $key != 'deleteMode'}
{if is_array($value)}
{foreach $value as $val}
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}[]" value="{$val|escape:'htmlall':'UTF-8'}" />
<input type="hidden" name="{$key}[]" value="{$val}" />
{/foreach}
{else}
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}" value="{$value|escape:'htmlall':'UTF-8'}" />
<input type="hidden" name="{$key}" value="{$value}" />
{/if}
{/if}
{/foreach}

View File

@@ -48,21 +48,6 @@
</div>
{else}
{$smarty.block.parent}
{/if}
{/block}
{block name="label"}
{if $input.name == 'standardization'}
<div id="TAASC" style="display: none;">{$smarty.block.parent}
{else}
{$smarty.block.parent}
{/if}
{/block}
{block name="input"}
{if $input.name == 'standardization'}
{$smarty.block.parent}</div>
{else}
{$smarty.block.parent}
{/if}
{/block}
@@ -100,11 +85,7 @@
$('#need_zip_code_on, #need_zip_code_off').change(function() {
disableZipFormat();
});
$('#iso_code').change(function() {
disableTAASC();
});
disableTAASC();
});
function switchExplanationText(text) {

View File

@@ -60,7 +60,7 @@
ifSuperAdmin($(this));
$.ajax({
url: "{$link->getAdminLink('AdminEmployees')|addslashes}",
url: "{$link->getAdminLink('AdminEmployees')}",
cache: false,
data : {
ajax : '1',

View File

@@ -106,61 +106,63 @@
if ($(this).attr('name') == 'category_reduction['+$('[name="id_category"]:checked').val()+']')
{
exist = true;
jAlert('{l s='This category already exists for this group.' js='1'}');
jAlert('{l s='This category already exists for this group.'}');
return false;
}
});
if (exist)
return;
$.ajax({
type:"POST",
url: "ajax-tab.php",
async: true,
dataType: "json",
data : {
ajax: "1",
token: "{getAdminToken tab='AdminGroups'}",
controller: "AdminGroups",
action: "addCategoryReduction",
category_reduction: $('#category_reduction_fancybox').val() ,
id_category: $('[name="id_category"]:checked').val()
},
success : function(jsonData) {
if (jsonData.hasError)
type:"POST",
url: "ajax-tab.php",
async: true,
dataType: "json",
data : {
ajax: "1",
token: "{getAdminToken tab='AdminGroups'}",
controller: "AdminGroups",
action: "addCategoryReduction",
category_reduction: $('#category_reduction_fancybox').val() ,
id_category: $('[name="id_category"]:checked').val()
},
success : function(jsonData)
{
var errors = '';
for (error in jsonData.errors)
//IE6 bug fix
if (error != 'indexOf')
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
jAlert(errors);
if (jsonData.hasError)
{
var errors = '';
for(error in jsonData.errors)
//IE6 bug fix
if(error != 'indexOf')
errors += jsonData.errors[error] + "\n";
jAlert(errors);
}
else
{
$('#group_discount_category_table').append('<tr class="alt_row" id="'+jsonData.id_category+'"><td>'+jsonData.catPath+'</td><td>{l s='Discount:'}'+jsonData.discount+'{l s='%'}</td><td><a href="#" onclick="deleteCategoryReduction('+jsonData.id_category+');"><img src="../img/admin/delete.gif"></a></td></tr>');
var input_hidden = document.createElement("input");
input_hidden.setAttribute('type', 'hidden');
input_hidden.setAttribute('value', jsonData.discount);
input_hidden.setAttribute('name', 'category_reduction['+jsonData.id_category+']');
input_hidden.setAttribute('class', 'category_reduction');
$('#group_discount_category_table tr#'+jsonData.id_category+' > td:last').append(input_hidden);
$.fancybox.close();
}
}
else
{
$('#group_discount_category_table').append('<tr class="alt_row" id="'+jsonData.id_category+'"><td>'+jsonData.catPath+'</td><td>{l s='Discount:'}'+jsonData.discount+'{l s='%'}</td><td><a href="#" onclick="deleteCategoryReduction('+jsonData.id_category+');"><img src="../img/admin/delete.gif"></a></td></tr>');
var input_hidden = document.createElement("input");
input_hidden.setAttribute('type', 'hidden');
input_hidden.setAttribute('value', jsonData.discount);
input_hidden.setAttribute('name', 'category_reduction['+jsonData.id_category+']');
input_hidden.setAttribute('class', 'category_reduction');
$('#group_discount_category_table tr#'+jsonData.id_category+' > td:last').append(input_hidden);
$.fancybox.close();
}
}
});
});
return false;
}
function initFancyBox()
{
$('[name="id_category"]:checked').removeAttr('checked');
collapseAllCategories();
$('#category_reduction_fancybox').val('0.00');
}
function initFancyBox()
{
$('[name="id_category"]:checked').removeAttr('checked');
collapseAllCategories();
$('#category_reduction_fancybox').val('0.00');
}
</script>
<div class="margin-form">
<a class="button" href="#group_discount_category_fancybox" id="group_discount_category">{l s='Add a category discount'}</a>

View File

@@ -76,7 +76,7 @@
</form>
{/if}
{if isset($display_move) && $display_move}
{if isset($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 />

View File

@@ -50,14 +50,14 @@
console.log(truncateAuthorized);
if (truncateAuthorized)
{
if (!confirm('{l s='Are you sure that you would like to delete this' js=1}' + ' ' + $.trim($('#entity > option:selected').text().toLowerCase()) + '?'))
if (!confirm('{l s='Are you sure that you would like to delete this' js=1}' + ' ' + $.trim($('#entity > option:selected').text().toLowerCase()) + '{l s='?' js=1}'))
{
e.preventDefault();
}
}
else
{
jAlert('{l s='You do not have permission to delete here. When the multistore is enabled, only a SuperAdmin can delete all items before an import.' js='1'}');
jAlert('{l s='You do not have permission to delete here. When the multistore is enabled, only a SuperAdmin can delete all items before an import.'}');
return false;
}
}

View File

@@ -32,7 +32,7 @@
{
$.ajax({
type: 'GET',
url: '{$link->getAdminLink('AdminInformation')|addslashes}',
url: '{$link->getAdminLink('AdminInformation')}',
data: {
'action': 'checkFiles',
'ajax': 1

View File

@@ -22,79 +22,91 @@
* @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. %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">&copy; 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. /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">&copy; 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.</a></h2>
</div>

View File

@@ -38,7 +38,7 @@
{foreach $addresses AS $addresse}
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width: 600px;">
<tr>
<th><strong>{$addresse.firstname} {$addresse.lastname} <a href="{$link->getAdminLink('AdminManufacturers')}&id_address={$addresse.id_address}&editaddresses=1"><img src="../img/admin/edit.gif"></a></strong></th>
<th><strong>{$addresse.firstname} {$addresse.lastname}</strong></th>
</tr>
<tr>
<td>

View File

@@ -321,46 +321,6 @@
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}

View File

@@ -77,20 +77,9 @@
</dl>
</div>
<p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else}&nbsp;{/if}</p>
{if isset($module->message) && $module->type !== 'addonsNative' && $module->type != 'addonsMustHave'}<div class="conf">{$module->message}</div>{/if}
{if isset($module->message)}<div class="conf">{$module->message}</div>{/if}
<div class="row-actions-module">
{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}
&nbsp;
{/if}
{if !isset($module->not_on_disk)}{$module->optionsHtml}{else}&nbsp;{/if}
</div>
</div>
</td>

View File

@@ -26,16 +26,7 @@
<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> &raquo; <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>
@@ -58,7 +49,7 @@
</li>
{foreach from=$list_modules_categories item=module_category key=module_category_key}
<li {if isset($categoryFiltered[$module_category_key])}style="background-color:#EBEDF4"{/if} class="categoryModuleFilterLink">
<div class="categorieWidth"><a href="{$currentIndex}&token={$token}&filterCategory={$module_category_key}"><span>{$module_category.name}</span></a></div>
<div class="categorieWidth"><a href="{$currentIndex}&token={$token}&{if isset($categoryFiltered[$module_category_key])}un{/if}filterCategory={$module_category_key}"><span>{$module_category.name}</span></a></div>
<div class="count">{$module_category.nb}</div>
</li>
{/foreach}

View File

@@ -31,10 +31,10 @@
<td valign="top" width="32" align="center">
<img class="imgm" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}">
</td>
<td valign="top">
<td height="60" valign="top">
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
<h3>
{$module->displayName|truncate:36:'…'} {$module->version}
{$module->displayName|truncate:40:'…'} {$module->version}
{if isset($module->id) && $module->id gt 0 }
{if $module->active}
<span class="setup">{l s='Enabled'}</span>
@@ -52,7 +52,7 @@
</h3>
<p class="desc">
{if isset($module->description) && $module->description ne ''}
{$module->description|truncate:86:'…'}
{$module->description|truncate:100:'…'}
{else}
&nbsp;
{/if}
@@ -66,7 +66,7 @@
{else if !isset($module->not_on_disk)}
{$module->optionsHtml}
<div class="clear">&nbsp;</div>
<a href="#" class="button action_tab_module" data-option="select_{$module->name}" class="button">{l s='Submit'}</a>
<a href="#" class="button action_tab_module" data-option="select_{$module->name}" class="button">Valider</a>
{else}
<a href="{$module->options.install_url}" class="button">{l s='Install'}</a>
{/if}

View File

@@ -22,9 +22,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{if isset($controller) && !empty($controller) && $controller != 'adminnotfound'}
<h1>{l s='The controller %s is missing or invalid.' sprintf=$controller}</h1>
{/if}
<ul>
<li><a href="index.php">{l s='Go to the dashboard.'}</a></li>
<li><a href="#" onclick="window.history.back();">{l s='Back to the previous page.'}</a></li>

View File

@@ -22,23 +22,22 @@
* @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']|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>
{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>
<td>
<a href="index.php?controller=adminproducts&id_product={$product['product_id']|intval}&updateproduct&token={getAdminToken tab='AdminProducts'}">
<a href="index.php?controller=adminproducts&id_product={$product['product_id']}&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|intval}</span>
<span class="product_price_show">{displayPrice price=$product['product_price_wt'] currency=$currency->id}</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']|intval}" />
<input type="hidden" name="product_id_order_detail" class="edit_product_id_order_detail" value="{$product['id_order_detail']}" />
{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>
@@ -50,37 +49,32 @@
{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|intval}
{displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id}
{else}
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval}
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id}
{/if}
</td>
<td class="cancelQuantity standard_refund_fields current-edit" style="display:none" colspan="2">
&nbsp;
</td>
<td class="edit_product_fields" colspan="2" style="display:none">&nbsp;</td>
<td class="partial_refund_fields current-edit" style="text-align:left;display:none"></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}
<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>
</tr>
{foreach $product['customizedDatas'] as $customizationPerAddress}
{foreach $product.customizedDatas as $customizationPerAddress}
{foreach $customizationPerAddress as $customizationId => $customization}
<tr class="customized customized-{$product['id_order_detail']|intval}">
<tr class="customized customized-{$product.id_order_detail}">
<input type="hidden" class="edit_product_id_order_detail" value="{$product.id_order_detail}" />
<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>&nbsp;
<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>
<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>
</li>
{/foreach}
</ul>
@@ -99,7 +93,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|intval}]" class="edit_product_quantity" value="{$customization['quantity']|htmlentities}" size="2" />
<input type="text" name="product_quantity[{$customizationId}]" class="edit_product_quantity" value="{$customization['quantity']|htmlentities}" size="2" />
</span>
{/if}
</td>
@@ -110,38 +104,36 @@
</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|intval}
{displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id}
{else}
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id|intval}
{displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id}
{/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']|intval}" />
<input type="hidden" name="totalQty" id="totalQty" value="{$customization['quantity']|intval}" />
<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="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_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}/>
<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}/>
{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="cancelCustomizationQuantity[{$customizationId|intval}]" value="0" />
<input type="hidden" name="cancelQuantity[{$product['id_order_detail']}]" value="0" />
{elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))}
<input type="text" id="cancelQuantity_{$customizationId|intval}" name="cancelCustomizationQuantity[{$customizationId|intval}]" size="2" onclick="selectCheckbox(this);" value="" />0/{$customization['quantity']-$customization['quantity_refunded']}
<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']}
{/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']|intval}]" 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']}]" 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']|intval}]" />{$currency->suffix}</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">
</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}

View File

@@ -110,7 +110,7 @@
{if !isset($document->is_delivery)}
<tr id="invoiceNote{$document->id}" style="display:none" class="current-edit">
<td colspan="5">
<form action="{$current_index}&viewOrder&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}{/if}" method="post">
<form action="{$current_index}&viewOrder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}" method="post">
<p>
<label for="editNote{$document->id}" class="t">{l s='Note'}</label>
<input type="hidden" name="id_order_invoice" value="{$document->id}" />
@@ -130,7 +130,7 @@
<td colspan="5" class="center">
<h3>{l s='No documents are available'}</h3>
{if isset($invoice_management_active) && $invoice_management_active}
<p><a class="button" href="{$current_index}&viewOrder&submitGenerateInvoice&id_order={$order->id}{if isset($smarty.get.token)}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}{/if}">{l s='Generate invoice'}</a></p>
<p><a class="button" href="{$current_index}&viewOrder&submitGenerateInvoice&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">{l s='Generate invoice'}</a></p>
{/if}
</td>
</tr>

View File

@@ -24,11 +24,11 @@
*}
<table class="table" width="100%" cellspacing="0" cellpadding="0" id="shipping_table">
<colgroup>
<col width="15%"/>
<col width="15%"/>
<col width=""/>
<col width="10%"/>
<col width="20%"/>
<col width="15%">
<col width="15%">
<col width="">
<col width="10%">
<col width="20%">
</colgroup>
<thead>
<tr>
@@ -46,7 +46,7 @@
<td>{dateFormat date=$line.date_add full=true}</td>
<td>{$line.type}</td>
<td>{$line.carrier_name}</td>
<td class="weight">{$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}</td>
<td>{$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}</td>
<td>
{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}
{displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id}
@@ -55,7 +55,7 @@
{/if}
</td>
<td>
<span id="shipping_number_show">{if $line.url && $line.tracking_number}<a target="_blank" href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{else}{$line.tracking_number}{/if}</span>
<span id="shipping_number_show">{if $line.url && $line.tracking_number}<a href="{$line.url|replace:'@':$line.tracking_number}">{$line.tracking_number}</a>{else}{$line.tracking_number}{/if}</span>
{if $line.can_edit}
<form style="display: inline;" method="post" action="{$link->getAdminLink('AdminOrders')|escape:'htmlall':'UTF-8'}&vieworder&id_order={$order->id|escape:'htmlall':'UTF-8'}">
<span class="shipping_number_edit" style="display:none;">

View File

@@ -24,17 +24,17 @@
*}
<script type="text/javascript">
var id_cart = {$cart->id|intval};
var id_customer = 0;
var id_customer = '';
var changed_shipping_price = false;
var shipping_price_selected_carrier = '';
var current_index = '{$current}&token={$token}';
var admin_cart_link = '{$link->getAdminLink('AdminCarts')|addslashes}';
var admin_cart_link = '{$link->getAdminLink('AdminCarts')}';
var cart_quantity = new Array();
var currencies = new Array();
var id_currency = '';
var id_lang = '';
var txt_show_carts = '{l s='Show carts and orders for this customer.' js='1'}';
var txt_hide_carts = '{l s='Hide carts and orders for this customer.' js='1'}';
var txt_show_carts = '{l s='Show carts and orders for this customer.'}';
var txt_hide_carts = '{l s='Hide carts and orders for this customer.'}';
var defaults_order_state = new Array();
var customization_errors = false;
var pic_dir = '{$pic_dir}';
@@ -100,7 +100,7 @@
$('#show_old_carts').click();
$('#payment_module_name').change();
$.ajaxSetup({ type:"post" });
$("#voucher").autocomplete('{$link->getAdminLink('AdminCartRules')|addslashes}', {
$("#voucher").autocomplete('{$link->getAdminLink('AdminCartRules')}', {
minChars: 3,
max: 15,
width: 250,
@@ -157,7 +157,7 @@
free_shipping = 1;
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -217,7 +217,7 @@
e.preventDefault();
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -254,7 +254,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -288,7 +288,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -324,7 +324,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -351,7 +351,7 @@
$('#id_cart').val(id_cart);
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: false,
dataType: "json",
data : {
@@ -378,7 +378,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -401,7 +401,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -426,7 +426,7 @@
{
$.ajax({
type:"POST",
url : "{$link->getAdminLink('AdminOrders')|escape:'html'}",
url : "{$link->getAdminLink('AdminOrders')}",
async: true,
dataType: "json",
data : {
@@ -464,11 +464,10 @@
$('#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",
url : "{$link->getAdminLink('AdminCarts')|addslashes}",
url : "{$link->getAdminLink('AdminCarts')}",
async: false,
dataType: "json",
data : {
@@ -534,7 +533,7 @@
$('#products_part').show();
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
url: "{$link->getAdminLink('AdminOrders')}",
async: true,
dataType: "json",
data : {
@@ -661,17 +660,17 @@
{
$.each(this.customized_datas[this.id_product][this.id_product_attribute][id_address_delivery], function() {
var customized_desc = '';
if (this.datas[1].length)
if(this.datas[1].length)
{
$.each(this.datas[1],function() {
customized_desc += this.name + ': ' + this.value + '<br />';
customized_desc += this.name+':'+this.value+'<br />';
id_customization = this.id_customization;
});
}
if (this.datas[0] && this.datas[0].length)
if(this.datas[0] && this.datas[0].length)
{
$.each(this.datas[0],function() {
customized_desc += this.name + ': <img src="' + pic_dir + this.value + '_small" /><br />';
customized_desc += this.name+':<img src="'+pic_dir+this.value+'_small" /><br />';
id_customization = this.id_customization;
});
}
@@ -766,7 +765,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -822,7 +821,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -845,7 +844,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -868,7 +867,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {
@@ -899,7 +898,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
url: "{$link->getAdminLink('AdminOrders')}",
async: true,
dataType: "json",
data : {
@@ -957,7 +956,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
url: "{$link->getAdminLink('AdminCarts')}",
async: true,
dataType: "json",
data : {

View File

@@ -27,7 +27,7 @@
{block name="override_tpl"}
<script type="text/javascript">
var admin_order_tab_link = "{$link->getAdminLink('AdminOrders')|addslashes}";
var admin_order_tab_link = "{$link->getAdminLink('AdminOrders')}";
var id_order = {$order->id};
var id_lang = {$current_id_lang};
var id_currency = {$order->id_currency};
@@ -59,7 +59,7 @@
{assign var="hook_invoice" value={hook h="displayInvoice" id_order=$order->id}}
{if ($hook_invoice)}
<div style="float: right; margin: -40px 40px 10px 0;">{$hook_invoice}</div><br class="clear" />
<div style="float: right; margin: -40px 40px 10px 0;">{$hook_invoice}</div><br class="clear" />';
{/if}
<div class="bloc-command">
@@ -113,7 +113,9 @@
<form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post">
<select id="id_order_state" name="id_order_state">
{foreach from=$states item=state}
<option value="{$state['id_order_state']}"{if $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|stripslashes}</option>
{if $state['id_order_state'] != $currentState->id}
<option value="{$state['id_order_state']}">{$state['name']|stripslashes}</option>
{/if}
{/foreach}
</select>
<input type="hidden" name="id_order" value="{$order->id}" />
@@ -264,8 +266,8 @@
{if (!$order->valid && sizeof($currencies) > 1)}
<form method="post" action="{$currentIndex}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">
<p class="warn">{l s='Do not forget to update your exchange rate before making this change.'}</p>
<label>{l s='Do not forget to update your exchange rate before making this change.'}</label>
<p class="warn">{l s='Don\'t forget to update your conversion rate before making this change.'}</p>
<label>{l s='Don\'t forget to update your conversion rate before making this change.'}</label>
<select name="new_currency">
{foreach from=$currencies item=currency_change}
{if $currency_change['id_currency'] != $order->id_currency}

View File

@@ -25,12 +25,15 @@
{extends file="helpers/view/view.tpl"}
{block name="override_tpl"}
{if !$shop_context}
<div class="warn">{l s='You have more than one shop and must select one to configure payment.'}</div>
{else}
{if !$shop_context}
<div class="warn">{l s='You have more than one shop and must select one to configure payment.'}</div>
{else}
{if isset($modules_list)}
{$modules_list}
{/if}
<br />
{if $display_restrictions}
<br /><h2 class="space">{l s='Payment module restrictions'}</h2>
{foreach $lists as $list}
@@ -41,5 +44,5 @@
<br />
<div class='warn'>{l s='No payment module installed'}</div>
{/if}
{/if}
{/if}
{/block}

View File

@@ -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>/gi, "");
line = line.replace(/<\/tbody>/gi, "");
line = line.replace("<tbody>", "");
line = line.replace("</tbody>", "");
if (shops != false)
{
$.each(shops, function(key, value){

View File

@@ -43,7 +43,7 @@
$('document').ready( function() {
$(".check_product_name")
.autocomplete(
'{$link->getAdminLink('AdminProducts', true)|addslashes}', {
'{$link->getAdminLink('AdminProducts', true)}', {
minChars: 3,
max: 10,
width: $(".check_product_name").width(),

View File

@@ -25,7 +25,7 @@
<script type="text/javascript">
var Customer = new Object();
var product_url = '{$link->getAdminLink('AdminProducts', true)|addslashes}';
var product_url = '{$link->getAdminLink('AdminProducts', true)}';
var ecotax_tax_excl = parseFloat({$ecotax_tax_excl});
$(document).ready(function () {
Customer = {
@@ -56,7 +56,7 @@ $(document).ready(function () {
Customer.showLoader();
jQuery.ajax({
"type": "POST",
"url": "{$link->getAdminLink('AdminCustomers')|addslashes}",
"url": "{$link->getAdminLink('AdminCustomers')}",
"async": true,
"dataType": "json",
"data": {

View File

@@ -159,10 +159,7 @@
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$up_filename}" />
{/if}
<div class="conf">
<script>
delete_this_file = '{l s='Delete this file'}';
</script>
<a class="delete_virtual_product" id="delete_downloadable_product" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">
<a class="delete_virtual_product" id="delete_downloadable_product" onclick="return confirm('{l s='Delete this file'}')" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red">
<img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
</a>
</div>
@@ -176,7 +173,7 @@
</td>
<td class="col-right">
{$product->productDownload->getHtmlLink(false, true)}
<a href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red delete_virtual_product">
<a onclick="return confirm('{l s='Delete this file'})')" href="{$currentIndex}&deleteVirtualProduct=true&token={$token}&id_product={$product->id}" class="red delete_virtual_product">
<img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
</a>
</td>
@@ -230,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 />
{if isset($error_product_download)}{$error_product_download}{/if}
{$error_product_download}
{/if}
</table>
</div>

View File

@@ -90,7 +90,7 @@
var table = $('#selectTables select').val();
if (!table)
jAlert("{l s='Please choose a table.' js='1'}");
jAlert("{l s='Please choose a table.'}");
else
AddRequestSql(table);
});

View File

@@ -0,0 +1,105 @@
{*
* 2007-2013 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2013 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{$content}
<br /><br />
<h2>{l s='Fees by carrier, geographical zone and ranges'}</h2>
<form action="{$action_fees}" id="fees" name="fees" method="post">
<fieldset>
<legend><img src="../img/admin/delivery.gif" />{l s='Fees'}</legend>
{if empty($carriers)}
{l s='If you only have free carriers, there\'s no need to configure delivery prices.'}
{else}
<b>{l s='Carrier:'} </b>
<select name="id_carrier2" onchange="$('#fees').attr('action', $('#fees').attr('action')+'&id_carrier='+$(this).attr('value')+'#fees'); $('#fees').submit();">
{foreach $carriers AS $carrier}
<option value="{$carrier['id_carrier']|intval}" {if $carrier['id_carrier'] == $id_carrier} selected="selected"{/if}>{$carrier['name']}</option>
{/foreach}
</select><br />
<table class="table space" cellpadding="0" cellspacing="0">
<tr>
<th>{l s='Zone / Range'}</th>
{if !$carrierSelected->is_free}
{foreach $ranges AS $range}
<th style="font-size: 11px;">{$range['delimiter1']|floatval}{$suffix} {l s='to'} {$range['delimiter2']|floatval}{$suffix}</th>
{/foreach}
{/if}
</tr>
{if sizeof($ranges) && !$carrierSelected->is_free}
{if sizeof($zones) > 1}
<tr>
<th style="height: 30px;">{l s='All'}</th>
{foreach $ranges AS $range}
<td class="center">
{$currency->getSign('left')}
<input type="text" id="fees_all_{$range[$rangeIdentifier]}" onchange="this.value = this.value.replace(/,/g, '.');" onkeyup="if ((event.keyCode||event.which) != 9){ spreadFees({$range[$rangeIdentifier]})}" style="width: 45px;" />
{$currency->getSign('right')} {l s='(tax excl.)'}
</td>
{/foreach}
</tr>
{/if}
{foreach $zones AS $zone}
<tr>
<th style="height: 30px;">{$zone['name']}</th>
{foreach $ranges AS $range}
{if isset($deliveryArray[$zone['id_zone']][$id_carrier][$range[$rangeIdentifier]])}
{$price = $deliveryArray[$zone['id_zone']][$id_carrier][$range[$rangeIdentifier]]}
{else}
{$price = '0.00'}
{/if}
<td class="center">
{$currency->getSign('left')}
<input
type="text"
class="fees_{$range[$rangeIdentifier]}"
onchange="this.value = this.value.replace(/,/g, '.');" name="fees_{$zone['id_zone']}_{$range[$rangeIdentifier]}" onkeyup="clearAllFees({$range[$rangeIdentifier]})"
value="{$price|string_format:"%.6f"}"
style="width: 45px;"
/>
{$currency->getSign('right')} {l s='(tax excl.)'}
</td>
{/foreach}
</tr>
{/foreach}
{/if}
<tr>
<td colspan="{$ranges|sizeof + 1}" class="center" style="border-bottom: none; height: 40px;">
<input type="hidden" name="submitFees{$table}" value="1" />
{if sizeof($ranges) && !$carrierSelected->is_free}
<input type="submit" value="{l s=' Save '}" class="button" />
{else if $carrierSelected->is_free}
{l s='This is a free carrier'}
{else}
{l s='No ranges is set for this carrier'}
{/if}
</td>
</tr>
</table>
{/if}
<input type="hidden" name="id_carrier" value="{$id_carrier}" />
</fieldset>
</form>

View File

@@ -31,5 +31,5 @@ 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: ../../../../../../../');
header('Location: ../../../../../../');
exit;

View File

@@ -24,9 +24,9 @@
*}
<a href="{$href}" class="delete"
{if in_array($id_shop, $shops_having_dependencies)}
onclick="jAlert('{l s='You cannot delete this shop\'s (customer and/or order dependency)' js='1'}'); return false;"
onclick="jAlert('{l s='You cannot delete this shop\'s (customer and/or order dependency)'}'); return false;"
{elseif isset($confirm)}
onclick="if (confirm('{$confirm}')){ return true; } else { event.stopPropagation(); event.preventDefault();};"
onclick="if (confirm('{$confirm}')){ return true; }else{ event.stopPropagation(); event.preventDefault();};"
{/if} title="{$action}">
<img src="../img/admin/delete.gif" alt="{$action}" />
</a>

View File

@@ -186,7 +186,7 @@ $("#multishop-tree").jstree({
'plugins': ["themes","json_data","cookies","contextmenu"],
'json_data': {
'ajax': {
'url': "{$link->getAdminLink('AdminShop')|addslashes}",
'url': "{$link->getAdminLink('AdminShop')}",
'data': function(n)
{
return {

View File

@@ -25,7 +25,7 @@
<div id="statsContainer">
<div id="calendar">
<form action="{$current}&token={$token}{if $action && $table}&{$action|escape}{$table|escape}{/if}{if $identifier && $id}&{$identifier|escape}={$id|escape}{/if}" method="post" id="calendar_form" name="calendar_form">
<form action="{$current}&token={$token}{if $action && $table}&{$action}{$table}{/if}{if $identifier && $id}&{$identifier}={$id}{/if}" method="post" id="calendar_form" name="calendar_form">
<input type="submit" name="submitDateDay" class="button submitDateDay" value="{$translations.Day}">
<input type="submit" name="submitDateMonth" class="button submitDateMonth" value="{$translations.Month}">
<input type="submit" name="submitDateYear" class="button submitDateYear" value="{$translations.Year}">

View File

@@ -25,7 +25,7 @@
<br/>
<div class="blocEngine">
<form action="{$smarty.server.REQUEST_URI|escape}" method="post" id="settings_form" name="settings_form">
<form action="{$current}&token={$token}" method="post" id="settings_form" name="settings_form">
<h3 class="icon-{l s='Settings'}">{l s='Settings'}</h3>
<div class="rowForm">

View File

@@ -38,7 +38,7 @@
if (html == 'false')
{
$("#conf_id_PS_SHOP_STATE_ID").fadeOut();
$('#PS_SHOP_STATE_ID option[value=0]').attr("selected", "selected");
$('#id_state option[value=0]').attr("selected", "selected");
}
else
{

View File

@@ -30,44 +30,55 @@
<h2>{$supplier->name}</h2>
<h3>{l s='Number of products:'} {count($products)}</h3>
<table border="0" cellpadding="0" cellspacing="0" class="table" width="100%">
<tr>
<th>{l s='Product name'}</th>
<th>{l s='Attribute name'}</th>
<th>{l s='Supplier Reference'}</th>
<th>{l s='Wholesale price'}</th>
<th>{l s='Reference'}</th>
<th>{l s='EAN13'}</th>
<th>{l s='UPC'}</th>
{if $stock_management && $shopContext != Shop::CONTEXT_ALL}<th class="right">{l s='Available Quantity'}</th>{/if}
</tr>
{foreach $products AS $product}
<hr />
{if !$product->hasAttributes()}
<tr>
<td><a href="?tab=AdminProducts&id_product={$product->id}&updateproduct&token={getAdminToken tab='AdminProducts'}">{$product->name}</a></td>
<td>{l s='N/A'}</td>
<td>{if empty($product->product_supplier_reference)}{l s='N/A'}{else}{$product->product_supplier_reference}{/if}</td>
<td>{if empty($product->product_supplier_price_te)}0{else}{$product->product_supplier_price_te}{/if}</td>
<td>{if empty($product->reference)}{l s='N/A'}{else}{$product->reference}{/if}</td>
<td>{if empty($product->ean13)}{l s='N/A'}{else}{$product->ean13}{/if}</td>
<td>{if empty($product->upc)}{l s='N/A'}{else}{$product->upc}{/if}</td>
{if $stock_management && $shopContext != Shop::CONTEXT_ALL}<td class="right" width="150">{$product->quantity}</td>{/if}
</tr>
{else}
{foreach $product->combination AS $id_product_attribute => $product_attribute}
<tr {if $id_product_attribute %2}class="alt_row"{/if} >
<td><a href="?tab=AdminProducts&id_product={$product->id}&updateproduct&token={getAdminToken tab='AdminProducts'}">{$product->name}</a></td>
<td>{if empty($product_attribute.attributes)}{l s='N/A'}{else}{$product_attribute.attributes}{/if}</td>
<td>{if empty($product_attribute.product_supplier_reference)}{l s='N/A'}{else}{$product_attribute.product_supplier_reference}{/if}</td>
<td>{if empty($product_attribute.product_supplier_price_te)}0{else}{$product_attribute.product_supplier_price_te}{/if}</td>
<td>{if empty($product_attribute.reference)}{l s='N/A'}{else}{$product_attribute.reference}{/if}</td>
<td>{if empty($product_attribute.ean13)}{l s='N/A'}{else}{$product_attribute.ean13}{/if}</td>
<td>{if empty($product_attribute.upc)}{l s='N/A'}{else}{$product_attribute.upc}{/if}</td>
{if $stock_management && $shopContext != Shop::CONTEXT_ALL}<td class="right">{$product_attribute.quantity}</td>{/if}
<table border="0" cellpadding="0" cellspacing="0" class="table" style="">
<tr>
<th width="450">{l s='Name'} {$product->name}</th>
{if !empty($product->product_supplier_reference)}<th width="190">{l s='Supplier Reference:'} {$product->product_supplier_reference}</th>{/if}
{if !empty($product->product_supplier_price_te)}<th width="190">{l s='Wholesale price:'} {$product->product_supplier_price_te}</th>{/if}
{if !empty($product->reference)}<th width="150">{l s='Reference:'} {$product->reference}</th>{/if}
{if !empty($product->ean13)}<th width="120">{l s='EAN13:'} {$product->ean13}</th>{/if}
{if !empty($product->upc)}<th width="120">{l s='UPC:'} {$product->upc}</th>{/if}
{if $stock_management}<th class="right" width="150">{l s='Available Quantity:'} {$product->quantity}</th>{/if}
</tr>
{/foreach}
</table>
{else}
<h3><a href="?tab=AdminProducts&id_product={$product->id}&updateproduct&token={getAdminToken tab='AdminProducts'}">{$product->name}</a></h3>
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width:100%;">
<colgroup>
<col>
<col width="190">
<col width="190">
<col width="80">
<col width="80">
<col width="80">
<col width="80">
</colgroup>
<tr>
<th style="height:40px;">{l s='Attribute name'}</th>
<th>{l s='Supplier Reference'}</th>
<th >{l s='Wholesale price'}</th>
<th>{l s='Reference'}</th>
<th>{l s='EAN13'}</th>
<th>{l s='UPC'}</th>
{if $stock_management && $shopContext != Shop::CONTEXT_ALL}<th class="right">{l s='Available Quantity'}</th>{/if}
</tr>
{foreach $product->combination AS $id_product_attribute => $product_attribute}
<tr {if $id_product_attribute %2}class="alt_row"{/if} >
<td>{$product_attribute.attributes}</td>
<td>{$product_attribute.product_supplier_reference}</td>
<td>{$product_attribute.product_supplier_price_te}</td>
<td>{$product_attribute.reference}</td>
<td>{$product_attribute.ean13}</td>
<td>{$product_attribute.upc}</td>
{if $stock_management && $shopContext != Shop::CONTEXT_ALL}<td class="right">{$product_attribute.quantity}</td>{/if}
</tr>
{/foreach}
</table>
{/if}
{/foreach}
</table>
{/block}

View File

@@ -138,7 +138,7 @@
// check if it's possible to add the product
if (product_infos == null || $('#cur_product_name').val() == '')
{
jAlert('{l s='Please select at least one product.' js='1'}');
jAlert('{l s='Please select at least one product.'}');
return false;
}

View File

@@ -33,29 +33,22 @@
document.getElementById('typeTranslationForm').submit();
}
function addThemeSelect()
function addThemeSelect(el)
{
var list_type_for_theme = ['front', 'modules', 'pdf', 'mails'];
var type = $('select[name=type]').val();
var list_type_for_theme = [{foreach $translations_type_for_theme as $type}'{$type}', {/foreach}];
var type = el.value;
$('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();
addThemeSelect(this);
});
});
</script>
@@ -67,15 +60,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} &nbsp;</option>
{/foreach}
</select>
<select name="theme" style="float:left;margin-right:10px">
<option value="">{l s='Core (no theme selected)'}</option>
<select name="theme" style="float:left; margin-right:10px;">
{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} &nbsp;</option>
{/foreach}
</select>
{foreach $languages as $language}

View File

@@ -92,7 +92,7 @@
<br />
{foreach $modules_translations as $theme_name => $theme}
{if $theme_name}<h2>&gt;{l s='Theme:'} <a name="{$theme_name}">{$theme_name}</h2>{/if}
<h2>&gt;{l s='Theme:'} <a name="{$theme_name}">{if $theme_name === $default_theme_name}{l s='default'}{else}{$theme_name}{/if} </h2>
{foreach $theme as $module_name => $module}
<h3>{l s='Module:'} <a name="{$module_name}" style="font-style:italic">{$module_name}</a></h3>
{foreach $module as $template_name => $newLang}
@@ -107,7 +107,7 @@
{$missing_translations_module = 0}
{/if}
<fieldset>
<legend style="cursor : pointer" onclick="$('#{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}').slideToggle();">{if $theme_name}{$theme_name} - {/if}{$template_name}
<legend style="cursor : pointer" onclick="$('#{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}').slideToggle();">{if $theme_name === 'default'}{l s='default'}{else}{$theme_name}{/if} - {$template_name}
<font color="blue">{$newLang|count}</font> {l s='expressions'} (<font color="red">{$missing_translations_module}</font>)
</legend>
<div name="{$type}_div" id="{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}" style="display:{if $missing_translations_module}block{else}none{/if}">
@@ -117,7 +117,7 @@
<td style="width: 40%">{$key|stripslashes}</td>
<td>=
{* Prepare name string for md5() *}
{capture assign="name"}{strtolower($module_name)}{if $theme_name}_{strtolower($theme_name)}{/if}_{strtolower($template_name)}_{md5($key)}{/capture}
{capture assign="name"}{strtolower($module_name)}_{strtolower($theme_name)}_{strtolower($template_name)}_{md5($key)}{/capture}
{if $key|strlen < $textarea_sized}
<input type="text"
style="width: 450px{if empty($value.trad)};background:#FBB{/if}"

View File

@@ -22,31 +22,33 @@
* @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">&nbsp;</div>
</div>
<div style="clear:both;height:0;line-height:0">&nbsp;</div>
</div>
{if $display_footer}
{hook h="displayBackOfficeFooter"}
<div id="footer">
<div class="footerLeft">
<a href="http://www.prestashop.com/" target="_blank">PrestaShop&trade; {$ps_version}</a><br />
<span>{l s='Load time: '}{number_format(microtime(true) - $timer_start, 3, '.', '')}s</span>
<div style="clear:both;height:0;line-height:0">&nbsp;</div>
</div>
<div style="clear:both;height:0;line-height:0">&nbsp;</div>
</div>
<div class="footerRight">
{if $iso_is_fr}
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h &agrave; 18h
{/if}
|&nbsp;<a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</a>
|&nbsp;<a href="http://forge.prestashop.com" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|&nbsp;<a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">{l s='Forum'}</a>
{if $display_footer}
{hook h="displayBackOfficeFooter"}
<div id="footer">
<div class="footerLeft">
<a href="http://www.prestashop.com/" target="_blank">PrestaShop&trade; {$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 &agrave; 18h
{/if}
|&nbsp;<a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</a>
|&nbsp;<a href="http://forge.prestashop.com" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|&nbsp;<a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">{l s='Forum'}</a>
</div>
</div>
</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 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>

View File

@@ -69,7 +69,6 @@
var token_admin_customers = '{getAdminToken tab='AdminCustomers' slashes=1}';
var token_admin_customer_threads = '{getAdminToken tab='AdminCustomerThreads' slashes=1}';
var currentIndex = '{$currentIndex}';
var choose_language_translate = "{l s='Choose language' slashes=1 }";
</script>
{/if}
@@ -83,6 +82,7 @@
<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,15 +91,16 @@
<!--[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 *}
@@ -107,7 +108,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>
@@ -119,8 +120,8 @@
<p><a href="index.php?controller=AdminOrders&amp;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>
@@ -132,8 +133,8 @@
<p><a href="index.php?controller=AdminCustomers&amp;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>
@@ -145,8 +146,9 @@
<p><a href="index.php?tab=AdminCustomerThreads&amp;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}&nbsp;{$last_name}</strong></div>
@@ -155,13 +157,14 @@
<li><a href="{$link->getAdminLink('AdminEmployees')|escape:'htmlall':'UTF-8'}&id_employee={$employee->id}&amp;updateemployee">{l s='My preferences'}</a></li>
<li class="separator">&nbsp;</li>
<li><a id="header_logout" href="index.php?logout">{l s='logout'}</a></li>
{if {$base_url}}
<li class="separator">&nbsp;</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">&nbsp;</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&amp;token={getAdminToken tab='AdminSearch'}">
<input type="text" name="bo_query" id="bo_query" value="{$bo_query}" />
@@ -180,7 +183,8 @@
<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>
@@ -189,15 +193,19 @@
{/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}
@@ -205,25 +213,28 @@
<ul class="submenu">
{foreach from=$t.sub_tabs item=t2}
{if $t2.active}
<li{if $t2.current} class="active"{/if}><a href="{$t2.href|escape:'htmlall':'UTF-8'}">{if $t2.name eq ''}{$t2.class_name}{else}{$t2.name|escape:'htmlall':'UTF-8'}{/if}</a></li>
<li><a href="{$t2.href|escape:'htmlall':'UTF-8'}">{if $t2.name eq ''}{$t2.class_name}{else}{$t2.name|escape:'htmlall':'UTF-8'}{/if}</a></li>
{/if}
{/foreach}
</ul>
</li>
{/if}
{/foreach}
{/if}
{/foreach}
</ul>
</div>{* end header*}
{/if}
{/if}
</div>{* end header*}
<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:'}&nbsp;{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}

View File

@@ -30,7 +30,7 @@
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
{block name="defaultForm"}
<form id="{if isset($fields.form.form.id_form)}{$fields.form.form.id_form|escape:'htmlall':'UTF-8'}{else}{$table}_form{/if}" class="defaultForm {$name_controller}" action="{$current}&{if !empty($submit_action)}{$submit_action}=1{/if}&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}>
<form id="{$table}_form" class="defaultForm {$name_controller}" action="{$current}&{if !empty($submit_action)}{$submit_action}=1{/if}&token={$token}" method="post" enctype="multipart/form-data" {if isset($style)}style="{$style}"{/if}>
{if $form_id}
<input type="hidden" name="{$identifier}" id="{$identifier}" value="{$form_id}" />
{/if}

View File

@@ -35,33 +35,39 @@
buildTreeView(use_context);
});
</script>
<div class="category-filter">
<span><a href="#" id="collapse_all">{$categories.trads['Collapse All']}</a>|&nbsp;</span>
<span><a href="#" id="expand_all">{$categories.trads['Expand All']}</a>|&nbsp;</span>
<span><a href="#" id="collapse_all" >{$categories.trads['Collapse All']}</a>
|</span>
<span><a href="#" id="expand_all" >{$categories.trads['Expand All']}</a>
{if !$categories.use_radio}
<span><a href="#" id="check_all">{$categories.trads['Check All']}</a>|&nbsp;</span>
<span><a href="#" id="uncheck_all">{$categories.trads['Uncheck All']}</a>|&nbsp;</span>
{/if}
|</span>
<span></span><a href="#" id="check_all" >{$categories.trads['Check All']}</a>
|</span>
<span></span><a href="#" id="uncheck_all" >{$categories.trads['Uncheck All']}</a></span>
{/if}
{if $categories.use_search}
<span style="margin-left:20px">
{$categories.trads.search}:&nbsp;
{$categories.trads.search} :
<form method="post" id="filternameForm">
<input type="text" name="search_cat" id="search_cat"/>
<input type="text" name="search_cat" id="search_cat">
</form>
</span>
{/if}
</div>
{assign var=home_is_selected value=false}
{foreach $categories.selected_cat AS $cat}
{if is_array($cat)}
{if $cat.id_category != $categories.trads.Root.id_category}
<input {if in_array($cat.id_category, $categories.disabled_categories)}disabled="disabled"{/if} type="hidden" name="{$categories.input_name}" value="{$cat.id_category}"/>
<input {if in_array($cat.id_category, $categories.disabled_categories)}disabled="disabled"{/if} type="hidden" name="{$categories.input_name}" value="{$cat.id_category}" >
{else}
{assign var=home_is_selected value=true}
{/if}
{else}
{if $cat != $categories.trads.Root.id_category}
<input {if in_array($cat, $categories.disabled_categories)}disabled="disabled"{/if} type="hidden" name="{$categories.input_name}" value="{$cat}"/>
<input {if in_array($cat, $categories.disabled_categories)}disabled="disabled"{/if} type="hidden" name="{$categories.input_name}" value="{$cat}" >
{else}
{assign var=home_is_selected value=true}
{/if}
@@ -74,8 +80,8 @@
<input type="{if !$categories.use_radio}checkbox{else}radio{/if}"
name="{$categories.input_name}"
value="{$categories.trads.Root.id_category}"
{if $home_is_selected}checked="checked"{/if}
onclick="clickOnCategoryBox($(this));"/>
{if $home_is_selected}checked{/if}
onclick="clickOnCategoryBox($(this));" />
<span class="category_label">{$categories.trads.Root.name}</span>
{else}
&nbsp;
@@ -91,4 +97,4 @@
searchCategory();
</script>
{/if}
{/if}
{/if}

View File

@@ -116,8 +116,6 @@
{if isset($params.color) && isset($tr.color)}
</span>
{/if}
{/block}
{block name="close_td"}
</td>
{/block}
{/foreach}

View File

@@ -80,9 +80,6 @@
{if !$simple_header}
<form method="post" action="{$action}" class="form">
{block name="override_form_extra"}{/block}
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
{/if}
<table class="table_grid" name="list_table">
@@ -192,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($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}/>
{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}/>
{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}>

View File

@@ -31,7 +31,7 @@
{counter start=1 assign="count"}
{foreach from=$modules_list item=module}
<div style="width:400px">{include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",row alt"}}</div>
{if $count %3 == 0}
{if $count %2 == 0}
</li>
<li>
{/if}

View File

@@ -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
*}
{$export_precontent}{foreach from=$export_headers item=header}{$header};{/foreach}
{foreach from=$export_headers item=header}{$header};{/foreach}
{foreach from=$export_content item=line}
{foreach from=$line item=content}{$content};{/foreach}

View File

@@ -47,6 +47,7 @@
{/if}
</div>
{/if}
{if isset($informations) && count($informations) && $informations}
<div class="hint clear" style="display:block;">
<span id="see_more_infos">
@@ -59,6 +60,7 @@
</div>
</div><br />
{/if}
{if isset($confirmations) && count($confirmations) && $confirmations}
<div class="conf" style="display:block;">
{foreach $confirmations as $conf}
@@ -66,6 +68,7 @@
{/foreach}
</div><br />
{/if}
{if count($warnings)}
<div class="warn">
<span style="float:right">
@@ -91,5 +94,6 @@
{/if}
</div>
{/if}
{$page}
{include file='footer.tpl'}
{include file='footer.tpl'}

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=attachment'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
Tools::redirect('index.php?controller=attachment'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=authentication'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
Tools::redirect('index.php?controller=authentication'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=best-sales'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
Tools::redirect('index.php?controller=best-sales'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

View File

@@ -25,8 +25,6 @@
'AdminAttributesGroupsControllerCore' => 'controllers/admin/AdminAttributesGroupsController.php',
'AdminBackupController' => '',
'AdminBackupControllerCore' => 'controllers/admin/AdminBackupController.php',
'AdminCarrierWizardController' => '',
'AdminCarrierWizardControllerCore' => 'controllers/admin/AdminCarrierWizardController.php',
'AdminCarriersController' => '',
'AdminCarriersControllerCore' => 'controllers/admin/AdminCarriersController.php',
'AdminCartRulesController' => '',

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=category'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
Tools::redirect('index.php?controller=category'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=change-currency'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
Tools::redirect('index.php?controller=change-currency'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');

View File

@@ -222,7 +222,7 @@ class AddressCore extends ObjectModel
public function validateController($htmlentities = true)
{
$errors = parent::validateController($htmlentities);
if (!Configuration::get('VATNUMBER_MANAGEMENT') || !Configuration::get('VATNUMBER_CHECKING'))
if (!Configuration::get('VATNUMBER_CHECKING'))
return $errors;
include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php');
if (class_exists('VatNumber', false))
@@ -237,8 +237,6 @@ class AddressCore extends ObjectModel
*/
public static function getZoneById($id_address)
{
if(!isset($id_address) || empty($id_address))
return false;
if (isset(self::$_idZones[$id_address]))
return self::$_idZones[$id_address];
@@ -261,9 +259,6 @@ class AddressCore extends ObjectModel
*/
public static function isCountryActiveById($id_address)
{
if(!isset($id_address) || empty($id_address))
return false;
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT c.`active`
FROM `'._DB_PREFIX_.'address` a

View File

@@ -1676,9 +1676,9 @@ abstract class AdminTabCore
elseif (isset($params['float']))
echo rtrim(rtrim($tr[$key], '0'), '.');
elseif (isset($params['type']) && $params['type'] == 'date')
echo Tools::displayDate($tr[$key]);
echo Tools::displayDate($tr[$key], $this->context->language->id);
elseif (isset($params['type']) && $params['type'] == 'datetime')
echo Tools::displayDate($tr[$key],null , true);
echo Tools::displayDate($tr[$key], $this->context->language->id, true);
elseif (isset($tr[$key]))
{
if ($key == 'price')

View File

@@ -71,7 +71,7 @@ class AttributeCore extends ObjectModel
public function delete()
{
if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL)
if (!$this->hasMultishopEntries())
{
$result = Db::getInstance()->executeS('SELECT id_product_attribute FROM '._DB_PREFIX_.'product_attribute_combination WHERE id_attribute = '.(int)$this->id);
foreach ($result as $row)
@@ -343,4 +343,4 @@ class AttributeCore extends ObjectModel
return (is_numeric($position)) ? $position : -1;
}
}
}

View File

@@ -70,11 +70,6 @@ class AttributeGroupCore extends ObjectModel
public function add($autodate = true, $nullValues = false)
{
if ($this->group_type == 'color')
$this->is_color_group = 1;
else
$this->is_color_group = 0;
if ($this->position <= 0)
$this->position = AttributeGroup::getHigherPosition() + 1;
@@ -85,16 +80,11 @@ class AttributeGroupCore extends ObjectModel
public function update($nullValues = false)
{
if ($this->group_type == 'color')
$this->is_color_group = 1;
else
$this->is_color_group = 0;
$return = parent::update($nullValues);
Hook::exec('actionAttributeGroupSave', array('id_attribute_group' => $this->id));
return $return;
}
public static function cleanDeadCombinations()
{
$attribute_combinations = Db::getInstance()->executeS('
@@ -119,7 +109,7 @@ class AttributeGroupCore extends ObjectModel
public function delete()
{
if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL)
if (!$this->hasMultishopEntries())
{
/* Select children in order to find linked combinations */
$attribute_ids = Db::getInstance()->executeS('

View File

@@ -136,17 +136,27 @@ class Autoload
}
else
{
$filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE)
{
rename($filename_tmp, $filename);
@chmod($filename, 0664);
// Let's write index content in cache file
// In order to be sure that this file is correctly written, a check is done on the file content
$loop_protection = 0;
do
{
$integrity_is_ok = false;
file_put_contents($filename, $content, LOCK_EX);
if ($loop_protection++ > 10)
break;
// If the file content end with PHP tag, integrity of the file is ok
if (preg_match('#\?>\s*$#', file_get_contents($filename)))
$integrity_is_ok = true;
}
else
{
// $filename_tmp couldn't be written. $filename should be there anyway (even if outdated),
// no need to die.
error_log('Cannot write temporary file '.$filename_tmp);
while (!$integrity_is_ok);
if (!$integrity_is_ok)
{
file_put_contents($filename, '<?php return array(); ?>', LOCK_EX);
// Cannot use PrestaShopException in this context
die('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically');
}
}

View File

@@ -42,7 +42,7 @@ class BlowfishCore extends Crypt_Blowfish
$piece = substr($paddedtext, $x, 8);
$cipher_piece = parent::encrypt($piece);
$encoded = base64_encode($cipher_piece);
$ciphertext = $ciphertext.$encoded;
$ciphertext = $ciphertext.$encoded;
}
return $ciphertext.sprintf('%06d', $length);
}

View File

@@ -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_FLOAT, 'validate' => 'isFloat'),
'max_weight' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'),
'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'),
@@ -165,14 +165,6 @@ class CarrierCore extends ObjectModel
public function __construct($id = null, $id_lang = null)
{
parent::__construct($id, $id_lang);
/**
* keep retrocompatibility SHIPPING_METHOD_DEFAULT
* @deprecated 1.5.5
*/
if ($this->shipping_method == Carrier::SHIPPING_METHOD_DEFAULT)
$this->shipping_method = ((int)Configuration::get('PS_SHIPPING_METHOD') ? Carrier::SHIPPING_METHOD_WEIGHT : Carrier::SHIPPING_METHOD_PRICE);
/**
* keep retrocompatibility id_tax_rules_group
* @deprecated 1.5.0
@@ -378,12 +370,13 @@ class CarrierCore extends ObjectModel
*/
public static function getDeliveryPriceByRanges($range_table, $id_carrier)
{
$sql = 'SELECT d.`id_'.bqSQL($range_table).'`, d.id_carrier, d.id_zone, d.price
$range_table = pSQL($range_table);
$sql = 'SELECT d.id_'.$range_table.', d.id_carrier, d.id_zone, d.price
FROM '._DB_PREFIX_.'delivery d
LEFT JOIN `'._DB_PREFIX_.bqSQL($range_table).'` r ON r.`id_'.bqSQL($range_table).'` = d.`id_'.bqSQL($range_table).'`
LEFT JOIN '._DB_PREFIX_.$range_table.' r ON r.id_'.$range_table.' = d.id_'.$range_table.'
WHERE d.id_carrier = '.(int)$id_carrier.'
AND d.`id_'.bqSQL($range_table).'` IS NOT NULL
AND d.`id_'.bqSQL($range_table).'` != 0
AND d.id_'.$range_table.' IS NOT NULL
AND d.id_'.$range_table.' != 0
'.Carrier::sqlDeliveryRangeShop($range_table).'
ORDER BY r.delimiter1';
return Db::getInstance()->executeS($sql);
@@ -462,22 +455,6 @@ class CarrierCore extends ObjectModel
return $carriers;
}
public static function getIdTaxRulesGroupMostUsed()
{
return Db::getInstance()->getValue('
SELECT id_tax_rules_group
FROM (
SELECT COUNT(*) n, c.id_tax_rules_group
FROM '._DB_PREFIX_.'carrier c
JOIN '._DB_PREFIX_.'tax_rules_group trg ON (c.id_tax_rules_group = trg.id_tax_rules_group)
WHERE trg.active = 1
GROUP BY c.id_tax_rules_group
ORDER BY n DESC
LIMIT 1
) most_used'
);
}
public static function getDeliveredCountries($id_lang, $active_countries = false, $active_carriers = false, $contain_states = null)
{
@@ -490,9 +467,7 @@ class CarrierCore extends ObjectModel
ORDER BY s.`name` ASC');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT cl.*,c.*, cl.`name` AS country, zz.`name` AS zone
FROM `'._DB_PREFIX_.'country` c'.
Shop::addSqlAssociation('country', 'c').'
SELECT cl.*,c.*, cl.`name` AS country, zz.`name` AS zone FROM `'._DB_PREFIX_.'country` c
LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = '.(int)$id_lang.')
INNER JOIN (`'._DB_PREFIX_.'carrier_zone` cz INNER JOIN `'._DB_PREFIX_.'carrier` cr ON ( cr.id_carrier = cz.id_carrier AND cr.deleted = 0 '.
($active_carriers ? 'AND cr.active = 1) ' : ') ').'
@@ -590,8 +565,8 @@ class CarrierCore extends ObjectModel
}
$row['name'] = (strval($row['name']) != '0' ? $row['name'] : Configuration::get('PS_SHOP_NAME'));
$row['price'] = (($shipping_method == Carrier::SHIPPING_METHOD_FREE) ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier'], true, null, null, $id_zone));
$row['price_tax_exc'] = (($shipping_method == Carrier::SHIPPING_METHOD_FREE) ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier'], false, null, null, $id_zone));
$row['price'] = ($shipping_method == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier'], true, null, null, $id_zone));
$row['price_tax_exc'] = ($shipping_method == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier'], false, null, null, $id_zone));
$row['img'] = file_exists(_PS_SHIP_IMG_DIR_.(int)$row['id_carrier']).'.jpg' ? _THEME_SHIP_DIR_.(int)$row['id_carrier'].'.jpg' : '';
// If price is false, then the carrier is unavailable (carrier module)
@@ -735,7 +710,7 @@ class CarrierCore extends ObjectModel
*/
public function deleteDeliveryPrice($range_table)
{
$where = '`id_carrier` = '.(int)$this->id.' AND (`id_'.bqSQL($range_table).'` IS NOT NULL OR `id_'.bqSQL($range_table).'` = 0) ';
$where = '`id_carrier` = '.(int)$this->id.' AND (`id_'.$range_table.'` IS NOT NULL OR `id_'.$range_table.'` = 0) ';
if (Shop::getContext() == Shop::CONTEXT_ALL)
$where .= 'AND id_shop IS NULL AND id_shop_group IS NULL';
@@ -936,11 +911,9 @@ class CarrierCore extends ObjectModel
return false;
}
public function getRangeObject($shipping_method = false)
public function getRangeObject()
{
if (!$shipping_method)
$shipping_method = $this->getShippingMethod();
$shipping_method = $this->getShippingMethod();
if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT)
return new RangeWeight();
elseif ($shipping_method == Carrier::SHIPPING_METHOD_PRICE)
@@ -1058,9 +1031,9 @@ class CarrierCore extends ObjectModel
$sql = 'AND '.$alias.'.id_delivery = (
SELECT d2.id_delivery
FROM '._DB_PREFIX_.'delivery d2
WHERE d2.id_carrier = `'.bqSQL($alias).'`.id_carrier
AND d2.id_zone = `'.bqSQL($alias).'`.id_zone
AND d2.`id_'.bqSQL($range_table).'` = `'.bqSQL($alias).'`.`id_'.bqSQL($range_table).'`
WHERE d2.id_carrier = '.$alias.'.id_carrier
AND d2.id_zone = '.$alias.'.id_zone
AND d2.id_'.$range_table.' = '.$alias.'.id_'.$range_table.'
'.$where.'
ORDER BY d2.id_shop DESC, d2.id_shop_group DESC
LIMIT 1

View File

@@ -424,10 +424,9 @@ class CartCore extends ObjectModel
// Build SELECT
$sql->select('cp.`id_product_attribute`, cp.`id_product`, cp.`quantity` AS cart_quantity, cp.id_shop, pl.`name`, p.`is_virtual`,
pl.`description_short`, pl.`available_now`, pl.`available_later`, p.`id_product`, product_shop.`id_category_default`, p.`id_supplier`,
p.`id_manufacturer`, product_shop.`on_sale`, product_shop.`ecotax`, product_shop.`additional_shipping_cost`,
product_shop.`available_for_order`, product_shop.`price`, product_shop.`active`, product_shop.`unity`, product_shop.`unit_price_ratio`,
stock.`quantity` AS quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, p.`weight`,
p.`date_add`, p.`date_upd`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category,
p.`id_manufacturer`, product_shop.`on_sale`, product_shop.`ecotax`, product_shop.`additional_shipping_cost`, product_shop.`available_for_order`, product_shop.`price`, p.`weight`,
stock.`quantity` quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, product_shop.`active`, p.`date_add`,
p.`date_upd`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category,
CONCAT(cp.`id_product`, IFNULL(cp.`id_product_attribute`, 0), IFNULL(cp.`id_address_delivery`, 0)) AS unique_id, cp.id_address_delivery,
product_shop.`wholesale_price`, product_shop.advanced_stock_management, ps.product_supplier_reference supplier_reference');
@@ -632,8 +631,8 @@ class CartCore extends ObjectModel
{
$row2 = Db::getInstance()->getRow('
SELECT image_shop.`id_image` id_image, il.`legend`
FROM `'._DB_PREFIX_.'image` i
JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (i.id_image = image_shop.id_image AND image_shop.cover=1 AND image_shop.id_shop='.(int)$row['id_shop'].')
FROM `'._DB_PREFIX_.'image` i'.
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.')
WHERE i.`id_product` = '.(int)$row['id_product'].' AND image_shop.`cover` = 1'
);
@@ -954,7 +953,6 @@ 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);
@@ -1593,9 +1591,9 @@ class CartCore extends ObjectModel
*/
public function getPackageList($flush = false)
{
static $cache = array();
if (isset($cache[(int)$this->id]) && $cache[(int)$this->id] !== false && !$flush)
return $cache[(int)$this->id];
static $cache = false;
if ($cache !== false && !$flush)
return $cache;
$product_list = $this->getProducts();
// Step 1 : Get product informations (warehouse_list and carrier_list), count warehouse
@@ -1823,7 +1821,7 @@ class CartCore extends ObjectModel
);
}
}
$cache[(int)$this->id] = $final_package_list;
$cache = $final_package_list;
return $final_package_list;
}
@@ -2294,7 +2292,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)
@@ -2871,12 +2869,8 @@ class CartCore extends ObjectModel
{
$cart_rule['value_real'] -= $total_shipping;
$cart_rule['value_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;
$total_discounts -= $total_shipping;
$total_discounts_tax_exc -= $total_shipping_tax_exc;
// Update total shipping
$total_shipping = 0;
@@ -2959,8 +2953,12 @@ class CartCore extends ObjectModel
return false;
foreach ($this->getProducts() as $product)
if (!$product['active'] || !$product['available_for_order']
|| (!$product['allow_oosp'] && $product['stock_quantity'] < $product['cart_quantity']))
if (!$product['active']
|| (
!$product['allow_oosp'] && $product['stock_quantity'] < $product['cart_quantity']
)
|| !$product['available_for_order'])
return false;
return true;

View File

@@ -333,8 +333,11 @@ class CartRuleCore extends ObjectModel
return array();
$productRuleGroups = array();
$result = Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'cart_rule_product_rule_group WHERE id_cart_rule = '.(int)$this->id);
foreach ($result as $row)
$results = Db::getInstance()->executeS('
SELECT *
FROM '._DB_PREFIX_.'cart_rule_product_rule_group prg
WHERE prg.id_cart_rule = '.(int)$this->id, false);
foreach ($results as $row)
{
if (!isset($productRuleGroups[$row['id_product_rule_group']]))
$productRuleGroups[$row['id_product_rule_group']] = array('id_product_rule_group' => $row['id_product_rule_group'], 'quantity' => $row['quantity']);
@@ -530,21 +533,14 @@ class CartRuleCore extends ObjectModel
return (!$display_error) ? false : Tools::displayError('You have not reached the minimum amount required to use this voucher');
}
/* This loop checks:
- if the voucher is already in the cart
- if a non compatible voucher is in the cart
- if there are products in the cart (gifts excluded)
Important note: this MUST be the last check, because if the tested cart rule has priority over a non combinable one in the cart, we will switch them
*/
$nb_products = Cart::getNbProducts($context->cart->id);
// Check if the voucher is already in the cart of if a non compatible voucher is in the cart
// Important note: this MUST be the last check, because if the tested cart rule has priority over a non combinable one in the cart, we will switch them
$otherCartRules = $context->cart->getCartRules();
if (count($otherCartRules))
foreach ($otherCartRules as $otherCartRule)
{
if ($otherCartRule['id_cart_rule'] == $this->id && !$alreadyInCart)
return (!$display_error) ? false : Tools::displayError('This voucher is already in your cart');
if ($otherCartRule['gift_product'])
--$nb_products;
if ($this->cart_rule_restriction && $otherCartRule['cart_rule_restriction'] && $otherCartRule['id_cart_rule'] != $this->id)
{
$combinable = Db::getInstance()->getValue('
@@ -565,9 +561,6 @@ class CartRuleCore extends ObjectModel
}
}
if (!$nb_products)
return (!$display_error) ? false : Tools::displayError('Cart is empty');
if (!$display_error)
return true;
}
@@ -637,8 +630,7 @@ class CartRuleCore extends ObjectModel
FROM `'._DB_PREFIX_.'cart_product` cp
LEFT JOIN `'._DB_PREFIX_.'category_product` catp ON cp.id_product = catp.id_product
WHERE cp.`id_cart` = '.(int)$context->cart->id.'
AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').')
AND cp.`id_product` <> '.(int)$this->gift_product);
AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').')');
$countMatchingProducts = 0;
$matchingProductsList = array();
foreach ($cartCategories as $cartCategory)
@@ -920,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 = Tools::ps_round($cart_vat_amount / $cart_amount_te, 3);
$cart_average_vat_rate = $cart_vat_amount / $cart_amount_te;
if ($this->reduction_tax && !$use_tax)
$reduction_value += $prorata * $reduction_amount / (1 + $cart_average_vat_rate);
@@ -1087,12 +1079,12 @@ class CartRuleCore extends ObjectModel
if (!CartRule::isFeatureActive() || !Validate::isLoadedObject($context->cart))
return;
$sql = '
$result = Db::getInstance()->executeS('
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 ? 'LEFT JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crca.id_carrier AND c.deleted = 0)' : '').'
'.($context->cart->id_carrier ? 'INNER 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 = ""
@@ -1116,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 AND cg.id_group = '.(int)$context->customer->id_default_group.')
LEFT JOIN '._DB_PREFIX_.'cart_rule_group crg ON cg.id_group = crg.id_group
WHERE cr.id_cart_rule = crg.id_cart_rule
AND cg.id_customer = '.(int)$context->customer->id.' LIMIT 1
AND cg.id_customer = '.(int)$context->customer->id.'
)' : '').'
)
AND (
@@ -1130,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';
$result = Db::getInstance()->executeS($sql);
ORDER BY priority');
if ($result)
{
$cart_rules = ObjectModel::hydrateCollection('CartRule', $result);

View File

@@ -510,7 +510,7 @@ class CategoryCore extends ObjectModel
die(Tools::displayError());
$groups = FrontController::getCurrentCustomerGroups();
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '='.(int)Group::getCurrent()->id);
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('
SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description
@@ -684,7 +684,8 @@ class CategoryCore extends ObjectModel
else
return new Category($shop->getCategory(), $id_lang);
$is_more_than_one_root_category = count(Category::getCategoriesWithoutParent()) > 1;
if (Shop::isFeatureActive() && $is_more_than_one_root_category && Shop::getContext() != Shop::CONTEXT_SHOP)
if ((!Shop::isFeatureActive() && $is_more_than_one_root_category) ||
Shop::isFeatureActive() && $is_more_than_one_root_category && Shop::getContext() != Shop::CONTEXT_SHOP)
$category = Category::getTopCategory($id_lang);
else
$category = new Category($shop->getCategory(), $id_lang);

View File

@@ -505,9 +505,9 @@ class ConfigurationCore extends ObjectModel
if ($id_shop)
return ' AND id_shop = '.(int)$id_shop;
elseif ($id_shop_group)
return ' AND id_shop_group = '.(int)$id_shop_group.' AND (id_shop IS NULL OR id_shop = 0)';
return ' AND id_shop_group = '.(int)$id_shop_group.' AND id_shop IS NULL';
else
return ' AND (id_shop_group IS NULL OR id_shop_group = 0) AND (id_shop IS NULL OR id_shop = 0)';
return ' AND id_shop_group IS NULL AND id_shop IS NULL';
}
/**

View File

@@ -47,6 +47,7 @@ class ConfigurationTestCore
'upload' => false,
'gd' => false,
'mysql_support' => false,
'sessions' => false,
'config_dir' => 'config',
'cache_dir' => 'cache',
'sitemap' => 'sitemap.xml',
@@ -54,9 +55,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'
@@ -266,24 +267,21 @@ class ConfigurationTestCore
public static function test_theme_lang_dir($dir)
{
$absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/');
if (!file_exists($absoluteDir))
return true;
if (!file_exists($dir))
return true;
return ConfigurationTest::test_dir($dir, true);
}
public static function test_theme_pdf_lang_dir($dir)
{
$absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/');
if (!file_exists($absoluteDir))
if (!file_exists($dir))
return true;
return ConfigurationTest::test_dir($dir, true);
}
public static function test_theme_cache_dir($dir)
{
$absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/');
if (!file_exists($absoluteDir))
if (!file_exists($dir))
return true;
return ConfigurationTest::test_dir($dir, true);
}
@@ -319,4 +317,4 @@ class ConfigurationTestCore
{
return extension_loaded('Dom');
}
}
}

View File

@@ -61,37 +61,32 @@ class ConnectionsSourceCore extends ObjectModel
$cookie = Context::getContext()->cookie;
if (!isset($cookie->id_connections) || !Validate::isUnsignedId($cookie->id_connections))
return false;
// If the referrer is not correct, we drop the connection
if (isset($_SERVER['HTTP_REFERER']) && !Validate::isAbsoluteUrl($_SERVER['HTTP_REFERER']))
return false;
// If there is no referrer and we do not want to save direct traffic (as opposed to referral traffic), we drop the connection
if (!isset($_SERVER['HTTP_REFERER']) && !Configuration::get('TRACKING_DIRECT_TRAFFIC'))
return false;
$source = new ConnectionsSource();
// There are a few more operations if there is a referrer
if (isset($_SERVER['HTTP_REFERER']))
if (isset($_SERVER['HTTP_REFERER']) && Validate::isAbsoluteUrl($_SERVER['HTTP_REFERER']))
{
// If the referrer is internal (i.e. from your own website), then we drop the connection
$parsed = parse_url($_SERVER['HTTP_REFERER']);
$parsed_host = parse_url(Tools::getProtocol().Tools::getHttpHost(false, false).__PS_BASE_URI__);
if ((!isset($parsed['path']) ||!isset($parsed_host['path'])) || (preg_replace('/^www./', '', $parsed['host']) == preg_replace('/^www./', '', Tools::getHttpHost(false, false))) && !strncmp($parsed['path'], $parsed_host['path'], strlen(__PS_BASE_URI__)))
if ((!isset($parsed['path']) ||!isset($parsed_host['path'])) || (preg_replace('/^www./', '', $parsed['host']) == preg_replace('/^www./', '', Tools::getHttpHost(false, false)))
&& !strncmp($parsed['path'], $parsed_host['path'], strlen(__PS_BASE_URI__)))
return false;
$source->http_referer = substr($_SERVER['HTTP_REFERER'], 0, ConnectionsSource::$uri_max_size);
$source->keywords = substr(trim(SearchEngine::getKeywords($_SERVER['HTTP_REFERER'])), 0, ConnectionsSource::$uri_max_size);
if (Validate::isAbsoluteUrl(strval($_SERVER['HTTP_REFERER'])))
{
$source->http_referer = substr(strval($_SERVER['HTTP_REFERER']), 0, ConnectionsSource::$uri_max_size);
$source->keywords = trim(SearchEngine::getKeywords(strval($_SERVER['HTTP_REFERER'])));
if (!Validate::isMessage($source->keywords))
return false;
}
}
$source->id_connections = (int)$cookie->id_connections;
$source->request_uri = Tools::getHttpHost(false, false);
if (isset($_SERVER['REQUEST_URI']))
$source->request_uri .= $_SERVER['REQUEST_URI'];
elseif (isset($_SERVER['REDIRECT_URL']))
$source->request_uri .= $_SERVER['REDIRECT_URL'];
if (isset($_SERVER['REDIRECT_URL']))
$source->request_uri .= strval($_SERVER['REDIRECT_URL']);
elseif (isset($_SERVER['REQUEST_URI']))
$source->request_uri .= strval($_SERVER['REQUEST_URI']);
if (!Validate::isUrl($source->request_uri))
$source->request_uri = '';
$source->request_uri = substr($source->request_uri, 0, ConnectionsSource::$uri_max_size);
@@ -109,4 +104,4 @@ class ConnectionsSourceCore extends ObjectModel
WHERE id_order = '.(int)($id_order).'
ORDER BY cos.date_add DESC');
}
}
}

View File

@@ -44,13 +44,15 @@ class CookieCore
/** @var array cipher tool instance */
protected $_cipherTool;
/** @var array cipher tool initialization key */
protected $_key;
/** @var array cipher tool initilization vector */
protected $_iv;
protected $_modified = false;
protected $_allow_writing;
protected $_salt;
protected $_standalone;
/**
* Get data if the cookie exists and else initialize an new one
@@ -58,26 +60,24 @@ class CookieCore
* @param $name Cookie name before encrypting
* @param $path
*/
public function __construct($name, $path = '', $expire = null, $shared_urls = null, $standalone = false)
public function __construct($name, $path = '', $expire = null, $shared_urls = null)
{
$this->_content = array();
$this->_standalone = $standalone;
$this->_expire = is_null($expire) ? time() + 1728000 : (int)$expire;
$this->_name = md5(($this->_standalone ? '' : _PS_VERSION_).$name);
$this->_path = trim(($this->_standalone ? '' : Context::getContext()->shop->physical_uri).$path, '/\\').'/';
$this->_name = md5(_PS_VERSION_.$name);
$this->_path = trim(Context::getContext()->shop->physical_uri.$path, '/\\').'/';
if ($this->_path{0} != '/') $this->_path = '/'.$this->_path;
$this->_path = rawurlencode($this->_path);
$this->_path = str_replace('%2F', '/', $this->_path);
$this->_path = str_replace('%7E', '~', $this->_path);
$this->_key = _COOKIE_KEY_;
$this->_iv = _COOKIE_IV_;
$this->_domain = $this->getDomain($shared_urls);
$this->_allow_writing = true;
$this->_salt = $this->_standalone ? str_pad('', 8, md5('ps'.__FILE__)) : _COOKIE_IV_;
if ($this->_standalone)
$this->_cipherTool = new Blowfish(str_pad('', 56, md5('ps'.__FILE__)), str_pad('', 56, md5('iv'.__FILE__)));
elseif (!Configuration::get('PS_CIPHER_ALGORITHM'))
$this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_);
else
if (Configuration::get('PS_CIPHER_ALGORITHM'))
$this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
else
$this->_cipherTool = new Blowfish($this->_key, $this->_iv);
$this->update();
}
@@ -270,7 +270,7 @@ class CookieCore
//printf("\$content = %s<br />", $content);
/* Get cookie checksum */
$checksum = crc32($this->_salt.substr($content, 0, strrpos($content, '¤') + 2));
$checksum = crc32($this->_iv.substr($content, 0, strrpos($content, '¤') + 2));
//printf("\$checksum = %s<br />", $checksum);
/* Unserialize cookie content */
@@ -297,7 +297,7 @@ class CookieCore
$this->_content['date_add'] = date('Y-m-d H:i:s');
//checks if the language exists, if not choose the default language
if (!$this->_standalone && !Language::getLanguage((int)$this->id_lang))
if (!Language::getLanguage((int)$this->id_lang))
$this->id_lang = Configuration::get('PS_LANG_DEFAULT');
}
@@ -344,7 +344,7 @@ class CookieCore
$cookie .= $key.'|'.$value.'¤';
/* Add checksum to cookie */
$cookie .= 'checksum|'.crc32($this->_salt.$cookie);
$cookie .= 'checksum|'.crc32($this->_iv.$cookie);
$this->_modified = false;
/* Cookies are encrypted for evident security reasons */
return $this->_setcookie($cookie);

View File

@@ -370,10 +370,4 @@ class CountryCore extends ObjectModel
else
return true;
}
public function add($autodate = true, $null_values = false)
{
$return = parent::add($autodate, $null_values) && self::addModuleRestrictions(array(), array(array('id_country' => $this->id)), array());
return $return;
}
}
}

View File

@@ -43,7 +43,7 @@ class CurrencyCore extends ObjectModel
/** @var int bool used for displaying blank between sign and price */
public $blank;
/** @var string exchange rate from euros */
/** @var string Conversion rate from euros */
public $conversion_rate;
/** @var boolean True if currency has been deleted (staying in database as deleted) */
@@ -326,23 +326,23 @@ class CurrencyCore extends ObjectModel
}
/**
* Refresh the currency exchange rate
* The XML file define exchange rate for each from a default currency ($isoCodeSource).
* Refresh the currency conversion rate
* The XML file define conversion rate for each from a default currency ($isoCodeSource).
*
* @param $data XML content which contains all the exchange rates
* @param $data XML content which contains all the conversion rates
* @param $isoCodeSource The default currency used in the XML file
* @param $defaultCurrency The default currency object
*/
public function refreshCurrency($data, $isoCodeSource, $defaultCurrency)
{
// fetch the exchange rate of the default currency
$exchange_rate = 1;
// fetch the conversion rate of the default currency
$conversion_rate = 1;
if ($defaultCurrency->iso_code != $isoCodeSource)
{
foreach ($data->currency as $currency)
if ($currency['iso_code'] == $defaultCurrency->iso_code)
{
$exchange_rate = round((float)$currency['rate'], 6);
$conversion_rate = round((float)$currency['rate'], 6);
break;
}
}
@@ -364,7 +364,7 @@ class CurrencyCore extends ObjectModel
}
if (isset($rate))
$this->conversion_rate = round($rate / $exchange_rate, 6);
$this->conversion_rate = round($rate / $conversion_rate, 6);
}
$this->update();
}

View File

@@ -104,11 +104,6 @@ class CustomerMessageCore extends ObjectModel
WHERE '.$where
);
}
public function delete()
{
if (!empty($this->file_name))
@unlink(_PS_UPLOAD_DIR_.$this->file_name);
return parent::delete();
}
}
}

View File

@@ -97,27 +97,11 @@ class CustomerThreadCore extends ObjectModel
{
if (!Validate::isUnsignedId($this->id))
return false;
$return = true;
$result = Db::getInstance()->executeS('
SELECT `id_customer_message`
FROM `'._DB_PREFIX_.'customer_message`
Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'customer_message`
WHERE `id_customer_thread` = '.(int)$this->id
);
if( count($result))
{
foreach ($result AS $res)
{
$message = new CustomerMessage((int)$res['id_customer_message']);
if (!Validate::isLoadedObject($message))
$return = false;
else
$return &= $message->delete();
}
}
$return &= parent::delete();
return $return;
return (parent::delete());
}
public static function getCustomerMessages($id_customer, $read = null)
@@ -220,4 +204,5 @@ class CustomerThreadCore extends ObjectModel
' ORDER BY ct.date_upd ASC
');
}
}
}

View File

@@ -206,6 +206,7 @@ class DispatcherCore
$this->front_controller = self::FC_ADMIN;
$this->controller_not_found = 'adminnotfound';
$this->default_controller = 'adminhome';
$this->use_routes = false;
}
elseif (Tools::getValue('fc') == 'module')
{
@@ -386,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)
@@ -647,9 +648,7 @@ class DispatcherCore
* @return string
*/
public function getController()
{
if (defined('_PS_ADMIN_DIR_'))
$_GET['controllerUri'] = Tools::getvalue('controller');
{
if ($this->controller)
{
$_GET['controller'] = $this->controller;
@@ -671,48 +670,44 @@ class DispatcherCore
$controller = false;
// Use routes ? (for url rewriting)
if ($this->use_routes && !$controller && !defined('_PS_ADMIN_DIR_'))
if ($this->use_routes && !$controller)
{
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);
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))
// 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))
{
// 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;
$_GET['module'] = $m[1];
$_GET['fc'] = 'module';
$controller = $m[2];
}
}
if ($controller == 'index' || $this->request_uri == '/index.php')
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;
}

View File

@@ -81,7 +81,7 @@ class FeatureCore extends ObjectModel
public static function getFeatures($id_lang, $with_shop = true)
{
return Db::getInstance()->executeS('
SELECT DISTINCT f.id_feature, f.*, fl.*
SELECT *
FROM `'._DB_PREFIX_.'feature` f
'.($with_shop ? Shop::addSqlAssociation('feature', 'f') : '').'
LEFT JOIN `'._DB_PREFIX_.'feature_lang` fl ON (f.`id_feature` = fl.`id_feature` AND fl.`id_lang` = '.(int)$id_lang.')

View File

@@ -66,8 +66,8 @@ class GenderCore extends ObjectModel
public function getImage($use_unknown = false)
{
if (!isset($this->id) || empty($this->id) || !file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
return _THEME_GENDERS_DIR_.'Unknown.jpg';
if (!file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg'))
return ($use_unknown) ? _PS_ADMIN_IMG_.'unknown.gif' : false;
return _THEME_GENDERS_DIR_.$this->id.'.jpg';
}
}

View File

@@ -128,22 +128,6 @@ class HookCore extends ObjectModel
return Cache::retrieve($cache_id);
}
/**
* Return hook ID from name
*/
public static function getNameById($hook_id)
{
$cache_id = 'hook_namebyid_'.$hook_id;
if (!Cache::isStored($cache_id))
Cache::store($cache_id, Db::getInstance()->getValue('
SELECT `name`
FROM `'._DB_PREFIX_.'hook`
WHERE `id_hook` = '.(int)$hook_id)
);
return Cache::retrieve($cache_id);
}
/**
* Get list of hook alias
*
@@ -290,9 +274,8 @@ 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.' AND id_shop = '.(int)$context->shop->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.' 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))');
}
@@ -303,6 +286,7 @@ 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');
}

View File

@@ -273,7 +273,7 @@ class LanguageCore extends ObjectModel
'contact.html', 'contact.txt',
'contact_form.html', 'contact_form.txt',
'credit_slip.html', 'credit_slip.txt',
'download_product.html', 'download_product.txt',
'download_product.html', 'download_product.txt', 'download-product.tpl',
'employee_password.html', 'employee_password.txt',
'forward_msg.html', 'forward_msg.txt',
'guest_to_customer.html', 'guest_to_customer.txt',
@@ -466,7 +466,7 @@ class LanguageCore extends ObjectModel
public function delete()
{
if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL)
if (!$this->hasMultishopEntries())
{
if (empty($this->iso_code))
$this->iso_code = Language::getIsoById($this->id);
@@ -514,7 +514,7 @@ class LanguageCore extends ObjectModel
if (!parent::delete())
return false;
if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL)
if (!$this->hasMultishopEntries())
{
// delete images
$files_copy = array(
@@ -580,7 +580,7 @@ class LanguageCore extends ObjectModel
public static function getLanguage($id_lang)
{
if (!array_key_exists((int)$id_lang, self::$_LANGUAGES))
if (!array_key_exists((int)($id_lang), self::$_LANGUAGES))
return false;
return self::$_LANGUAGES[(int)($id_lang)];
}
@@ -788,11 +788,11 @@ class LanguageCore extends ObjectModel
$lang_pack_ok = false;
$errors = array();
$file = _PS_TRANSLATIONS_DIR_.$iso.'.gzip';
if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.$version.'&iso_lang='.Tools::strtolower($iso)))
if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.$version.'&iso_lang='.$iso))
$errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.');
elseif (!$lang_pack = Tools::jsonDecode($lang_pack_link))
$errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.');
elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.Tools::strtolower($lang_pack->iso_code.'.gzip')))
elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$lang_pack->iso_code.'.gzip'))
if (!@file_put_contents($file, $content))
$errors[] = Tools::displayError('Server does not have permissions for writing.');
if (file_exists($file))
@@ -801,8 +801,6 @@ 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
@@ -831,4 +829,4 @@ class LanguageCore extends ObjectModel
{
return (Language::countActiveLanguages() > 1);
}
}
}

View File

@@ -129,8 +129,8 @@ class LinkCore
$params['tags'] = Tools::str2url($product->getTags($id_lang));
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'category'))
$params['category'] = !is_null($product->category) ? Tools::str2url($product->category) : Tools::str2url($category);
$params['category'] = Tools::str2url($product->category);
if ($dispatcher->hasKeyword('product_rule', $id_lang, 'reference'))
$params['reference'] = Tools::str2url($product->reference);

View File

@@ -51,6 +51,7 @@ 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))
@@ -232,7 +233,7 @@ class LocalizationPackCore
}
}
}
return $this->updateDefaultGroupDisplayMethod($xml);
return true;
}
protected function _installCurrencies($xml, $install_mode = false)
@@ -294,7 +295,7 @@ class LocalizationPackCore
// if we are not in an installation context or if the pack is not available in the local directory
if (Language::getIdByIso($attributes['iso_code']) && !$install_mode)
continue;
$errors = Language::downloadAndInstallLanguagePack($attributes['iso_code'], $attributes['version'], $attributes);
$errors = Language::downloadAndInstallLanguagePack($attributes['iso_code'], $attributes['version']);
if ($errors !== true && is_array($errors))
$this->_errors = array_merge($this->_errors, $errors);
}
@@ -390,13 +391,10 @@ class LocalizationPackCore
$attributes = $xml->group_default->attributes();
if (isset($attributes['price_display_method']) && in_array((int)$attributes['price_display_method'], array(0, 1)))
{
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');
}
$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');
}
else
$this->_errors[] = Tools::displayError('An error has occurred during the default group update');

View File

@@ -63,6 +63,7 @@ class MailCore
'PS_SHOP_NAME',
'PS_MAIL_SMTP_ENCRYPTION',
'PS_MAIL_SMTP_PORT',
'PS_MAIL_METHOD',
'PS_MAIL_TYPE'
), null, null, $id_shop);
@@ -244,13 +245,13 @@ class MailCore
else
$template_vars['{shop_logo}'] = '';
}
ShopUrl::cacheMainDomainForShop((int)$id_shop);
/* don't attach the logo as */
if (isset($logo))
$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}'] = Context::getContext()->link->getPageLink('index', true, Context::getContext()->language->id);
$template_vars['{shop_url}'] = Tools::getShopDomain(true, true).__PS_BASE_URI__.'index.php';
$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);
@@ -273,9 +274,6 @@ class MailCore
/* Send mail */
$send = $swift->send($message, $to, new Swift_Address($from, $from_name));
$swift->disconnect();
ShopUrl::resetMainDomainCache();
return $send;
}
catch (Swift_Exception $e) {
@@ -301,9 +299,9 @@ class MailCore
else
$swift = new Swift(new Swift_Connection_NativeMail(), Configuration::get('PS_MAIL_DOMAIN'));
$message = new Swift_Message($subject, 'Merci de laisser marie et vincent tranquilles ! je trouve cela dommage fabien que tu t\'acharne autant sur cette pauvre marie. Mais ne t\'inquete pas on en reparlera au prochain codir.', $type);
$message = new Swift_Message($subject, $content, $type);
if ($swift->send($message, 'francois.gaillard@prestashop.com', 'benjamin.teszner@prestahsop.com'))
if ($swift->send($message, $to, $from))
$result = true;
$swift->disconnect();

View File

@@ -215,7 +215,7 @@ class ManufacturerCore extends ObjectModel
for ($i = 0; $i < $total_manufacturers; $i++)
if ($rewrite_settings)
$manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name']);
$manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name'], false);
else
$manufacturers[$i]['link_rewrite'] = 0;
@@ -258,7 +258,7 @@ class ManufacturerCore extends ObjectModel
public function getLink()
{
return Tools::link_rewrite($this->name);
return Tools::link_rewrite($this->name, false);
}
public static function getProducts($id_manufacturer, $id_lang, $p, $n, $order_by = null, $order_way = null,
@@ -339,7 +339,7 @@ class ManufacturerCore extends ObjectModel
'.Shop::addSqlAssociation('product', 'p').'
LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa
ON (p.`id_product` = pa.`id_product`)
'.Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.`default_on` = 1').'
'.Shop::addSqlAssociation('product_attribute', 'pa', false).'
LEFT JOIN `'._DB_PREFIX_.'product_lang` pl
ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').')
LEFT JOIN `'._DB_PREFIX_.'image` i

View File

@@ -168,7 +168,7 @@ class MetaCore extends ObjectModel
$result = $result && $this->delete();
}
return $result && Tools::generateHtaccess();
return Tools::generateHtaccess();
}
public static function getEquivalentUrlRewrite($new_id_lang, $id_lang, $url_rewrite)

View File

@@ -537,16 +537,13 @@ abstract class ObjectModelCore
if (!$res)
return false;
unset($res[$definition['primary']]);
foreach ($res as $field => &$value)
if (isset($definition['fields'][$field]))
$value = ObjectModel::formatValue($value, $definition['fields'][$field]['type']);
if (!Db::getInstance()->insert($definition['table'], $res))
return false;
$object_id = Db::getInstance()->Insert_ID();
if (isset($definition['multilang']) && $definition['multilang'])
if ($definition['multilang'])
{
$res = Db::getInstance()->executeS('
SELECT *
@@ -556,11 +553,7 @@ abstract class ObjectModelCore
if (!$res)
return false;
foreach ($res as $field => &$value)
if (isset($definition['fields'][$field]))
$value = ObjectModel::formatValue($value, $definition['fields'][$field]['type']);
foreach ($res as $row)
{
$row[$definition['primary']] = (int)$object_id;
@@ -633,7 +626,7 @@ abstract class ObjectModelCore
$shop_exists = ObjectModel::$db->getValue('SELECT '.$this->def['primary'].' FROM '._DB_PREFIX_.$this->def['table'].'_shop WHERE '.$where);
if ($shop_exists)
$result &= ObjectModel::$db->update($this->def['table'].'_shop', $fields, $where, 0, $null_values);
elseif (Shop::getContext() == Shop::CONTEXT_SHOP)
else if (Shop::getContext() == Shop::CONTEXT_SHOP)
$result &= ObjectModel::$db->insert($this->def['table'].'_shop', $all_fields, $null_values);
}
}
@@ -947,8 +940,8 @@ abstract class ObjectModelCore
{
global $_FIELDS;
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');
if (file_exists(_PS_TRANSLATIONS_DIR_.Context::getContext()->language->iso_code.'/fields.php'))
include(_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);
@@ -977,11 +970,11 @@ abstract class ObjectModelCore
// Checking for required fields
if (isset($data['required']) && $data['required'] && ($value = Tools::getValue($field, $this->{$field})) == false && (string)$value != '0')
if (!$this->id || $field != 'passwd')
$errors[$field] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is required.');
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is required.');
// Checking for maximum fields sizes
if (isset($data['size']) && ($value = Tools::getValue($field, $this->{$field})) && Tools::strlen($value) > $data['size'])
$errors[$field] = sprintf(
$errors[] = sprintf(
Tools::displayError('%1$s is too long. Maximum length: %2$d'),
self::displayFieldName($field, get_class($this), $htmlentities),
$data['size']
@@ -992,7 +985,7 @@ abstract class ObjectModelCore
if (($value = Tools::getValue($field, $this->{$field})) || ($field == 'postcode' && $value == '0'))
{
if (isset($data['validate']) && !Validate::$data['validate']($value) && (!empty($value) || $data['required']))
$errors[$field] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
$errors[] = '<b>'.self::displayFieldName($field, get_class($this), $htmlentities).'</b> '.Tools::displayError('is invalid.');
else
{
if (isset($data['copy_post']) && !$data['copy_post'])
@@ -1136,7 +1129,7 @@ abstract class ObjectModelCore
$value = Tools::getValue($field);
if (empty($value))
$errors[$field] = sprintf(Tools::displayError('The field %s is required.'), self::displayFieldName($field, get_class($this), $htmlentities));
$errors[] = sprintf(Tools::displayError('The field %s is required.'), self::displayFieldName($field, get_class($this), $htmlentities));
}
return $errors;
@@ -1277,11 +1270,6 @@ abstract class ObjectModelCore
{
return Shop::isTableAssociated($this->def['table']) || !empty($this->def['multilang_shop']);
}
public function isMultiShopField($field)
{
return (isset($this->def['fields'][$field]) && isset($this->def['fields'][$field]['shop']) && $this->def['fields'][$field]['shop']);
}
public function isLangMultishop()
{
@@ -1608,4 +1596,4 @@ abstract class ObjectModelCore
{
$this->update_fields = $fields;
}
}
}

Some files were not shown because too many files have changed in this diff Show More