// Release branch merged

This commit is contained in:
Francois Gaillard
2013-08-29 18:47:19 +02:00
1014 changed files with 25059 additions and 12673 deletions

71
.gitignore vendored
View File

@@ -7,6 +7,15 @@
.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/*
@@ -16,6 +25,7 @@ cache/tcpdf/*
!cache/tcpdf/index.php
config/xml/*.xml
config/settings.inc.php
config/settings.old.php
log/*.log
img/*
!img/index.php
@@ -27,6 +37,10 @@ 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/*
@@ -35,4 +49,59 @@ 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+Standard
[2]: http://docs.prestashop.com/display/PS15/Coding+Standards
[3]: http://docs.prestashop.com/display/PS15/How+to+write+a+commit+message

View File

@@ -1,80 +1,140 @@
- (d)oekia
- Alexander Otchenashev
- Benjamin PONGY
- Burhan
- Caleydon Media
- Damien Metzger
- DamienMetzger
- Damon Skelhorn
- Daniel
- David Gasperoni
- DrySs
- DrÿSs'
- François Gaillard
- Gabriel Schwardy
- Gregory Roussac
- Ha!*!*y
- Jonathan Danse
- Krystian Podemski
- Marco Cervellin
- Michel Courtade
- Milow
- Patanock
- Pierre
- PrestaEdit
- Raphaël Malié
- Rémi Gaillard
- Samy Rabih
- Sarah Lorenzini
- Shagshag
- Vincent Augagneur
- Xavier POITAU
- aFolletete
- aKorczak
- aNiassy
- adonis karavokyros
- anat
- bLeveque
- bMancone
- bumbu
- cmouleyre
- dMetzger
- dSevere
- djfm
- fBrignoli
- fSerny
- fram
- gBrunier
- gCharmes
- gPoulain
- gRoussac
- hAitmansour
- ivancasasempere
- jBreux
- jObregon
- jessylenne
- jmCollin
- kpodemski
- lBrieu
- lCherifi
- lLefevre
- mBertholino
- mDeflotte
- mMarinetti
- marcinsz101
- montes
- nPellicari
- nezenmoins
- oleacorner
- rGaillard
- rMalie
- rMontagne
- root
- sLorenzini
- sThiebaut
- tDidierjean
- vAugagneur
- vChabot
- vKham
- vSchoener
- adonis karavokyros
- aFolletete
- Agence CINS
- aKorczak
- Alexander Otchenashev
- anat
- Andrew
- aNiassy
- antoniofr
- AntonLejon
- Arnaud Lemercier
- Axome
- Benjamin PONGY
- BigZ
- bLeveque
- bMancone
- bumbu
- Burhan
- Cédric Mouleyre
- Caleydon Media
- cam.lafit
- Captain FLAM
- Captain-FLAM
- ccauw
- ChristopheBoucaut
- cippest
- cmouleyre
- Corentin Delcourt
- Cosmin Hutanu
- Damien Metzger
- DamienMetzger
- Damon Skelhorn
- Daniel
- David Gasperoni
- Davy Rolink
- djfm
- dMetzger
- (d)oekia
- Dragan Skrbic
- DrÿSs'
- dreammeup
- DrySs
- dSevere
- Edouard Gaulué
- emily-d
- Fabio Chelly
- fBrignoli
- fram
- François Gaillard
- fSerny
- Gabriel Schwardy
- gBrunier
- gCharmes
- gPoulain
- Grégoire Bélorgey
- Gregory Roussac
- gRoussac
- Guillaume DELOINCE
- hAitmansour
- Ha!*!*y
- indesign47
- inem0o
- ivancasasempere
- Jérôme Nadaud
- jBreux
- jeromenadaud
- Jerome Nadaud
- jessylenne
- jmCollin
- jObregon
- Jonathan Danse
- joseantgv
- Kevin Granger
- kpodemski
- Krystian Podemski
- lBrieu
- lCherifi
- ldecoker
- lLefevre
- marcinsz101
- Marco Cervellin
- Mats Rynge
- MatthieuB
- Maxence
- mBertholino
- mDeflotte
- Michel Courtade
- Milow
- minic studio
- misthero
- mMarinetti
- montes
- nezenmoins
- Nicolas Sorosac
- Nils-Helge Garli Hegvik
- nPellicari
- nturato
- oleacorner
- Otto Nascarella
- Patanock
- PhpMadman
- Pierre
- Piotr Kaczor
- Piotr Moćko
- PrestaEdit
- prestarocket
- pxls
- Rémi Gaillard
- Raphaël Malié
- raulgundin
- rGaillard
- Rimas Kudelis
- rMalie
- rMontagne
- root
- runningz
- Sébastien
- Sébastien Bocahu
- Samy Rabih
- Sarah Lorenzini
- Seb
- Seynaeve
- Shagshag
- sLorenzini
- soware
- Staging
- sThiebaut
- Sylvain WITMEYER
- tDidierjean
- vAugagneur
- vChabot
- Vincent Augagneur
- Vincent Schoener
- Vincent Terenti
- vinvin27
- vKham
- vSchoener
- Xavier
- Xavier POITAU
- Yoozio

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=address'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
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');

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=addresses'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
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');

View File

@@ -60,7 +60,7 @@
$tem[$k] = $v;
}
$tem['path'] = backslashToSlash($path);
$tem['path'] = addslashes(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'", getFileUrl($path));
$info .= sprintf(", url:'%s'", addslashes(getFileUrl($path)));
$info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME);

View File

@@ -99,9 +99,9 @@
{
$v = transformFileSize($v);
}
echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'";
echo (($j++ > 1)?",":'') . "'" . addslashes($k) . "':'" . addslashes($v) . "'";
}
echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'";
echo (($j++ > 1)?",":'') . "'url':'" . addslashes(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'] = $path;
$this->fileInfo['name'] = basename($path);
$this->fileInfo['path'] = addslashes($path);
$this->fileInfo['name'] = addslashes(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'] = basename($path);
$this->fileInfo['path'] = $path;
$this->fileInfo['name'] = addslashes(basename($path));
$this->fileInfo['path'] = addslashes($path);
$this->fileInfo['atime'] = $this->fileStat[8];
$this->fileInfo['ctime'] = $this->fileStat[10];
$this->fileInfo['mtime'] = $this->fileStat[9];

View File

@@ -37,7 +37,6 @@ $height = Tools::getValue('height');
$id_employee = Tools::getValue('id_employee');
$id_lang = Tools::getValue('id_lang');
if (!isset($cookie->id_employee) || !$cookie->id_employee || $cookie->id_employee != $id_employee)
die(Tools::displayError());
@@ -47,6 +46,51 @@ if (!Validate::isModuleName($module))
if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php'))
die(Tools::displayError());
$shop_id = '';
Shop::setContext(Shop::CONTEXT_ALL);
if (Context::getContext()->cookie->shopContext)
{
$split = explode('-', Context::getContext()->cookie->shopContext);
if (count($split) == 2)
{
if ($split[0] == 'g')
{
if (Context::getContext()->employee->hasAuthOnShopGroup($split[1]))
Shop::setContext(Shop::CONTEXT_GROUP, $split[1]);
else
{
$shop_id = Context::getContext()->employee->getDefaultShopID();
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
}
else if (Shop::getShop($split[1]) && Context::getContext()->employee->hasAuthOnShop($split[1]))
{
$shop_id = $split[1];
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
else
{
$shop_id = Context::getContext()->employee->getDefaultShopID();
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
}
}
// Check multishop context and set right context if need
if (Shop::getContext())
{
if (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::CONTEXT_SHOP)
Shop::setContext(Shop::CONTEXT_GROUP, Shop::getContextShopGroupID());
if (Shop::getContext() == Shop::CONTEXT_GROUP && !Shop::CONTEXT_GROUP)
Shop::setContext(Shop::CONTEXT_ALL);
}
// Replace existing shop if necessary
if (!$shop_id)
Context::getContext()->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
elseif (Context::getContext()->shop->id != $shop_id)
Context::getContext()->shop = new Shop($shop_id);
require_once($module_path);
$graph = new $module();
@@ -57,4 +101,3 @@ if ($option)
$graph->create($render, $type, $width, $height, $layers);
$graph->draw();

View File

@@ -30,14 +30,14 @@ echo ' </div>
<div id="footer">
<div style="float:left;margin-left:10px;padding-top:6px">
<a href="http://www.prestashop.com/" target="_blank" style="font-weight:700;color:#666666">PrestaShop&trade; '._PS_VERSION_.'</a><br />
<span style="font-size:10px">'.translate('Load time:').' '.number_format(microtime(true) - $timerStart, 3, '.', '').'s</span>
<span style="font-size:10px">'.Translate::getAdminTranslation('Load time:').' '.number_format(microtime(true) - $timerStart, 3, '.', '').'s</span>
</div>
<div style="float:right;height:40px;margin-right:10px;line-height:38px;vertical-align:middle">';
if (strtoupper(Context::getContext()->language->iso_code) == 'FR') echo '<span style="color: #812143; font-weight: bold;">Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong> de 09h &agrave; 18h ';
echo ' | <a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">'.translate('Contact').'</a>
| <a href="http://forge.prestashop.com" target="_blank" class="footer_link">'.translate('Bug Tracker').'</a>
| <a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">'.translate('Forum').'</a>
echo ' | <a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">'.Translate::getAdminTranslation('Contact').'</a>
| <a href="http://forge.prestashop.com" target="_blank" class="footer_link">'.Translate::getAdminTranslation('Bug Tracker').'</a>
| <a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">'.Translate::getAdminTranslation('Forum').'</a>
</div>
</div>
</div>

View File

@@ -223,8 +223,16 @@ function checkPSVersion()
return $upgrader->checkPSVersion();
}
/**
* Deprecated since > 1.5.4.1
* Use Translate::getAdminTranslation($string) instead
*
* @param string $string
*/
function translate($string)
{
Tools::displayAsDeprecated();
global $_LANGADM;
if (!is_array($_LANGADM))
return str_replace('"', '&quot;', $string);
@@ -233,7 +241,6 @@ function translate($string)
return str_replace('"', '&quot;', stripslashes($str));
}
/**
* Returns a new Tab object
*
@@ -461,7 +468,7 @@ function runAdminTab($tab, $ajaxMode = false)
echo '<div class="path_bar">
<div id="help-button" class="floatr" style="display: none; font-family: Verdana; font-size: 10px; margin-right: 4px; margin-top: 4px;">
</div>
<a href="?token='.Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).(int)Context::getContext()->employee->id).'">'.translate('Back Office').'</a>
<a href="?token='.Tools::getAdminToken($tab.intval(Tab::getIdFromClassName($tab)).(int)Context::getContext()->employee->id).'">'.Translate::getAdminTranslation('Back Office').'</a>
'.$bread.'</div>';
if (!$ajaxMode && Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL)
@@ -470,10 +477,10 @@ function runAdminTab($tab, $ajaxMode = false)
if (Shop::getContext() == Shop::CONTEXT_GROUP)
{
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
printf(translate('You are configuring your store for group shop %s'), '<b>'.$shop_group->name.'</b>');
printf(Translate::getAdminTranslation('You are configuring your store for group shop %s'), '<b>'.$shop_group->name.'</b>');
}
elseif (Shop::getContext() == Shop::CONTEXT_SHOP)
printf(translate('You are configuring your store for shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
printf(Translate::getAdminTranslation('You are configuring your store for shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
echo '</div>';
}
if (Validate::isLoadedObject($adminObj))
@@ -546,8 +553,8 @@ function runAdminTab($tab, $ajaxMode = false)
// we can display the correct url
// die(Tools::jsonEncode(array(translate('Invalid security token'),$url)));
die(Tools::jsonEncode(translate('Invalid security token')));
// die(Tools::jsonEncode(array(Translate::getAdminTranslation('Invalid security token'),$url)));
die(Tools::jsonEncode(Translate::getAdminTranslation('Invalid security token')));
}
else
{
@@ -559,17 +566,17 @@ function runAdminTab($tab, $ajaxMode = false)
if (false === strpos($url, '?token=') AND false === strpos($url, '&token='))
$url .= '&token='.$adminObj->token;
$message = translate('Invalid security token');
$message = Translate::getAdminTranslation('Invalid security token');
echo '<html><head><title>'.$message.'</title></head><body style="font-family:Arial,Verdana,Helvetica,sans-serif;background-color:#EC8686">
<div style="background-color:#FAE2E3;border:1px solid #000000;color:#383838;font-weight:700;line-height:20px;margin:0 0 10px;padding:10px 15px;width:500px">
<img src="../img/admin/error2.png" style="margin:-4px 5px 0 0;vertical-align:middle">
'.$message.'
</div>';
echo '<a href="'.htmlentities($url).'" method="get" style="float:left;margin:10px">
<input type="button" value="'.Tools::htmlentitiesUTF8(translate('I understand the risks and I really want to display this page')).'" style="height:30px;margin-top:5px" />
<input type="button" value="'.Tools::htmlentitiesUTF8(Translate::getAdminTranslation('I understand the risks and I really want to display this page')).'" style="height:30px;margin-top:5px" />
</a>
<a href="index.php" method="get" style="float:left;margin:10px">
<input type="button" value="'.Tools::htmlentitiesUTF8(translate('Take me out of here!')).'" style="height:40px" />
<input type="button" value="'.Tools::htmlentitiesUTF8(Translate::getAdminTranslation('Take me out of here!')).'" style="height:40px" />
</a>
</body></html>';
die;

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

@@ -50,6 +50,53 @@ if (!Validate::isModuleName($module))
if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php'))
die(Tools::displayError());
$shop_id = '';
Shop::setContext(Shop::CONTEXT_ALL);
if (Context::getContext()->cookie->shopContext)
{
$split = explode('-', Context::getContext()->cookie->shopContext);
if (count($split) == 2)
{
if ($split[0] == 'g')
{
if (Context::getContext()->employee->hasAuthOnShopGroup($split[1]))
Shop::setContext(Shop::CONTEXT_GROUP, $split[1]);
else
{
$shop_id = Context::getContext()->employee->getDefaultShopID();
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
}
else if (Shop::getShop($split[1]) && Context::getContext()->employee->hasAuthOnShop($split[1]))
{
$shop_id = $split[1];
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
else
{
$shop_id = Context::getContext()->employee->getDefaultShopID();
Shop::setContext(Shop::CONTEXT_SHOP, $shop_id);
}
}
}
// Check multishop context and set right context if need
if (Shop::getContext())
{
if (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::CONTEXT_SHOP)
Shop::setContext(Shop::CONTEXT_GROUP, Shop::getContextShopGroupID());
if (Shop::getContext() == Shop::CONTEXT_GROUP && !Shop::CONTEXT_GROUP)
Shop::setContext(Shop::CONTEXT_ALL);
}
// Replace existing shop if necessary
if (!$shop_id)
Context::getContext()->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT'));
elseif (Context::getContext()->shop->id != $shop_id)
Context::getContext()->shop = new Shop($shop_id);
require_once($module_path);
$grid = new $module();

View File

@@ -41,7 +41,7 @@ echo '
<link type="text/css" rel="stylesheet" href="'._PS_JS_DIR_.'jquery/plugins/cluetip/jquery.cluetip.css" />
<link type="text/css" rel="stylesheet" href="themes/'.Context::getContext()->employee->bo_theme.'/css/admin.css" />
<link type="text/css" rel="stylesheet" href="'._PS_JS_DIR_.'jquery/plugins/chosen/jquery.chosen.css" />
<title>PrestaShop&trade; - '.translate('Administration panel').'</title>
<title>PrestaShop&trade; - '.Translate::getAdminTranslation('Administration panel').'</title>
<script type="text/javascript">
var helpboxes = '.Configuration::get('PS_HELPBOX').';
var roundMode = '.Configuration::get('PS_PRICE_ROUND_MODE').';
@@ -78,7 +78,7 @@ echo '
html = "";
nb_notifs = 0;
$.each(json.order, function(property, value) {
html += "<li>'.translate('A new order has been made on your shop.').'<br />'.translate('Order number : ').'<strong>#" + parseInt(value.id_order) + "</strong><br />'.translate('Total : ').'<strong>" + value.total_paid_real + "</strong><br />'.translate('From : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminOrders&token='.Tools::getAdminTokenLite('AdminOrders').'&vieworder&id_order=" + parseInt(value.id_order) + "\">'.translate('Click here to see that order').'</a></li>";
html += "<li>'.Translate::getAdminTranslation('A new order has been made on your shop.').'<br />'.Translate::getAdminTranslation('Order number : ').'<strong>#" + parseInt(value.id_order) + "</strong><br />'.Translate::getAdminTranslation('Total : ').'<strong>" + value.total_paid_real + "</strong><br />'.Translate::getAdminTranslation('From : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminOrders&token='.Tools::getAdminTokenLite('AdminOrders').'&vieworder&id_order=" + parseInt(value.id_order) + "\">'.Translate::getAdminTranslation('Click here to see that order').'</a></li>";
});
if (html != "")
@@ -99,7 +99,7 @@ echo '
html = "";
nb_notifs = 0;
$.each(json.customer, function(property, value) {
html += "<li>'.translate('A new customer registered on your shop.').'<br />'.translate('Customer name : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminCustomers&token='.Tools::getAdminTokenLite('AdminCustomers').'&viewcustomer&id_customer=" + parseInt(value.id_customer) + "\">'.translate('Click here to see that customer').'</a></li>";
html += "<li>'.Translate::getAdminTranslation('A new customer registered on your shop.').'<br />'.Translate::getAdminTranslation('Customer name : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminCustomers&token='.Tools::getAdminTokenLite('AdminCustomers').'&viewcustomer&id_customer=" + parseInt(value.id_customer) + "\">'.Translate::getAdminTranslation('Click here to see that customer').'</a></li>";
});
if (html != "")
{
@@ -121,7 +121,7 @@ echo '
html = "";
nb_notifs = 0;
$.each(json.customer_message, function(property, value) {
html += "<li>'.translate('A new message posted on your shop.').'<br />'.translate('From : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminCustomerThreads&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'&viewcustomer_thread&id_customer_thread=" + parseInt(value.id_customer_thread) + "\">'.translate('Click here to see that message').'</a></li>";
html += "<li>'.Translate::getAdminTranslation('A new message posted on your shop.').'<br />'.Translate::getAdminTranslation('From : ').'<strong>" + value.customer_name + "</strong><br /><a href=\"index.php?tab=AdminCustomerThreads&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'&viewcustomer_thread&id_customer_thread=" + parseInt(value.id_customer_thread) + "\">'.Translate::getAdminTranslation('Click here to see that message').'</a></li>";
});
if (html != "")
@@ -149,14 +149,14 @@ echo '
if (Shop::isFeatureActive())
{
if (Shop::getContext() == Shop::CONTEXT_ALL)
$youEditFieldFor = translate('A modification of this field will be applied for all shops');
$youEditFieldFor = Translate::getAdminTranslation('A modification of this field will be applied for all shops');
elseif (Shop::getContext() == Shop::CONTEXT_GROUP)
{
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID());
$youEditFieldFor = sprintf(translate('A modification of this field will be applied for all shops of group %s'), '<b>'.$shop_group->name.'</b>');
$youEditFieldFor = sprintf(Translate::getAdminTranslation('A modification of this field will be applied for all shops of group %s'), '<b>'.$shop_group->name.'</b>');
}
else
$youEditFieldFor = sprintf(translate('A modification of this field will be applied for the shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
$youEditFieldFor = sprintf(Translate::getAdminTranslation('A modification of this field will be applied for the shop %s'), '<b>'.Context::getContext()->shop->name.'</b>');
echo 'hints.html(hints.html()+\'<br /><span class="red">'.addslashes($youEditFieldFor).'</span>\');';
}
@@ -202,10 +202,10 @@ echo ' var html = "";
{
echo '<div id="orders_notif" class="notifs"><span id="orders_notif_number_wrapper" class="number_wrapper"><span id="orders_notif_value">0</span></span>
<div id="orders_notif_wrapper" class="notifs_wrapper">
<h3>'.translate('Last orders').'</h3>
<p class="no_notifs">'.translate('No new orders has been made on your shop').'</p>
<h3>'.Translate::getAdminTranslation('Last orders').'</h3>
<p class="no_notifs">'.Translate::getAdminTranslation('No new orders has been made on your shop').'</p>
<ul id="list_orders_notif"></ul>
<p><a href="index.php?tab=AdminOrders&token='.Tools::getAdminTokenLite('AdminOrders').'">'.translate('Show all orders').'</a></p>
<p><a href="index.php?tab=AdminOrders&token='.Tools::getAdminTokenLite('AdminOrders').'">'.Translate::getAdminTranslation('Show all orders').'</a></p>
</div>
</div>';
}
@@ -213,10 +213,10 @@ echo ' var html = "";
{
echo '<div id="customers_notif" class="notifs notifs_alternate"><span id="customers_notif_number_wrapper" class="number_wrapper"><span id="customers_notif_value">0</span></span>
<div id="customers_notif_wrapper" class="notifs_wrapper">
<h3>'.translate('Last customers').'</h3>
<p class="no_notifs">'.translate('No new customers registered on your shop').'</p>
<h3>'.Translate::getAdminTranslation('Last customers').'</h3>
<p class="no_notifs">'.Translate::getAdminTranslation('No new customers registered on your shop').'</p>
<ul id="list_customers_notif"></ul>
<p><a href="index.php?tab=AdminCustomers&token='.Tools::getAdminTokenLite('AdminCustomers').'">'.translate('Show all customers').'</a></p>
<p><a href="index.php?tab=AdminCustomers&token='.Tools::getAdminTokenLite('AdminCustomers').'">'.Translate::getAdminTranslation('Show all customers').'</a></p>
</div>
</div>';
}
@@ -224,10 +224,10 @@ echo ' var html = "";
{
echo '<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></span>
<div id="customer_messages_notif_wrapper" class="notifs_wrapper">
<h3>'.translate('Last messages').'</h3>
<p class="no_notifs">'.translate('No new messages posted on your shop').'</p>
<h3>'.Translate::getAdminTranslation('Last messages').'</h3>
<p class="no_notifs">'.Translate::getAdminTranslation('No new messages posted on your shop').'</p>
<ul id="list_customer_messages_notif"></ul>
<p><a href="index.php?tab=AdminCustomerThreads&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'">'.translate('Show all messages').'</a></p>
<p><a href="index.php?tab=AdminCustomerThreads&token='.Tools::getAdminTokenLite('AdminCustomerThreads').'">'.Translate::getAdminTranslation('Show all messages').'</a></p>
</div>
</div>';
}
@@ -235,15 +235,15 @@ echo ' var html = "";
<div id="employee_box">
<div id="employee_infos">
<div class="employee_name">'.translate('Welcome,').' <strong>'.Context::getContext()->employee->firstname.'&nbsp'.Context::getContext()->employee->lastname.'</strong></div>
<div class="employee_name">'.Translate::getAdminTranslation('Welcome,').' <strong>'.Context::getContext()->employee->firstname.'&nbsp'.Context::getContext()->employee->lastname.'</strong></div>
<div class="clear"></div>
<ul id="employee_links">
<li><a href="'.htmlentities(Context::getContext()->link->getAdminLink('AdminEmployees'), ENT_COMPAT, 'UTF-8').'&id_employee={$employee->id}&amp;updateemployee">'.translate('My preferences').'</a></li>
<li><a href="'.htmlentities(Context::getContext()->link->getAdminLink('AdminEmployees'), ENT_COMPAT, 'UTF-8').'&id_employee={$employee->id}&amp;updateemployee">'.Translate::getAdminTranslation('My preferences').'</a></li>
<li class="separator">&nbsp;</li>
<li><a id="header_logout" href="index.php?logout">'.translate('logout').'</a></li>
<li><a id="header_logout" href="index.php?logout">'.Translate::getAdminTranslation('logout').'</a></li>
</ul>';
if (defined(_PS_BASE_URL_))
echo '<a href="'._PS_BASE_URL_.'" id="header_foaccess" target="_blank" title="'.translate('View my shop').'">'.translate('View my shop').'</a>';
echo '<a href="'._PS_BASE_URL_.'" id="header_foaccess" target="_blank" title="'.Translate::getAdminTranslation('View my shop').'">'.Translate::getAdminTranslation('View my shop').'</a>';
echo '</div>
</div>
@@ -252,18 +252,18 @@ echo ' var html = "";
<form method="post" action="index.php?controller=AdminSearch&amp;token='.Tools::getAdminTokenLite('AdminSearch').'">
<input type="text" name="bo_query" id="bo_query" value="'.Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))).'" />
<select name="bo_search_type" id="bo_search_type" class="chosen no-search">
<option value="0">'.translate('everywhere').'</option>
<option value="1" '.(Tools::getValue('bo_search_type') == 1 ? 'selected="selected"' : '').'>'.translate('catalog').'</option>
<optgroup label="'.translate('customers').':">
<option value="2" '.(Tools::getValue('bo_search_type') == 2 ? 'selected="selected"' : '').'>'.translate('by name').'</option>
<option value="6" '.(Tools::getValue('bo_search_type') == 6 ? 'selected="selected"' : '').'>'.translate('by ip address').'</option>
<option value="0">'.Translate::getAdminTranslation('everywhere').'</option>
<option value="1" '.(Tools::getValue('bo_search_type') == 1 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('catalog').'</option>
<optgroup label="'.Translate::getAdminTranslation('customers').':">
<option value="2" '.(Tools::getValue('bo_search_type') == 2 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('by name').'</option>
<option value="6" '.(Tools::getValue('bo_search_type') == 6 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('by ip address').'</option>
</optgroup>
<option value="3" '.(Tools::getValue('bo_search_type') == 3 ? 'selected="selected"' : '').'>'.translate('orders').'</option>
<option value="4" '.(Tools::getValue('bo_search_type') == 4 ? 'selected="selected"' : '').'>'.translate('invoices').'</option>
<option value="5" '.(Tools::getValue('bo_search_type') == 5 ? 'selected="selected"' : '').'>'.translate('carts').'</option>
<option value="7" '.(Tools::getValue('bo_search_type') == 7 ? 'selected="selected"' : '').'>'.translate('modules').'</option>
<option value="3" '.(Tools::getValue('bo_search_type') == 3 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('orders').'</option>
<option value="4" '.(Tools::getValue('bo_search_type') == 4 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('invoices').'</option>
<option value="5" '.(Tools::getValue('bo_search_type') == 5 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('carts').'</option>
<option value="7" '.(Tools::getValue('bo_search_type') == 7 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('modules').'</option>
</select>
<input type="submit" id="bo_search_submit" class="button" value="'.translate('Search').'"/>
<input type="submit" id="bo_search_submit" class="button" value="'.Translate::getAdminTranslation('Search').'"/>
</form>
</div>
<div id="header_quick">
@@ -277,7 +277,7 @@ echo ' var html = "";
}
</script>
<select onchange="quickSelect(this);" id="quick_select">
<option value="0">'.translate('Quick Access').'</option>';
<option value="0">'.Translate::getAdminTranslation('Quick Access').'</option>';
foreach (QuickAccess::getQuickAccesses(Context::getContext()->language->id) AS $quick)
{
preg_match('/controller=(.+)(&.+)?$/', $quick['link'], $adminTab);
@@ -342,8 +342,8 @@ echo '
<div id="main">
<div id="content">'
.(file_exists(_PS_ADMIN_DIR_.'/../install') ? '<div style="background-color: #FFEBCC;border: 1px solid #F90;line-height: 20px;margin: 0px 0px 10px;padding: 10px 20px;">'
.translate('For security reasons, you must also:').' '.
translate('delete the /install folder').
.Translate::getAdminTranslation('For security reasons, you must also:').' '.
Translate::getAdminTranslation('delete the /install folder').
'</div>' : '').'
';
if(defined('_PS_MODE_DEV_') && _PS_MODE_DEV_)
@@ -352,7 +352,7 @@ echo '
if (Shop::isFeatureActive() && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL)
{
echo '<div class="multishop_toolbar">
<span class="text_multishop">'.translate('Multistore configuration for').'</span>'.
<span class="text_multishop">'.Translate::getAdminTranslation('Multistore configuration for').'</span>'.
Helper::renderShopList();
echo '</div>';
}

View File

@@ -25,12 +25,15 @@ 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;}
@@ -118,6 +121,8 @@ 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;}
@@ -532,7 +537,7 @@ form#product_form h4 { font-size:18px; font-weight:normal;}
margin:0;
white-space: nowrap;
overflow: auto;
height: 335px;
height: 370px;
}
#modules_list_container_tab #modules_list_container_content li{display:inline-block;}
#modules_list_container_tab table tr th { height:40px;}
@@ -548,7 +553,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:2px 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:0 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;}
@@ -562,8 +567,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: 140px;width: 100%;margin-bottom:15px}
#modules_list_container_tab ul li {height:140px}
.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}
/******** ie7 ******/
.ie7 #modules_list_container_tab #modules_list_container_content li{zoom:1;display:inline;}

View File

@@ -49,10 +49,12 @@
if (perm == 'all' && $(this).parent().parent().hasClass('parent'))
{
checked = enabled ? 'checked': '';
$(this).parent().parent().parent().find('.child-'+id_tab+' input[type=checkbox]').attr('checked', checked);
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');
$.ajax({
url: "{$link->getAdminLink('AdminAccess')}",
url: "{$link->getAdminLink('AdminAccess')|addslashes}",
cache: false,
data : {
ajaxMode : '1',
@@ -68,15 +70,12 @@
},
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');
}
}
@@ -85,7 +84,7 @@
perfect_access_js_gestion(this, perm, id_tab, tabsize, tabnumber, table);
$.ajax({
url: "{$link->getAdminLink('AdminAccess')}",
url: "{$link->getAdminLink('AdminAccess')|addslashes}",
cache: false,
data : {
ajaxMode : '1',
@@ -134,7 +133,7 @@
});
$.ajax({
url: "{$link->getAdminLink('AdminAccess')}",
url: "{$link->getAdminLink('AdminAccess')|addslashes}",
cache: false,
data : {
ajaxMode: '1',
@@ -303,7 +302,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}<strong>{$child.name}</strong></td>
<td{if !$is_child} class="bold"{/if}>{if $is_child} &raquo; {/if}{$child.name}</td>
{foreach $perms as $perm}
{if $access_edit == 1}
<td>

View File

@@ -27,13 +27,7 @@
{block name="label"}
{if $input.name == 'vat_number'}
{if $vat == 'is_applicable'}
<div id="vat_area" style="display: visible">
{else if $vat == 'management'}
<div id="vat_area" style="display: hidden">
{else}
<div style="display: none;">
{/if}
{/if}
{if $input.type == 'text_customer' && !isset($customer)}

View File

@@ -29,6 +29,9 @@
{if $input.type == 'color'}
<div id="colorAttributeProperties" style="display:{if $colorAttributeProperties}block{else}none{/if};">
{/if}
{if $input.type == 'closediv'}
</div>
{/if}
{$smarty.block.parent}
{/block}

View File

@@ -0,0 +1,58 @@
{*
* 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 is' js=1}';
var string_weight = '{l s='Will be applied when the weight is' js=1}';
{/block}
{block name="field"}
{if $input.name == 'zones'}
<div class="ranges_not_follow warn" style="display:none">
<label>{l s="Ranges are not correctly ordered:"}</label>
<a href="#" onclick="checkRangeContinuity(true); return false;" class="button" style="text-decoration:none">{l s="Reordering"}</a>
</div>
{include file='controllers/carrier_wizard/helpers/form/form_ranges.tpl'}
<!--
<div class="validate_range" style="display:none">
<a href="#" class="button" id="validate_range_button">{l s="Validate"}</a>
</div>
-->
<div class="new_range">
<a href="#" onclick="add_new_range();return false;" class="button" id="add_new_range">{l s='Add new range'}</a>
</div>
{/if}
{if $input.name == 'logo'}
<div class="margin-form">
<input id="carrier_logo_input" type="file" onchange="uploadCarrierLogo();" name="carrier_logo_input" />
<input type="hidden" id="logo" name="logo" value="" />
<p class="preference_description">
{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>
{/if}
{$smarty.block.parent}
{/block}

View File

@@ -0,0 +1,61 @@
<script>var zones_nbr = {$zones|count +3} ; /*corresponds to the third input text (max, min and all)*/</script>
<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 range_sign">>=</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"}" /><sup>*</sup><span class="weight_unit">&nbsp; {$PS_WEIGHT_UNIT}</span><span class="price_unit">&nbsp; {$currency_sign}</span></td>
{foreachelse}
<td class="border_bottom center"><input name="range_inf[{$range.id_range|intval}]" type="text" /><sup>*</sup><span class="weight_unit">&nbsp; {$PS_WEIGHT_UNIT}</span><span class="price_unit">&nbsp; {$currency_sign}</span></td>
{/foreach}
</tr>
<tr class="range_sup">
<td class="center range_type"></td>
<td class="border_left range_sign"><</td>
{foreach from=$ranges key=r item=range}
<td class="center"><input name="range_sup[{$range.id_range|intval}]" type="text" {if isset($form_id) && !$form_id} value="" {else} value="{if isset($change_ranges) && $range.id_range == 0} {else}{$range.delimiter2|string_format:"%.6f"}{/if}" {/if}/><sup>*</sup><span class="weight_unit">&nbsp; {$PS_WEIGHT_UNIT}</span><span class="price_unit">&nbsp; {$currency_sign}</span></td>
{foreachelse}
<td class="center"><input name="range_sup[{$range.id_range|intval}]" type="text" /><sup>*</sup><span class="weight_unit">&nbsp; {$PS_WEIGHT_UNIT}</span><span class="price_unit">&nbsp; {$currency_sign}</span></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><input type="checkbox" onclick="checkAllZones(this);" ></td>
{foreach from=$ranges key=r item=range}
<td class="center border_top border_bottom {if $range.id_range != 0} validated {/if}" >
<input type="text" {if isset($form_id) && !$form_id} disabled="disabled"{/if} {if $range.id_range == 0} style="display:none"{/if} /><span class="currency_sign" {if $range.id_range == 0} style="display:none" {/if}>&nbsp; {$currency_sign}</span>
</td>
{foreachelse}
<td class="center border_top border_bottom">
<input style="display:none" type="text" /><span class="currency_sign" style="display:none">&nbsp; {$currency_sign}</span>
</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><label for="zone_{$zone.id_zone}">{$zone.name}</label></td>
<td class="zone">
<input class="input_zone" id="zone_{$zone.id_zone}" name="zone_{$zone.id_zone}" value="1" type="checkbox" {if isset($fields_value['zones'][$zone.id_zone]) && $fields_value['zones'][$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"
{if !isset($fields_value['zones'][$zone.id_zone]) || (isset($fields_value['zones'][$zone.id_zone]) && !$fields_value['zones'][$zone.id_zone])} disabled="disabled"{/if} {if isset($price_by_range[$range.id_range][$zone.id_zone]) && $price_by_range[$range.id_range][$zone.id_zone] && isset($fields_value['zones'][$zone.id_zone]) && $fields_value['zones'][$zone.id_zone]} value="{$price_by_range[$range.id_range][$zone.id_zone]|string_format:'%.6f'}" {else} value="" {/if} /> &nbsp; {$currency_sign}
</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

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

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

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

@@ -0,0 +1,66 @@
{*
* 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};
var need_to_validate = '{l s='Please validate the last range before create a new one.' js=1}';
var delete_range_confirm = '{l s='Are you sure to delete this range ?' js=1}';
var currency_sign = '{$currency_sign}';
var PS_WEIGHT_UNIT = '{$PS_WEIGHT_UNIT}';
var invalid_range = '{l s='This range is not valid' js=1}';
var range_is_overlapping = '{l s='Ranges are overlapping' js=1}';
var multistore_enable = '{$multistore_enable}';
</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}" class="step_container">
{$content}
</div>
{/foreach}
</div>
{/block}

View File

@@ -0,0 +1,91 @@
{*
* 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">
<img id="carrier_logo_img" src="{if $carrier_logo}{$carrier_logo}{else}../img/admin/carrier-default.jpg{/if}" />
<br/>
<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>
</div>
<script type="text/javascript">
var carrier_translation_undefined = '{l s='undefined' js=1}';
function removeCarrierLogo()
{
$('#carrier_logo_img').attr('src', '../img/admin/carrier-default.jpg');
$('#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

@@ -0,0 +1,68 @@
{*
* 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 the delivery announced is: @s2.' js=1}';
var summary_translation_free = '<strong>{l s='free' js=1}</strong>';
var summary_translation_paid = '<strong>{l s='not free' js=1}</strong>';
var summary_translation_range = '<span class="is_free">{l s='This carrier can deliver orders from @s1 to @s2.' js=1}</span>';
var summary_translation_range_limit = '{l s='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 will be 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>
<div class="defaultForm">
<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='This carrier will be proposed for those delivery zones:'}
<ul id="summary_zones"></ul>
</div>
<div class="clear">&nbsp;</div>
<div>
{l s='And it will be proposed for those client groups:'}
<ul id="summary_groups"></ul>
</div>
{if $is_multishop}
<div class="clear">&nbsp;</div>
<div>
{l s='Finally, this carrier will be proposed in those shops:'}
<ul id="summary_shops"></ul>
</div>
{/if}
<div class="clear">&nbsp;</div>
{$active_form}
</fieldset>
</div>
<div class="clear">&nbsp;</div>

View File

@@ -0,0 +1,40 @@
{*
* 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/list/list_content.tpl"}
{block name="open_td"}
<td
{if isset($params.position)}
id="td_{if !empty($id_category)}{$id_category}{else}0{/if}_{$tr.$identifier}"
{/if}
class="{if !$no_link}pointer{/if}
{if isset($params.position) && $order_by == 'position' && $order_way != 'DESC'} dragHandle{/if}
{if isset($params.align)} {$params.align}{/if}"
{if (!isset($params.position) && !$no_link && !isset($params.remove_onclick))}
onclick="document.location = '{$link->getAdminLink('AdminCarrierWizard', true)}&{$identifier}={$tr.$identifier}'">
{else}
>
{/if}
{/block}

View File

@@ -34,7 +34,7 @@
{if $shared_category}
<p class="warn">{l s='If you delete this picture, it will be deleted in all of your shared shops!'}</p>
{/if}
<br>
<br />
<a href="{$current}&{$identifier}={$form_id}&token={$token}&{if $shared_category}forcedeleteImage=1{else}deleteImage=1{/if}">
<img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
</a>

View File

@@ -33,7 +33,7 @@
&nbsp;<img src="../img/admin/home.gif" alt="" />
{assign var=params_url value=""}
{else}
{assign var=params_url value="&id_category={$category.id_category}&viewcategory"}
{assign var=params_url value="&id_category={$category.id_category|intval}&viewcategory"}
{/if}
{if $category.id_category == $categories_tree_current_id}
{$category.name}
@@ -43,7 +43,7 @@
{/foreach}
</div>
{if isset($delete_category) && $delete_category}
<form action="{$REQUEST_URI}" method="post">
<form action="{$REQUEST_URI|escape:'htmlall':'UTF-8'}" 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}[]" value="{$val}" />
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}[]" value="{$val|escape:'htmlall':'UTF-8'}" />
{/foreach}
{else}
<input type="hidden" name="{$key}" value="{$value}" />
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}" value="{$value|escape:'htmlall':'UTF-8'}" />
{/if}
{/if}
{/foreach}

View File

@@ -50,6 +50,21 @@
{$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}
{block name=script}
@@ -86,6 +101,10 @@
disableZipFormat();
});
$('#iso_code').change(function() {
disableTAASC();
});
disableTAASC();
});
function switchExplanationText(text) {

View File

@@ -35,7 +35,7 @@
{/block}
{block name=leadin}
{if isset($delete_customer) && $delete_customer}
<form action="{$REQUEST_URI}" method="post">
<form action="{$REQUEST_URI|escape:'htmlall':'UTF-8'}" method="post">
<div class="warn">
<h2>{l s='How do you want to delete these customer(s)?'}</h2>
<p>{l s='There are two ways of deleting a customer. Please choose your preferred method.'}</p>
@@ -52,10 +52,10 @@
{foreach $POST as $key => $value}
{if is_array($value)}
{foreach $value as $val}
<input type="hidden" name="{$key}[]" value="{$val}" />
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}[]" value="{$val|escape:'htmlall':'UTF-8'}" />
{/foreach}
{else}
<input type="hidden" name="{$key}" value="{$value}" />
<input type="hidden" name="{$key|escape:'htmlall':'UTF-8'}" value="{$value|escape:'htmlall':'UTF-8'}" />
{/if}
{/foreach}
<br /><input type="submit" class="button" value="{l s='Delete'}" />

View File

@@ -149,7 +149,7 @@
</div>
<div style="width:50%;float:left;">
<div style="margin-left:15px;"
<div style="margin-left:15px;">
<h2>{l s='Vouchers'} ({count($discounts)})</h2>
{if count($discounts)}
<table cellspacing="0" cellpadding="0" class="table">

View File

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

View File

@@ -106,10 +106,9 @@
if ($(this).attr('name') == 'category_reduction['+$('[name="id_category"]:checked').val()+']')
{
exist = true;
jAlert('{l s='This category already exists for this group.'}');
jAlert('{l s='This category already exists for this group.' js=1}');
return false;
}
});
if (exist)
@@ -127,15 +126,14 @@
category_reduction: $('#category_reduction_fancybox').val() ,
id_category: $('[name="id_category"]:checked').val()
},
success : function(jsonData)
{
success : function(jsonData) {
if (jsonData.hasError)
{
var errors = '';
for(error in jsonData.errors)
for (error in jsonData.errors)
//IE6 bug fix
if(error != 'indexOf')
errors += jsonData.errors[error] + "\n";
if (error != 'indexOf')
errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
jAlert(errors);
}
else

View File

@@ -223,7 +223,7 @@ $(document).ready(function() {
$.fancybox(
this.href,
{
'width' : 660,
'width' : 920,
'height' : 384,
'transitionIn' : 'none',
'transitionOut' : 'none',

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()) + '{l s='?' js=1}'))
if (!confirm('{l s='Are you sure that you would like to delete this' js=1}' + ' ' + $.trim($('#entity > option:selected').text().toLowerCase()) + '?'))
{
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.'}');
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}');
return false;
}
}

View File

@@ -58,7 +58,7 @@
</div>
<form action="{$current}&token={$token}" method="post" id="import_form" name="import_form">
{l s='Skip'} <input type="text" size="2" name="skip" value="0" /> {l s='lines'}
{l s='Skip'} <input type="text" size="2" name="skip" value="1" /> {l s='lines'}
<input type="hidden" name="csv" value="{$fields_value.csv}" />
<input type="hidden" name="convert" value="{$fields_value.convert}" />
<input type="hidden" name="entity" value="{$fields_value.entity}" />

View File

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

View File

@@ -49,14 +49,14 @@
<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}" />
<input type="text" id="email" name="email" class="input email_field" tabindex="1" 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}"/>
<input id="passwd" type="password" name="passwd" class="input password_field" tabindex="2" 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" />
<input type="submit" name="submitLogin" value="{l s='Log in'}" tabindex="3" class="button fl margin-right-5" />
<p class="fl no-margin hide ajax-loader">
<img src="../img/loader.gif" alt="" />
</p>

View File

@@ -77,7 +77,7 @@
</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)}<div class="conf">{$module->message}</div>{/if}
{if isset($module->message) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}<div class="conf">{$module->message}</div>{/if}
<div class="row-actions-module">
{if !isset($module->not_on_disk)}
{$module->optionsHtml}

View File

@@ -58,7 +58,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}&{if isset($categoryFiltered[$module_category_key])}un{/if}filterCategory={$module_category_key}"><span>{$module_category.name}</span></a></div>
<div class="categorieWidth"><a href="{$currentIndex}&token={$token}&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 height="60" valign="top">
<td valign="top">
<div class="moduleDesc" id="anchor{$module->name|ucfirst}">
<h3>
{$module->displayName|truncate:40:'…'} {$module->version}
{$module->displayName|truncate:36:'…'} {$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:100:'…'}
{$module->description|truncate:86:'…'}
{else}
&nbsp;
{/if}

View File

@@ -26,7 +26,7 @@
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
<div class="leadin">{block name="leadin"}{/block}</div>
<form action="{$url_submit}" id={$table}_form method="post">
<form action="{$url_submit}" id="{$table}_form" method="post">
{if $display_key}
<input type="hidden" name="show_modules" value="{$display_key}" />
{/if}
@@ -49,38 +49,10 @@
</select><sup> *</sup>
</div>
<script type="text/javascript">
//<![CDATA
function position_exception_add(shopID)
{
var listValue = $('#em_list_'+shopID).val();
var inputValue = $('#em_text_'+shopID).val();
var r = new RegExp('(^|,) *'+listValue+' *(,|$)');
if (!r.test(inputValue))
$('#em_text_'+shopID).val(inputValue + ((inputValue.trim()) ? ', ' : '') + listValue);
}
function position_exception_remove(shopID)
{
var listValue = $('#em_list_'+shopID).val();
var inputValue = $('#em_text_'+shopID).val();
var r = new RegExp('(^|,) *'+listValue+' *(,|$)');
if (r.test(inputValue))
{
var rep = '';
if (new RegExp(', *'+listValue+' *,').test(inputValue))
$('#em_text_'+shopID).val(inputValue.replace(r, ','));
else if (new RegExp(listValue+' *,').test(inputValue))
$('#em_text_'+shopID).val(inputValue.replace(r, ''));
else
$('#em_text_'+shopID).val(inputValue.replace(r, ''));
}
}
//]]>
</script>
<label>{l s='Exceptions'} :</label>
<div class="margin-form">
{l s='Please specify the files for which you do not want the module to be displayed.'}<br />
{l s='Please input each filename, separated by a comma.'}<br />
{if !$except_diff}
{$exception_list}
{else}
@@ -88,9 +60,6 @@
{$value}
{/foreach}
{/if}
{l s='Please specify the files for which you do not want the module to be displayed.'}.<br />
{l s='Please input each filename, separated by a comma.'}.
<br /><br />
</div>
<div class="margin-form">
@@ -103,3 +72,39 @@
<div class="small"><sup>*</sup> {l s='Required field'}</div>
</fieldset>
</form>
<script type="text/javascript">
//<![CDATA
function position_exception_textchange()
{
// TODO : Add & Remove automatically the "custom pages" in the "em_list_x"
var obj = $(this);
var shopID = obj.attr('id').replace(/\D/g, '');
var list = obj.parent().find('#em_list_' + shopID);
var values = obj.val().split(',');
var len = values.length;
list.find('option').prop('selected', false);
for (var i = 0; i < len; i++)
list.find('option[value="' + $.trim(values[i]) + '"]').prop('selected', true);
}
function position_exception_listchange()
{
var obj = $(this);
var shopID = obj.attr('id').replace(/\D/g, '');
var str = obj.val().join(', ');
obj.parent().find('#em_text_' + shopID).val(str);
}
$(document).ready(function(){
$('form[id="hook_module_form"] input[id^="em_text_"]').each(function(){
$(this).change(position_exception_textchange).change();
});
$('form[id="hook_module_form"] select[id^="em_list_"]').each(function(){
$(this).change(position_exception_listchange);
});
});
//]]>
</script>

View File

@@ -22,7 +22,9 @@
* @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

@@ -45,6 +45,7 @@
{/if}
</td>
<td align="center" class="productQuantity">{$product['customizationQuantityTotal']}</td>
{if $display_warehouse}<td style="" align="center">&nbsp;</td>{/if}
{if ($order->hasBeenPaid())}<td align="center" class="productQuantity">{$product['customizationQuantityRefunded']}</td>{/if}
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}<td align="center" class="productQuantity">{$product['customizationQuantityReturned']}</td>{/if}
{if $stock_management}<td align="center" class=""> - </td>{/if}
@@ -103,6 +104,7 @@
</span>
{/if}
</td>
{if $display_warehouse}<td style="" align="center">&nbsp;</td>{/if}
{if ($order->hasBeenPaid())}<td align="center">{$customization['quantity_refunded']}</td>{/if}
{if ($order->hasBeenDelivered())}<td align="center">{$customization['quantity_returned']}</td>{/if}
<td align="center">

View File

@@ -68,9 +68,9 @@
{/if}
{if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)}
#{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->delivery_number}
#{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$document->delivery_number}
{else}
{$document->getInvoiceNumberFormatted($current_id_lang)}
{$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
{/if}
{elseif get_class($document) eq 'OrderSlip'}
#{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id}
@@ -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}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}" method="post">
<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">
<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}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}">{l s='Generate invoice'}</a></p>
<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>
{/if}
</td>
</tr>

View File

@@ -40,6 +40,7 @@
</td>
<td style="display:none;" align="center" class="productQuantity"><input type="text" name="add_product[product_quantity]" id="add_product_product_quantity" value="1" size="3" disabled="disabled" /></td>
{if ($order->hasBeenPaid())}<td style="display:none;" align="center" class="productQuantity">&nbsp;</td>{/if}
{if $display_warehouse}<td style="" align="center">&nbsp;</td>{/if}
{if ($order->hasBeenDelivered())}<td style="display:none;" align="center" class="productQuantity">&nbsp;</td>{/if}
<td style="display:none;" align="center" class="productQuantity" id="add_product_product_stock">0</td>
<td style="display:none;" align="center" id="add_product_product_total">{displayPrice price=0 currency=$currency->id}</td>

View File

@@ -56,6 +56,7 @@
</span>
{/if}
</td>
{if $display_warehouse}<td>{$product.warehouse_name|escape:'htmlall':'UTF-8'}</td>{/if}
{if ($order->hasBeenPaid())}
<td align="center" class="productQuantity">
{$product['product_quantity_refunded']}

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>{$line.weight|string_format:"%.3f"} {Configuration::get('PS_WEIGHT_UNIT')}</td>
<td class="weight">{$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 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 target="_blank" 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

@@ -28,13 +28,13 @@
var changed_shipping_price = false;
var shipping_price_selected_carrier = '';
var current_index = '{$current}&token={$token}';
var admin_cart_link = '{$link->getAdminLink('AdminCarts')}';
var admin_cart_link = '{$link->getAdminLink('AdminCarts')|addslashes}';
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.'}';
var txt_hide_carts = '{l s='Hide carts and orders for this customer.'}';
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 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')}', {
$("#voucher").autocomplete('{$link->getAdminLink('AdminCartRules')|addslashes}', {
minChars: 3,
max: 15,
width: 250,
@@ -157,7 +157,7 @@
free_shipping = 1;
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -217,7 +217,7 @@
e.preventDefault();
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -254,7 +254,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -288,7 +288,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -324,7 +324,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -351,7 +351,7 @@
$('#id_cart').val(id_cart);
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: false,
dataType: "json",
data : {
@@ -378,7 +378,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -401,7 +401,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -426,7 +426,7 @@
{
$.ajax({
type:"POST",
url : "{$link->getAdminLink('AdminOrders')}",
url : "{$link->getAdminLink('AdminOrders')|escape:'html'}",
async: true,
dataType: "json",
data : {
@@ -468,7 +468,7 @@
$('#new_address').attr('href', address_link.replace(/id_customer=[0-9]+/, 'id_customer='+id_customer));
$.ajax({
type:"POST",
url : "{$link->getAdminLink('AdminCarts')}",
url : "{$link->getAdminLink('AdminCarts')|addslashes}",
async: false,
dataType: "json",
data : {
@@ -534,7 +534,7 @@
$('#products_part').show();
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminOrders')}",
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -661,17 +661,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 +766,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -822,7 +822,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -845,7 +845,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -868,7 +868,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -899,7 +899,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminOrders')}",
url: "{$link->getAdminLink('AdminOrders')|addslashes}",
async: true,
dataType: "json",
data : {
@@ -957,7 +957,7 @@
{
$.ajax({
type:"POST",
url: "{$link->getAdminLink('AdminCarts')}",
url: "{$link->getAdminLink('AdminCarts')|addslashes}",
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')}";
var admin_order_tab_link = "{$link->getAdminLink('AdminOrders')|addslashes}";
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,9 +113,7 @@
<form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post">
<select id="id_order_state" name="id_order_state">
{foreach from=$states item=state}
{if $state['id_order_state'] != $currentState->id}
<option value="{$state['id_order_state']}">{$state['name']|stripslashes}</option>
{/if}
<option value="{$state['id_order_state']}"{if $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|stripslashes}</option>
{/foreach}
</select>
<input type="hidden" name="id_order" value="{$order->id}" />
@@ -172,9 +170,9 @@
{l s='Account registered:'} <b>{dateFormat date=$customer->date_add full=true}</b><br />
{l s='Valid orders placed:'} <b>{$customerStats['nb_orders']}</b><br />
{l s='Total spent since registration:'} <b>{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</b><br />
{/if}
{/if}
</fieldset>
{/if}
{/if}
<!-- Sources block -->
{if (sizeof($sources))}
@@ -266,8 +264,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='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>
<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>
<select name="new_currency">
{foreach from=$currencies item=currency_change}
{if $currency_change['id_currency'] != $order->id_currency}
@@ -327,7 +325,7 @@
<td>{displayPrice price=$payment->amount currency=$payment->id_currency}</td>
<td>
{if $invoice = $payment->getOrderInvoice($order->id)}
{$invoice->getInvoiceNumberFormatted($current_id_lang)}
{$invoice->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
{else}
{l s='No invoice'}
{/if}
@@ -406,7 +404,7 @@
<td>
<select name="payment_invoice" id="payment_invoice">
{foreach from=$invoices_collection item=invoice}
<option value="{$invoice->id}" selected="selected">{$invoice->getInvoiceNumberFormatted($current_id_lang)}</option>
<option value="{$invoice->id}" selected="selected">{$invoice->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}</option>
{/foreach}
</select>
</td>
@@ -594,6 +592,7 @@
<th>{l s='Product'}</th>
<th style="width: 15%; text-align: center">{l s='Unit Price'} <sup>*</sup></th>
<th style="width: 4%; text-align: center">{l s='Qty'}</th>
{if $display_warehouse}<th style="text-align: center">{l s='Warehouse'}</th>{/if}
{if ($order->hasBeenPaid())}<th style="width: 3%; text-align: center">{l s='Refunded'}</th>{/if}
{if ($order->hasBeenDelivered() || $order->hasProductReturned())}<th style="width: 3%; text-align: center">{l s='Returned'}</th>{/if}
{if $stock_management}<th style="width: 10%; text-align: center">{l s='Available quantity'}</th>{/if}

View File

@@ -25,15 +25,20 @@
{extends file="helpers/view/view.tpl"}
{block name="override_tpl"}
{if !$shop_context}
{if !$shop_context}
<div class="warn">{l s='You have more than one shop and must select one to configure payment.'}</div>
{else}
{else}
{if isset($modules_list)}
{$modules_list}
{/if}
<div class="space info">
{l s='This is where you decide what payment modules are available for different variations like your customers\' currency, group, and country.'}
<br />
{l s='A check mark indicates you want the payment module available.'}
{l s='If it is not checked then this means that the Payment module is disabled.'}
<br />
{l s='Please make sure to click Save for each section.'}
</div>
{if $display_restrictions}
<br /><h2 class="space">{l s='Payment module restrictions'}</h2>
{foreach $lists as $list}
@@ -44,5 +49,5 @@
<br />
<div class='warn'>{l s='No payment module installed'}</div>
{/if}
{/if}
{/if}
{/block}

View File

@@ -34,10 +34,10 @@
{if $module->active}
<th>
{if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'}
<input type="hidden" id="checkedBox_{$list['name_id']}_{$module->name}" value="checked">
<input type="hidden" id="checkedBox_{$list['name_id']}_{$module->name}" value="checked"/>
<a href="javascript:checkPaymentBoxes('{$list['name_id']}', '{$module->name}')" style="text-decoration:none;">
{/if}
&nbsp;<img src="{$ps_base_uri}modules/{$module->name}/logo.gif" alt="{$module->name}" title="{$module->displayName}" />
&nbsp;<img src="{$ps_base_uri}modules/{$module->name}/logo.gif" alt="{$module->name}" title="{$module->displayName}"/>
{if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'}
</a>
{/if}
@@ -64,11 +64,9 @@
{$type = 'checkbox'}
{/if}
{if $type != 'null'}
<input type="checkbox" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}"
{if $item['check_list'][$key_module] == 'checked'}checked="checked"{/if}
/>
<input type="{$type}" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}" {if $item['check_list'][$key_module] == 'checked'}checked="checked"{/if}/>
{else}
--
<input type="hidden" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}"/>--
{/if}
</td>
{/if}

View File

@@ -40,6 +40,9 @@
</div>
{/if}
{$smarty.block.parent}
{if $input.type == 'radio' && $input.name == 'smarty_cache'}
<a href="{$current}&token={$token}&empty_smarty_cache=1" class="clear button" href="">{l s='Clear Smarty cache'}</a>
{/if}
{/block}
{block name="description"}
@@ -186,7 +189,7 @@
return false;
});
$('input[name="smarty_force_compile"], input[name="smarty_cache"], input[name="smarty_console"]').change(function(){
$('input[name="smarty_force_compile"], input[name="smarty_cache"], input[name="smarty_console"], input[name="smarty_console_key"]').change(function(){
$('#smarty_up').val(1);
});

View File

@@ -78,7 +78,7 @@
<tr id="image_id">
<td style="padding: 4px;">
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox">
<img src="{$smarty.const._THEME_PROD_DIR_}en-default-small_default.jpg" alt="image_id" title="image_id" />
<img src="{$smarty.const._THEME_PROD_DIR_}{$iso_lang}-default-small_default.jpg" alt="image_id" title="image_id" />
</a>
</td>
<td id="td_image_id" class="pointer dragHandle center positionImage">
@@ -313,12 +313,13 @@
{
line = $("#lineType").html();
line = line.replace(/image_id/g, id);
line = line.replace(/en-default/g, path);
line = line.replace(/[a-z]{2}-default/g, path);
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, "");
if (shops != false)
{
$.each(shops, function(key, value){
@@ -326,8 +327,10 @@
line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked');
});
}
$("#imageList").append(line);
}
$('.fancybox').fancybox();
});
{/literal}

View File

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

View File

@@ -24,8 +24,8 @@
*}
<script type="text/javascript">
var msg_select_one = "{l s="Please select at least one product." js=1}";
var msg_set_quantity = "{l s="Please set a quantity to add a product." js=1}";
var msg_select_one = "{l s='Please select at least one product.' js=1}";
var msg_set_quantity = "{l s='Please set a quantity to add a product.' js=1}";
</script>
<input type="hidden" name="submitted_tabs[]" value="Pack" />
<h4>{l s='Pack'}</h4>

View File

@@ -25,7 +25,7 @@
<script type="text/javascript">
var Customer = new Object();
var product_url = '{$link->getAdminLink('AdminProducts', true)}';
var product_url = '{$link->getAdminLink('AdminProducts', true)|addslashes}';
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')}",
"url": "{$link->getAdminLink('AdminCustomers')|addslashes}",
"async": true,
"dataType": "json",
"data": {

View File

@@ -71,7 +71,7 @@
<label>{l s='Carriers:'}</label>
</td>
<td class="padding-bottom:5px;">
<select name="carriers[]" id="carriers_restriction" multiple="multiple" size="4" style="height:100px;width:200px;">
<select name="carriers[]" id="carriers_restriction" multiple="multiple" size="4" style="height:100px;width:300px;">
{foreach $carrier_list as $carrier}
<option value="{$carrier.id_reference}" {if isset($carrier.selected) && $carrier.selected}selected="selected"{/if}>{$carrier.name}</option>
{/foreach}

View File

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

View File

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

View File

@@ -1,105 +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
*}
{$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

@@ -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)'}'); return false;"
onclick="jAlert('{l s='You cannot delete this shop\'s (customer and/or order dependency)' js=1}'); 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')}",
'url': "{$link->getAdminLink('AdminShop')|addslashes}",
'data': function(n)
{
return {

View File

@@ -161,6 +161,13 @@ function add_condition(id_condition_group, type, value)
function delete_condition(condition)
{
delete conditions[condition];
to_delete = $('#'+condition).prev();
if ($(to_delete).children().hasClass('btn_delete_condition'))
$(to_delete).remove();
else
$('#'+condition).next().remove();
$('#'+condition).remove();
return false;
}
@@ -178,7 +185,7 @@ function new_condition_group()
function appendConditionToGroup(html)
{
if ($('#condition_group_'+current_id_condition_group+' table tbody tr').length > 0)
$('#condition_group_'+current_id_condition_group+' table tbody').append('<tr><td align="center" colspan="3"><b>{l s='AND' js=1}</b></td></tr>');
$('#condition_group_'+current_id_condition_group+' table tbody').append('<tr><td align="center" class="btn_delete_condition" colspan="3"><b>{l s='AND' js=1}</b></td></tr>');
$('#condition_group_'+current_id_condition_group+' table tbody').append(html);
}
@@ -284,7 +291,7 @@ $(document).ready(function() {
$('#id_attribute_group option[value="{$condition.id_attribute_group}"]').attr('selected', true);
$('#id_attribute_{$condition.id_attribute_group} option[value="{$condition.value}"]').attr('selected', true);
{elseif $condition.type == 'feature'}
$('#id_feature[value="{$condition.id_feature}"]').attr('selected', true);
$('#id_feature option[value="{$condition.id_feature}"]').attr('selected', true);
$('#id_feature_{$condition.id_feature} option[value="{$condition.value}"]').attr('selected', true);
{else}
$('#id_{$condition.type} option[value="{$condition.value}"]').attr('selected', true);

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|escape}{$table|escape}{/if}{if $identifier && $id}&{$identifier|escape}={$id|escape}{/if}{if isset($smarty.get.module)}&module={$smarty.get.module|escape}{/if}{if isset($smarty.get.id_product)}&id_product={$smarty.get.id_product|escape}{/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

@@ -30,55 +30,44 @@
<h2>{$supplier->name}</h2>
<h3>{l s='Number of products:'} {count($products)}</h3>
{foreach $products AS $product}
<hr />
{if !$product->hasAttributes()}
<table border="0" cellpadding="0" cellspacing="0" class="table" style="">
<table border="0" cellpadding="0" cellspacing="0" class="table" width="100%">
<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>
</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='Product name'}</th>
<th>{l s='Attribute name'}</th>
<th>{l s='Supplier Reference'}</th>
<th >{l s='Wholesale price'}</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}
{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>{$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>
<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}
</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.'}');
jAlert('{l s='Please select at least one product.' js=1}');
return false;
}

View File

@@ -92,7 +92,7 @@
<br />
{foreach $modules_translations as $theme_name => $theme}
<h2>&gt;{l s='Theme:'} <a name="{$theme_name}">{if $theme_name === $default_theme_name}{l s='default'}{else}{$theme_name}{/if} </h2>
{if $theme_name}<h2>&gt;{l s='Theme:'} <a name="{$theme_name}">{$theme_name}</h2>{/if}
{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 === 'default'}{l s='default'}{else}{$theme_name}{/if} - {$template_name}
<legend style="cursor : pointer" onclick="$('#{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}').slideToggle();">{if $theme_name}{$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}">

View File

@@ -35,11 +35,12 @@
</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
<span>Questions / Renseignements / Formations :</span> <strong>+33 (0)1.40.18.30.04</strong>
{/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>
|&nbsp;<a href="http://www.prestashop.com/en/contact-us?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Contact'}</a>
|&nbsp;<a href="http://forge.prestashop.com/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Bug Tracker'}</a>
|&nbsp;<a href="http://www.prestashop.com/forums/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Forum'}</a>
|&nbsp;<a href="http://addons.prestashop.com/?utm_source=backoffice_footer" target="_blank" class="footer_link">{l s='Addons'}</a>
</div>
</div>
</div>

View File

@@ -69,6 +69,7 @@
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}
@@ -204,7 +205,7 @@
<ul class="submenu">
{foreach from=$t.sub_tabs item=t2}
{if $t2.active}
<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>
<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>
{/if}
{/foreach}
</ul>

View File

@@ -30,7 +30,7 @@
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
{block name="defaultForm"}
<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}>
<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}>
{if $form_id}
<input type="hidden" name="{$identifier}" id="{$identifier}" value="{$form_id}" />
{/if}
@@ -234,17 +234,29 @@
{/foreach}
{elseif $input.type == 'file'}
{if isset($input.display_image) && $input.display_image}
{if isset($fields_value.image) && $fields_value.image}
{if isset($fields_value[$input.name].image) && $fields_value[$input.name].image}
<div id="image">
{$fields_value.image}
<p align="center">{l s='File size'} {$fields_value.size}kb</p>
{$fields_value[$input.name].image}
<p align="center">{l s='File size'} {$fields_value[$input.name].size}kb</p>
<a href="{$current}&{$identifier}={$form_id}&token={$token}&deleteImage=1">
<img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
</a>
</div><br />
{/if}
{/if}
{if isset($input.lang) AND $input.lang}
<div class="translatable">
{foreach $languages as $language}
<div class="lang_{$language.id_lang}" id="{$input.name}_{$language.id_lang}" style="display:{if $language.id_lang == $defaultFormLanguage}block{else}none{/if}; float: left;">
<input type="file" name="{$input.name}_{$language.id_lang}" {if isset($input.id)}id="{$input.id}_{$language.id_lang}"{/if} />
</div>
{/foreach}
</div>
{else}
<input type="file" name="{$input.name}" {if isset($input.id)}id="{$input.id}"{/if} />
{/if}
{if !empty($input.hint)}<span class="hint" name="help_box">{$input.hint}<span class="hint-pointer">&nbsp;</span></span>{/if}
{elseif $input.type == 'password'}
<input type="password"
@@ -302,7 +314,6 @@
{if isset($input.class)}class="{$input.class}"
{else}class="color mColorPickerInput"{/if}
name="{$input.name}"
class="{if isset($input.class)}{$input.class}{/if}"
value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}" />
{elseif $input.type == 'date'}
<input type="text"
@@ -343,13 +354,13 @@
{/if}
{/if}
{/foreach}
{hook h='displayAdminForm'}
{hook h='displayAdminForm' fieldset=$f}
{if isset($name_controller)}
{capture name=hookName assign=hookName}display{$name_controller|ucfirst}Form{/capture}
{hook h=$hookName}
{hook h=$hookName fieldset=$f}
{elseif isset($smarty.get.controller)}
{capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}Form{/capture}
{hook h=$hookName}
{hook h=$hookName fieldset=$f}
{/if}
{elseif $key == 'submit'}
<div class="margin-form">

View File

@@ -59,7 +59,7 @@
{block name="td_content"}
{if isset($params.prefix)}{$params.prefix}{/if}
{if isset($params.color) && isset($tr[$params.color])}
<span class="color_field" style="background-color:{$tr.color};color:{if Tools::getBrightness($tr.color) < 128}white{else}#383838{/if}">
<span class="color_field" style="background-color:{$tr[$params.color]};color:{if Tools::getBrightness($tr[$params.color]) < 128}white{else}#383838{/if}">
{/if}
{if isset($tr.$key)}
{if isset($params.active)}

View File

@@ -27,8 +27,8 @@
<script type="text/javascript">
$(document).ready(function() {
$('table.{$table} .filter').keypress(function(event){
formSubmit(event, 'submitFilterButton{$table}')
$('table.{$list_id} .filter').keypress(function(event){
formSubmit(event, 'submitFilterButton{$list_id}')
})
});
</script>
@@ -37,7 +37,7 @@
<script type="text/javascript" src="../js/jquery/plugins/jquery.tablednd.js"></script>
<script type="text/javascript">
var token = '{$token}';
var come_from = '{$table}';
var come_from = '{$list_id}';
var alternate = {if $order_way == 'DESC'}'1'{else}'0'{/if};
</script>
<script type="text/javascript" src="../js/admin-dnd.js"></script>
@@ -45,8 +45,8 @@
<script type="text/javascript">
$(function() {
if ($("table.{$table} .datepicker").length > 0)
$("table.{$table} .datepicker").datepicker({
if ($("table.{$list_id} .datepicker").length > 0)
$("table.{$list_id} .datepicker").datepicker({
prevText: '',
nextText: '',
dateFormat: 'yy-mm-dd'
@@ -83,7 +83,7 @@
{block name="override_form_extra"}{/block}
<input type="hidden" id="submitFilter{$table}" name="submitFilter{$table}" value="0"/>
<input type="hidden" id="submitFilter{$list_id}" name="submitFilter{$list_id}" value="0"/>
{/if}
<table class="table_grid" name="list_table">
{if !$simple_header}
@@ -91,16 +91,16 @@
<td style="vertical-align: bottom;">
<span style="float: left;">
{if $page > 1}
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE('submitFilter{$table}').value=1"/>&nbsp;
<input type="image" src="../img/admin/list-prev.gif" onclick="getE('submitFilter{$table}').value={$page - 1}"/>
<input type="image" src="../img/admin/list-prev2.gif" onclick="getE('submitFilter{$list_id}').value=1"/>&nbsp;
<input type="image" src="../img/admin/list-prev.gif" onclick="getE('submitFilter{$list_id}').value={$page - 1}"/>
{/if}
{l s='Page'} <b>{$page}</b> / {$total_pages}
{if $page < $total_pages}
<input type="image" src="../img/admin/list-next.gif" onclick="getE('submitFilter{$table}').value={$page + 1}"/>&nbsp;
<input type="image" src="../img/admin/list-next2.gif" onclick="getE('submitFilter{$table}').value={$total_pages}"/>
<input type="image" src="../img/admin/list-next.gif" onclick="getE('submitFilter{$list_id}').value={$page + 1}"/>&nbsp;
<input type="image" src="../img/admin/list-next2.gif" onclick="getE('submitFilter{$list_id}').value={$total_pages}"/>
{/if}
| {l s='Display'}
<select name="pagination" onchange="submit()">
<select name="{$list_id}_pagination" onchange="submit()">
{* Choose number of results per page *}
{foreach $pagination AS $value}
<option value="{$value|intval}"{if $selected_pagination == $value} selected="selected" {elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option>
@@ -109,8 +109,8 @@
/ {$list_total} {l s='result(s)'}
</span>
<span style="float: right;">
<input type="submit" name="submitReset{$table}" value="{l s='Reset'}" class="button" />
<input type="submit" id="submitFilterButton{$table}" name="submitFilter" value="{l s='Filter'}" class="button" />
<input type="submit" id="submitFilterButton{$list_id}" name="submitFilter" value="{l s='Filter'}" class="button" />
<input type="submit" name="submitReset{$list_id}" value="{l s='Reset'}" class="button" />
</span>
<span class="clear"></span>
</td>
@@ -120,7 +120,7 @@
<td{if $simple_header} style="border:none;"{/if}>
<table
{if $table_id} id={$table_id}{/if}
class="table {if $table_dnd}tableDnD{/if} {$table}"
class="table {if $table_dnd}tableDnD{/if} {$list_id}"
cellpadding="0" cellspacing="0"
style="width: 100%; margin-bottom:10px;">
<col width="10px" />
@@ -137,7 +137,7 @@
<tr class="nodrag nodrop" style="height: 40px">
<th class="center">
{if $has_bulk_actions}
<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, '{$table}Box[]', this.checked)" />
<input type="checkbox" name="checkme" class="noborder" onclick="checkDelBoxes(this.form, '{$list_id}Box[]', this.checked)" />
{/if}
</th>
{foreach $fields_display AS $key => $params}
@@ -148,9 +148,9 @@
</span>
{if (!isset($params.orderby) || $params.orderby) && !$simple_header}
<br />
<a href="{$currentIndex}&{$table}Orderby={$key|urlencode}&{$table}Orderway=desc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<a href="{$currentIndex}&{$list_id}Orderby={$key|urlencode}&{$list_id}Orderway=desc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<img border="0" src="../img/admin/down{if isset($order_by) && ($key == $order_by) && ($order_way == 'DESC')}_d{/if}.gif" /></a>
<a href="{$currentIndex}&{$table}Orderby={$key|urlencode}&{$table}Orderway=asc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<a href="{$currentIndex}&{$list_id}Orderby={$key|urlencode}&{$list_id}Orderway=asc&token={$token}{if isset($smarty.get.$identifier)}&{$identifier}={$smarty.get.$identifier|intval}{/if}">
<img border="0" src="../img/admin/up{if isset($order_by) && ($key == $order_by) && ($order_way == 'ASC')}_d{/if}.gif" /></a>
{elseif !$simple_header}
<br />&nbsp;
@@ -186,7 +186,7 @@
--
{else}
{if $params.type == 'bool'}
<select onchange="$('#submitFilterButton{$table}').focus();$('#submitFilterButton{$table}').click();" name="{$table}Filter_{$key}">
<select onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$key}">
<option value="">--</option>
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option>
@@ -196,7 +196,7 @@
{l s='To'} <input type="text" class="filter datepicker" id="{$params.id_date}_1" name="{$params.name_date}[1]" value="{if isset($params.value.1)}{$params.value.1}{/if}"{if isset($params.width)} style="width:70px"{/if}/>
{elseif $params.type == 'select'}
{if isset($params.filter_key)}
<select onchange="$('#submitFilterButton{$table}').focus();$('#submitFilterButton{$table}').click();" name="{$table}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<select onchange="$('#submitFilterButton{$list_id}').focus();$('#submitFilterButton{$list_id}').click();" name="{$list_id}Filter_{$params.filter_key}" {if isset($params.width)} style="width:{$params.width}px"{/if}>
<option value="" {if $params.value == ''} selected="selected" {/if}>--</option>
{if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display}
@@ -206,7 +206,7 @@
</select>
{/if}
{else}
<input type="text" class="filter" name="{$table}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'htmlall':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{else}style="width:95%"{/if} />
<input type="text" class="filter" name="{$list_id}Filter_{if isset($params.filter_key)}{$params.filter_key}{else}{$key}{/if}" value="{$params.value|escape:'htmlall':'UTF-8'}" {if isset($params.width) && $params.width != 'auto'} style="width:{$params.width}px"{else}style="width:95%"{/if} />
{/if}
{/if}
</td>

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 %2 == 0}
{if $count %3 == 0}
</li>
<li>
{/if}

View File

@@ -35,7 +35,7 @@
</span>
{if count($errors) == 1}
{$errors[0]}
{reset($errors)}
{else}
{l s='%d errors' sprintf=$errors|count}
<br/>

View File

@@ -38,7 +38,7 @@
<div style="float:right;margin:5px">
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png"></a>
</div>
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0"></div>
<div id="modules_list_loader"><img src="../img/loader.gif" alt="" border="0" /></div>
<div id="modules_list_container_tab" style="display:none;"></div>
</div>
{/if}

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=attachment'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
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');

View File

@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=authentication'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
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');

View File

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

View File

@@ -25,6 +25,8 @@
'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'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
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');

View File

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

View File

@@ -222,7 +222,7 @@ class AddressCore extends ObjectModel
public function validateController($htmlentities = true)
{
$errors = parent::validateController($htmlentities);
if (!Configuration::get('VATNUMBER_CHECKING'))
if (!Configuration::get('VATNUMBER_MANAGEMENT') || !Configuration::get('VATNUMBER_CHECKING'))
return $errors;
include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php');
if (class_exists('VatNumber', false))
@@ -237,6 +237,8 @@ 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];
@@ -259,6 +261,9 @@ 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
@@ -308,11 +313,10 @@ class AddressCore extends ObjectModel
{
$key = 'address_exists_'.(int)$id_address;
if (!Cache::isStored($key))
Cache::store(
$key, Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT `id_address`
FROM '._DB_PREFIX_.'address a
WHERE a.`id_address` = '.(int)$id_address));
{
$id_address = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_address` FROM '._DB_PREFIX_.'address a WHERE a.`id_address` = '.(int)$id_address);
Cache::store($key, (bool)$id_address);
}
return Cache::retrieve($key);
}

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], $this->context->language->id);
echo Tools::displayDate($tr[$key]);
elseif (isset($params['type']) && $params['type'] == 'datetime')
echo Tools::displayDate($tr[$key], $this->context->language->id, true);
echo Tools::displayDate($tr[$key],null , true);
elseif (isset($tr[$key]))
{
if ($key == 'price')

View File

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

View File

@@ -70,6 +70,11 @@ 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;
@@ -80,6 +85,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;
@@ -109,7 +119,7 @@ class AttributeGroupCore extends ObjectModel
public function delete()
{
if (!$this->hasMultishopEntries())
if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL)
{
/* Select children in order to find linked combinations */
$attribute_ids = Db::getInstance()->executeS('
@@ -132,11 +142,14 @@ class AttributeGroupCore extends ObjectModel
if (!AttributeGroup::cleanDeadCombinations())
return false;
/* Also delete related attributes */
if (Db::getInstance()->execute('
if (count($to_remove))
if (!Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'attribute_lang`
WHERE `id_attribute`
IN (SELECT id_attribute FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id.')') === false ||
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id) === false)
WHERE `id_attribute` IN ('.implode(',', $to_remove).')') ||
!Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'attribute_shop`
WHERE `id_attribute` IN ('.implode(',', $to_remove).')') ||
!Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id))
return false;
$this->cleanPositions();
}

View File

@@ -136,27 +136,17 @@ class Autoload
}
else
{
// 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
$filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE)
{
$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;
rename($filename_tmp, $filename);
@chmod($filename, 0664);
}
while (!$integrity_is_ok);
if (!$integrity_is_ok)
else
{
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');
// $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);
}
}

View File

@@ -53,7 +53,7 @@ class CMSCore extends ObjectModel
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128),
'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128),
'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999),
'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 3999999999999),
),
);

View File

@@ -165,6 +165,14 @@ 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
@@ -370,13 +378,12 @@ class CarrierCore extends ObjectModel
*/
public static function getDeliveryPriceByRanges($range_table, $id_carrier)
{
$range_table = pSQL($range_table);
$sql = 'SELECT d.id_'.$range_table.', d.id_carrier, d.id_zone, d.price
$sql = 'SELECT d.`id_'.bqSQL($range_table).'`, d.id_carrier, d.id_zone, d.price
FROM '._DB_PREFIX_.'delivery d
LEFT JOIN '._DB_PREFIX_.$range_table.' r ON r.id_'.$range_table.' = d.id_'.$range_table.'
LEFT JOIN `'._DB_PREFIX_.bqSQL($range_table).'` r ON r.`id_'.bqSQL($range_table).'` = d.`id_'.bqSQL($range_table).'`
WHERE d.id_carrier = '.(int)$id_carrier.'
AND d.id_'.$range_table.' IS NOT NULL
AND d.id_'.$range_table.' != 0
AND d.`id_'.bqSQL($range_table).'` IS NOT NULL
AND d.`id_'.bqSQL($range_table).'` != 0
'.Carrier::sqlDeliveryRangeShop($range_table).'
ORDER BY r.delimiter1';
return Db::getInstance()->executeS($sql);
@@ -456,6 +463,22 @@ 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)
{
if (!Validate::isBool($active_countries) || !Validate::isBool($active_carriers))
@@ -467,7 +490,9 @@ 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
SELECT cl.*,c.*, cl.`name` AS country, zz.`name` AS zone
FROM `'._DB_PREFIX_.'country` c'.
Shop::addSqlAssociation('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) ' : ') ').'
@@ -565,8 +590,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)
@@ -710,7 +735,7 @@ class CarrierCore extends ObjectModel
*/
public function deleteDeliveryPrice($range_table)
{
$where = '`id_carrier` = '.(int)$this->id.' AND (`id_'.$range_table.'` IS NOT NULL OR `id_'.$range_table.'` = 0) ';
$where = '`id_carrier` = '.(int)$this->id.' AND (`id_'.bqSQL($range_table).'` IS NOT NULL OR `id_'.bqSQL($range_table).'` = 0) ';
if (Shop::getContext() == Shop::CONTEXT_ALL)
$where .= 'AND id_shop IS NULL AND id_shop_group IS NULL';
@@ -728,7 +753,7 @@ class CarrierCore extends ObjectModel
* @param array $priceList Prices list in multiple arrays (changed to array since 1.5.0)
* @return boolean Insertion result
*/
public function addDeliveryPrice($price_list)
public function addDeliveryPrice($price_list, $delete = false)
{
if (!$price_list)
return false;
@@ -747,6 +772,17 @@ class CarrierCore extends ObjectModel
if (!isset($values['id_shop_group']))
$values['id_shop_group'] = (Shop::getContext() != Shop::CONTEXT_ALL) ? Shop::getContextShopGroupID() : null;
if ($delete)
Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'delivery`
WHERE id_shop = '.(int)$values['id_shop'].'
AND id_shop_group='.(int)$values['id_shop_group'].'
AND id_carrier='.(int)$values['id_carrier'].
($values['id_range_price'] !== null ? ' AND id_range_price='.(int)$values['id_range_price'] : '').
($values['id_range_weight'] !== null ? ' AND id_range_weight='.(int)$values['id_range_weight'] : '').'
AND id_zone='.(int)$values['id_zone']
);
$sql .= '(';
foreach ($values as $v)
{
@@ -850,8 +886,7 @@ class CarrierCore extends ObjectModel
(SELECT '.(int)$this->id.', `id_tax_rules_group`, `id_shop`
FROM `'._DB_PREFIX_.'carrier_tax_rules_group_shop`
WHERE `id_carrier`='.(int)$old_id.')');
// Update warehouse_carriers
Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'warehouse_carrier SET id_carrier='.(int)$this->id.' WHERE id_carrier='.(int)$old_id);
}
/**
@@ -911,9 +946,11 @@ class CarrierCore extends ObjectModel
return false;
}
public function getRangeObject()
public function getRangeObject($shipping_method = false)
{
if (!$shipping_method)
$shipping_method = $this->getShippingMethod();
if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT)
return new RangeWeight();
elseif ($shipping_method == Carrier::SHIPPING_METHOD_PRICE)
@@ -1031,9 +1068,9 @@ class CarrierCore extends ObjectModel
$sql = 'AND '.$alias.'.id_delivery = (
SELECT d2.id_delivery
FROM '._DB_PREFIX_.'delivery d2
WHERE d2.id_carrier = '.$alias.'.id_carrier
AND d2.id_zone = '.$alias.'.id_zone
AND d2.id_'.$range_table.' = '.$alias.'.id_'.$range_table.'
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.'
ORDER BY d2.id_shop DESC, d2.id_shop_group DESC
LIMIT 1
@@ -1249,5 +1286,17 @@ class CarrierCore extends ObjectModel
return true;
}
}
public function setGroups($groups, $delete = true)
{
if ($delete)
Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$this->id);
if (!is_array($groups) || !count($groups))
return true;
$sql = 'INSERT INTO '._DB_PREFIX_.'carrier_group (id_carrier, id_group) VALUES ';
foreach ($groups as $id_group)
$sql .= '('.(int)$this->id.', '.(int)$id_group.'),';
return Db::getInstance()->execute(rtrim($sql, ','));
}
}

View File

@@ -134,6 +134,7 @@ class CartCore extends ObjectModel
'cart_rows' => array('resource' => 'cart_row', 'virtual_entity' => true, 'fields' => array(
'id_product' => array('required' => true, 'xlink_resource' => 'products'),
'id_product_attribute' => array('required' => true, 'xlink_resource' => 'combinations'),
'id_address_delivery' => array('required' => true, 'xlink_resource' => 'addresses'),
'quantity' => array('required' => true),
)
),
@@ -209,7 +210,7 @@ class CartCore extends ObjectModel
if (!isset($this->id_address_invoice) || $this->id_address_invoice == $id_address)
{
$to_update = true;
$this->context->cart->id_address_invoice = $id_address_new;
$this->id_address_invoice = $id_address_new;
}
if (!isset($this->id_address_delivery) || $this->id_address_delivery == $id_address)
{
@@ -424,9 +425,10 @@ 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`, 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,
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,
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');
@@ -631,8 +633,8 @@ class CartCore extends ObjectModel
{
$row2 = Db::getInstance()->getRow('
SELECT image_shop.`id_image` id_image, il.`legend`
FROM `'._DB_PREFIX_.'image` i'.
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').'
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'].')
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'
);
@@ -763,6 +765,9 @@ class CartCore extends ObjectModel
if (!Validate::isLoadedObject($cartRule))
return false;
if (Db::getInstance()->getValue('SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$this->id))
return false;
// Add the cart rule to the cart
if (!Db::getInstance()->insert('cart_cart_rule', array(
'id_cart_rule' => (int)$id_cart_rule,
@@ -2542,6 +2547,7 @@ class CartCore extends ObjectModel
if (empty($id_carrier) && $this->isCarrierInRange((int)Configuration::get('PS_CARRIER_DEFAULT'), (int)$id_zone))
$id_carrier = (int)Configuration::get('PS_CARRIER_DEFAULT');
$total_package_without_shipping_tax_inc = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list);
if (empty($id_carrier))
{
if ((int)$this->id_customer)
@@ -2576,7 +2582,7 @@ class CartCore extends ObjectModel
{
$check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $this->getTotalWeight(), (int)$id_zone);
$total_order = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list);
$total_order = $total_package_without_shipping_tax_inc;
$check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $total_order, (int)$id_zone, (int)$this->id_currency);
// Get only carriers that have a range compatible with cart
@@ -2679,26 +2685,8 @@ class CartCore extends ObjectModel
$id_zone = (int)$default_country->id_zone;
}
$check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight((int)$carrier->id, $this->getTotalWeight(), (int)$id_zone);
// Code Review V&V TO FINISH
$check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice(
$carrier->id,
$this->getOrderTotal(
true,
Cart::BOTH_WITHOUT_SHIPPING,
$product_list
),
$id_zone,
(int)$this->id_currency
);
if ((
$carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT
&& !$check_delivery_price_by_weight
) || (
$carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE
&& !$check_delivery_price_by_price
if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT && !Carrier::checkDeliveryPriceByWeight($carrier->id, $this->getTotalWeight(), (int)$id_zone))
|| ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE && !Carrier::checkDeliveryPriceByPrice($carrier->id, $total_package_without_shipping_tax_inc, $id_zone, (int)$this->id_currency)
))
$shipping_cost += 0;
else
@@ -2845,7 +2833,10 @@ class CartCore extends ObjectModel
$formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery);
$formatted_addresses['invoice'] = AddressFormat::getFormattedLayoutData($invoice);
$total_tax = $this->getOrderTotal() - $this->getOrderTotal(false);
$base_total_tax_inc = $this->getOrderTotal(true);
$base_total_tax_exc = $this->getOrderTotal(false);
$total_tax = $base_total_tax_inc - $base_total_tax_exc;
if ($total_tax < 0)
$total_tax = 0;
@@ -2943,9 +2934,9 @@ class CartCore extends ObjectModel
'total_shipping_tax_exc' => $total_shipping_tax_exc,
'total_products_wt' => $total_products_wt,
'total_products' => $total_products,
'total_price' => $this->getOrderTotal(),
'total_price' => $base_total_tax_inc,
'total_tax' => $total_tax,
'total_price_without_tax' => $this->getOrderTotal(false),
'total_price_without_tax' => $base_total_tax_exc,
'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1),
'free_ship' => $total_shipping ? 0 : 1,
'carrier' => new Carrier($this->id_carrier, $id_lang),
@@ -2958,12 +2949,8 @@ class CartCore extends ObjectModel
return false;
foreach ($this->getProducts() as $product)
if (!$product['active']
|| (
!$product['allow_oosp'] && $product['stock_quantity'] < $product['cart_quantity']
)
|| !$product['available_for_order'])
if (!$product['active'] || !$product['available_for_order']
|| (!$product['allow_oosp'] && $product['stock_quantity'] < $product['cart_quantity']))
return false;
return true;
@@ -3047,8 +3034,10 @@ class CartCore extends ObjectModel
public function addTextFieldToProduct($id_product, $index, $type, $text_value)
{
$text_value = str_replace(array("\n", "\r"), '', nl2br($text_value));
if (!_PS_MAGIC_QUOTES_GPC_){
$text_value = str_replace('\\', '\\\\', $text_value);
$text_value = str_replace('\'', '\\\'', $text_value);
}
return $this->_addCustomization($id_product, 0, $index, $type, $text_value, 0);
}
@@ -3224,25 +3213,24 @@ class CartCore extends ObjectModel
public function getWsCartRows()
{
$query = '
return Db::getInstance()->executeS('
SELECT id_product, id_product_attribute, quantity
FROM `'._DB_PREFIX_.'cart_product`
WHERE id_cart = '.(int)$this->id.'
AND id_shop = '.(int)Context::getContext()->shop->id;
$result = Db::getInstance()->executeS($query);
return $result;
WHERE id_cart = '.(int)$this->id.' AND id_shop = '.(int)Context::getContext()->shop->id
);
}
public function setWsCartRows($values)
{
if ($this->deleteAssociations())
{
$query = 'INSERT INTO `'._DB_PREFIX_.'cart_product`(`id_cart`, `id_product`, `id_product_attribute`, `quantity`, `date_add`, `id_shop`) VALUES ';
$query = 'INSERT INTO `'._DB_PREFIX_.'cart_product`(`id_cart`, `id_product`, `id_product_attribute`, `id_address_delivery`, `quantity`, `date_add`, `id_shop`) VALUES ';
foreach ($values as $value)
$query .= '('.(int)$this->id.', '.(int)$value['id_product'].', '.
(isset($value['id_product_attribute']) ? (int)$value['id_product_attribute'] : 'NULL').', '.(int)$value['quantity'].', NOW(), '.(int)Context::getContext()->shop->id.'),';
(isset($value['id_product_attribute']) ? (int)$value['id_product_attribute'] : 'NULL').', '.
(isset($value['id_address_delivery']) ? (int)$value['id_address_delivery'] : 0).', '.
(int)$value['quantity'].', NOW(), '.(int)Context::getContext()->shop->id.'),';
Db::getInstance()->execute(rtrim($query, ','));
}
@@ -3426,6 +3414,8 @@ class CartCore extends ObjectModel
* Update products cart address delivery with the address delivery of the cart
*/
public function setNoMultishipping()
{
if (Configuration::get('PS_ALLOW_MULTISHIPPING'))
{
// Upgrading quantities
$sql = 'SELECT sum(`quantity`) as quantity, id_product, id_product_attribute, count(*) as count
@@ -3458,31 +3448,26 @@ class CartCore extends ObjectModel
AND (cp1.date_add > cp2.date_add)
)';
Db::getInstance()->execute($sql);
}
// Upgrading address delivery
$sql = 'UPDATE `'._DB_PREFIX_.'cart_product`
SET `id_address_delivery` =
(
SELECT `id_address_delivery`
FROM `'._DB_PREFIX_.'cart`
WHERE `id_cart` = '.(int)$this->id.'
AND `id_shop` = '.(int)$this->id_shop.'
// Update delivery address for each product line
Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'cart_product`
SET `id_address_delivery` = (
SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
WHERE `id_cart` = '.(int)$this->id.' AND `id_shop` = '.(int)$this->id_shop.'
)
WHERE `id_cart` = '.(int)$this->id.'
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : '');
'.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : ''));
Db::getInstance()->execute($sql);
$sql = 'UPDATE `'._DB_PREFIX_.'customization`
SET `id_address_delivery` =
(
SELECT `id_address_delivery`
FROM `'._DB_PREFIX_.'cart`
if (Customization::isFeatureActive())
Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'customization`
SET `id_address_delivery` = (
SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
WHERE `id_cart` = '.(int)$this->id.'
)
WHERE `id_cart` = '.(int)$this->id;
Db::getInstance()->execute($sql);
WHERE `id_cart` = '.(int)$this->id);
}
/**

View File

@@ -10,7 +10,7 @@
* 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 502immediately.
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
@@ -333,11 +333,8 @@ class CartRuleCore extends ObjectModel
return array();
$productRuleGroups = array();
$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)
$result = Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'cart_rule_product_rule_group WHERE id_cart_rule = '.(int)$this->id);
foreach ($result 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']);
@@ -498,49 +495,34 @@ class CartRuleCore extends ObjectModel
$cartTotal = $context->cart->getOrderTotal($this->minimum_amount_tax, Cart::ONLY_PRODUCTS);
if ($this->minimum_amount_shipping)
$cartTotal += $context->cart->getOrderTotal($this->minimum_amount_tax, Cart::ONLY_SHIPPING);
$products = $context->cart->getProducts();
$cart_rules = $context->cart->getCartRules();
// If a product is given for free in this rule and already in the cart, the price is subtracted
if ($this->gift_product && $alreadyInCart)
{
$query = new DbQuery();
$query->select('id_product');
$query->from('cart_product');
$query->where('id_product = '.(int)$this->gift_product);
$query->where('id_cart = '.(int)$context->cart->id);
if ((int)$this->gift_product_attribute)
$query->where('id_product_attribute = '.(int)$this->gift_product_attribute);
if (Db::getInstance()->getValue($query))
{
$ref = false;
$product_price = Product::getPriceStatic(
$this->gift_product,
$this->minimum_amount_tax,
$this->gift_product_attribute,
null, null, false, true, 1, null,
$context->cart->id_customer ? $context->cart->id_customer : null,
$context->cart->id,
(int)$context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')} ? (int)$context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')} : null,
$ref, true, true, $context, true
);
$cartTotal -= $product_price;
}
}
foreach ($cart_rules as &$cart_rule)
if ($cart_rule['gift_product'])
foreach ($products as $key => &$product)
if (empty($product['gift']) && $product['id_product'] == $cart_rule['gift_product'] && $product['id_product_attribute'] == $cart_rule['gift_product_attribute'])
$cartTotal = Tools::ps_round($cartTotal - $product[$this->minimum_amount_tax ? 'price_wt' : 'price'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_);
if ($cartTotal < $minimum_amount)
return (!$display_error) ? false : Tools::displayError('You have not reached the minimum amount required to use this voucher');
}
// 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
/* 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);
$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('
@@ -561,6 +543,9 @@ class CartRuleCore extends ObjectModel
}
}
if (!$nb_products)
return (!$display_error) ? false : Tools::displayError('Cart is empty');
if (!$display_error)
return true;
}
@@ -630,7 +615,8 @@ 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` IN ('.implode(array_map('intval', $eligibleProductsList), ',').')
AND cp.`id_product` <> '.(int)$this->gift_product);
$countMatchingProducts = 0;
$matchingProductsList = array();
foreach ($cartCategories as $cartCategory)
@@ -1096,29 +1082,30 @@ class CartRuleCore extends ObjectModel
'.($context->customer->id ? 'OR cr.id_customer = '.(int)$context->cart->id_customer : '').'
)
AND (
cr.carrier_restriction = 0
cr.`carrier_restriction` = 0
'.($context->cart->id_carrier ? 'OR c.id_carrier = '.(int)$context->cart->id_carrier : '').'
)
AND (
cr.shop_restriction = 0
cr.`shop_restriction` = 0
'.((Shop::isFeatureActive() && $context->shop->id) ? 'OR crs.id_shop = '.(int)$context->shop->id : '').'
)
AND (
cr.group_restriction = 0
cr.`group_restriction` = 0
'.($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.')
WHERE cr.id_cart_rule = crg.id_cart_rule
AND cg.id_customer = '.(int)$context->customer->id.' LIMIT 1
SELECT cg.`id_group`
FROM `'._DB_PREFIX_.'customer_group` cg
INNER 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 (
cr.reduction_product <= 0
OR cr.reduction_product IN (
SELECT id_product
FROM '._DB_PREFIX_.'cart_product
WHERE id_cart = '.(int)$context->cart->id.'
cr.`reduction_product` <= 0
OR cr.`reduction_product` IN (
SELECT `id_product`
FROM `'._DB_PREFIX_.'cart_product`
WHERE `id_cart` = '.(int)$context->cart->id.'
)
)
AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.')

View File

@@ -109,7 +109,7 @@ class CategoryCore extends ObjectModel
// Lang fields
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 64),
'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 64),
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString'),
'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'),
'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128),
'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
@@ -510,7 +510,7 @@ class CategoryCore extends ObjectModel
die(Tools::displayError());
$groups = FrontController::getCurrentCustomerGroups();
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1');
$sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '='.(int)Group::getCurrent()->id);
$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,8 +684,7 @@ 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::isFeatureActive() && $is_more_than_one_root_category && Shop::getContext() != Shop::CONTEXT_SHOP)
if (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);
@@ -797,7 +796,7 @@ class CategoryCore extends ObjectModel
)).')';
$flag = Db::getInstance()->execute('
INSERT INTO `'._DB_PREFIX_.'category_product` (`id_product`, `id_category`, `position`)
INSERT IGNORE INTO `'._DB_PREFIX_.'category_product` (`id_product`, `id_category`, `position`)
VALUES '.implode(',', $row)
);
return $flag;
@@ -832,20 +831,15 @@ class CategoryCore extends ObjectModel
if (!Validate::isUnsignedId($id_category) || !Validate::isUnsignedId($id_lang))
return false;
if (isset(self::$_links[$id_category.'-'.$id_lang]))
return self::$_links[$id_category.'-'.$id_lang];
$result = Db::getInstance()->getRow('
if (!isset(self::$_links[$id_category.'-'.$id_lang]))
self::$_links[$id_category.'-'.$id_lang] = Db::getInstance()->getValue('
SELECT cl.`link_rewrite`
FROM `'._DB_PREFIX_.'category_lang` cl
WHERE `id_lang` = '.(int)$id_lang.'
'.Shop::addSqlRestrictionOnLang('cl').'
AND cl.`id_category` = '.(int)$id_category
);
self::$_links[$id_category.'-'.$id_lang] = $result['link_rewrite'];
return $result['link_rewrite'];
return self::$_links[$id_category.'-'.$id_lang];
}
public function getLink(Link $link = null)
@@ -1396,8 +1390,7 @@ class CategoryCore extends ObjectModel
SELECT DISTINCT c.*
FROM `'._DB_PREFIX_.'category` c
LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.')
WHERE `level_depth` = 1
');
WHERE `level_depth` = 1');
}
public function isRootCategoryForAShop()

View File

@@ -75,6 +75,16 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
*/
protected $total;
/**
* @var int Page number
*/
protected $page_number = 0;
/**
* @var int Size of a page
*/
protected $page_size = 0;
protected $fields = array();
protected $alias = array();
protected $alias_iterator = 0;
@@ -335,6 +345,11 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
}
}
// All limit clause
if ($this->page_size)
$this->query->limit($this->page_size, $this->page_number * $this->page_size);
// Shall we display query for debug ?
if ($display_query)
echo $this->query.'<br />';
@@ -660,6 +675,34 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
return $this->fields[$field];
}
/**
* Set the page number
*
* @param int $page_number
* @return Collection
*/
public function setPageNumber($page_number)
{
$page_number = (int)$page_number;
if ($page_number > 0)
$page_number--;
$this->page_number = $page_number;
return $this;
}
/**
* Set the nuber of item per page
*
* @param int $page_size
* @return Collection
*/
public function setPageSize($page_size)
{
$this->page_size = (int)$page_size;
return $this;
}
/**
* Generate uniq alias from association name
*

View File

@@ -103,6 +103,13 @@ class CombinationCore extends ObjectModel
// Removes the product from StockAvailable, for the current shop
StockAvailable::removeProductFromStockAvailable((int)$this->id_product, (int)$this->id);
if ($specific_prices = SpecificPrice::getByProductId((int)$this->id_product, (int)$this->id))
foreach ($specific_prices as $specific_price)
{
$price = new SpecificPrice((int)$specific_price['id_specific_price']);
$price->delete();
}
if (!$this->hasMultishopEntries() && !$this->deleteAssociations())
return false;
return true;
@@ -128,6 +135,7 @@ class CombinationCore extends ObjectModel
{
$result = Db::getInstance()->delete('product_attribute_combination', '`id_product_attribute` = '.(int)$this->id);
$result &= Db::getInstance()->delete('cart_product', '`id_product_attribute` = '.(int)$this->id);
$result &= Db::getInstance()->delete('product_attribute_image', '`id_product_attribute` = '.(int)$this->id);
return $result;
}

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';
return ' AND id_shop_group = '.(int)$id_shop_group.' AND (id_shop IS NULL OR id_shop = 0)';
else
return ' AND id_shop_group IS NULL AND id_shop IS NULL';
return ' AND (id_shop_group IS NULL OR id_shop_group = 0) AND (id_shop IS NULL OR id_shop = 0)';
}
/**

View File

@@ -49,7 +49,6 @@ class ConfigurationTestCore
'mysql_support' => false,
'config_dir' => 'config',
'cache_dir' => 'cache',
'sitemap' => 'sitemap.xml',
'log_dir' => 'log',
'img_dir' => 'img',
'mails_dir' => 'mails',

View File

@@ -82,8 +82,12 @@ class ConnectionCore extends ObjectModel
// The connection is created if it does not exist yet and we get the current page id
if (!isset($cookie->id_connections) || !strstr(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '', Tools::getHttpHost(false, false)))
$id_page = Connection::setNewConnection($cookie);
// If we do not track the pages, no need to get the page id
if (!Configuration::get('PS_STATSDATA_PAGESVIEWS') && !Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS'))
return array();
if (!isset($id_page) || !$id_page)
$id_page = Page::getCurrentId();
// If we do not track the page views by customer, the id_page is the only information needed
if (!Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS'))
return array('id_page' => $id_page);

View File

@@ -61,32 +61,37 @@ 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();
if (isset($_SERVER['HTTP_REFERER']) && Validate::isAbsoluteUrl($_SERVER['HTTP_REFERER']))
// There are a few more operations if there is a referrer
if (isset($_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;
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->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);
}
$source->id_connections = (int)$cookie->id_connections;
$source->request_uri = Tools::getHttpHost(false, false);
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 (isset($_SERVER['REQUEST_URI']))
$source->request_uri .= $_SERVER['REQUEST_URI'];
elseif (isset($_SERVER['REDIRECT_URL']))
$source->request_uri .= $_SERVER['REDIRECT_URL'];
if (!Validate::isUrl($source->request_uri))
$source->request_uri = '';
$source->request_uri = substr($source->request_uri, 0, ConnectionsSource::$uri_max_size);

View File

@@ -44,40 +44,40 @@ 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
*
* @param $name Cookie name before encrypting
* @param $path
*/
public function __construct($name, $path = '', $expire = null, $shared_urls = null)
public function __construct($name, $path = '', $expire = null, $shared_urls = null, $standalone = false)
{
$this->_content = array();
$this->_standalone = $standalone;
$this->_expire = is_null($expire) ? time() + 1728000 : (int)$expire;
$this->_name = md5(_PS_VERSION_.$name);
$this->_path = trim(Context::getContext()->shop->physical_uri.$path, '/\\').'/';
$this->_name = md5(($this->_standalone ? '' : _PS_VERSION_).$name);
$this->_path = trim(($this->_standalone ? '' : 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;
if (Configuration::get('PS_CIPHER_ALGORITHM'))
$this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
$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
$this->_cipherTool = new Blowfish($this->_key, $this->_iv);
$this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_);
$this->update();
}
@@ -270,7 +270,7 @@ class CookieCore
//printf("\$content = %s<br />", $content);
/* Get cookie checksum */
$checksum = crc32($this->_iv.substr($content, 0, strrpos($content, '¤') + 2));
$checksum = crc32($this->_salt.substr($content, 0, strrpos($content, '¤') + 2));
//printf("\$checksum = %s<br />", $checksum);
/* Unserialize cookie content */
@@ -297,8 +297,12 @@ 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 (!Language::getLanguage((int)$this->id_lang))
if (!$this->_standalone && !Language::getLanguage((int)$this->id_lang))
{
$this->id_lang = Configuration::get('PS_LANG_DEFAULT');
// set detect_language to force going through Tools::setCookieLanguage to figure out browser lang
$this->detect_language = true;
}
}
@@ -344,7 +348,7 @@ class CookieCore
$cookie .= $key.'|'.$value.'¤';
/* Add checksum to cookie */
$cookie .= 'checksum|'.crc32($this->_iv.$cookie);
$cookie .= 'checksum|'.crc32($this->_salt.$cookie);
$this->_modified = false;
/* Cookies are encrypted for evident security reasons */
return $this->_setcookie($cookie);

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