// 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
+70 -1
View File
@@ -7,6 +7,15 @@
.DS_Store .DS_Store
robots.txt robots.txt
sitemap.xml 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/*
!cache/smarty/cache/index.php !cache/smarty/cache/index.php
cache/smarty/compile/* cache/smarty/compile/*
@@ -16,6 +25,7 @@ cache/tcpdf/*
!cache/tcpdf/index.php !cache/tcpdf/index.php
config/xml/*.xml config/xml/*.xml
config/settings.inc.php config/settings.inc.php
config/settings.old.php
log/*.log log/*.log
img/* img/*
!img/index.php !img/index.php
@@ -27,6 +37,10 @@ tools/smarty*/compile/*.php
override/classes/*.php override/classes/*.php
themes/default/cache/*.js themes/default/cache/*.js
themes/default/cache/*.css 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/*.php
!modules/*/translations/index.php !modules/*/translations/index.php
mails/* mails/*
@@ -35,4 +49,59 @@ modules/*/mails/*
!modules/*/mails/en !modules/*/mails/en
translations/* translations/*
!translations/*.gzip !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
+2 -2
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) 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 [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 [3]: http://docs.prestashop.com/display/PS15/How+to+write+a+commit+message
+140 -80
View File
@@ -1,80 +1,140 @@
- (d)oekia - adonis karavokyros
- Alexander Otchenashev - aFolletete
- Benjamin PONGY - Agence CINS
- Burhan - aKorczak
- Caleydon Media - Alexander Otchenashev
- Damien Metzger - anat
- DamienMetzger - Andrew
- Damon Skelhorn - aNiassy
- Daniel - antoniofr
- David Gasperoni - AntonLejon
- DrySs - Arnaud Lemercier
- DrÿSs' - Axome
- François Gaillard - Benjamin PONGY
- Gabriel Schwardy - BigZ
- Gregory Roussac - bLeveque
- Ha!*!*y - bMancone
- Jonathan Danse - bumbu
- Krystian Podemski - Burhan
- Marco Cervellin - Cédric Mouleyre
- Michel Courtade - Caleydon Media
- Milow - cam.lafit
- Patanock - Captain FLAM
- Pierre - Captain-FLAM
- PrestaEdit - ccauw
- Raphaël Malié - ChristopheBoucaut
- Rémi Gaillard - cippest
- Samy Rabih - cmouleyre
- Sarah Lorenzini - Corentin Delcourt
- Shagshag - Cosmin Hutanu
- Vincent Augagneur - Damien Metzger
- Xavier POITAU - DamienMetzger
- aFolletete - Damon Skelhorn
- aKorczak - Daniel
- aNiassy - David Gasperoni
- adonis karavokyros - Davy Rolink
- anat - djfm
- bLeveque - dMetzger
- bMancone - (d)oekia
- bumbu - Dragan Skrbic
- cmouleyre - DrÿSs'
- dMetzger - dreammeup
- dSevere - DrySs
- djfm - dSevere
- fBrignoli - Edouard Gaulué
- fSerny - emily-d
- fram - Fabio Chelly
- gBrunier - fBrignoli
- gCharmes - fram
- gPoulain - François Gaillard
- gRoussac - fSerny
- hAitmansour - Gabriel Schwardy
- ivancasasempere - gBrunier
- jBreux - gCharmes
- jObregon - gPoulain
- jessylenne - Grégoire Bélorgey
- jmCollin - Gregory Roussac
- kpodemski - gRoussac
- lBrieu - Guillaume DELOINCE
- lCherifi - hAitmansour
- lLefevre - Ha!*!*y
- mBertholino - indesign47
- mDeflotte - inem0o
- mMarinetti - ivancasasempere
- marcinsz101 - Jérôme Nadaud
- montes - jBreux
- nPellicari - jeromenadaud
- nezenmoins - Jerome Nadaud
- oleacorner - jessylenne
- rGaillard - jmCollin
- rMalie - jObregon
- rMontagne - Jonathan Danse
- root - joseantgv
- sLorenzini - Kevin Granger
- sThiebaut - kpodemski
- tDidierjean - Krystian Podemski
- vAugagneur - lBrieu
- vChabot - lCherifi
- vKham - ldecoker
- vSchoener - 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
+1 -1
View File
@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php'); require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated(); 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');
+1 -1
View File
@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php'); require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated(); 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');
@@ -60,7 +60,7 @@
$tem[$k] = $v; $tem[$k] = $v;
} }
$tem['path'] = backslashToSlash($path); $tem['path'] = addslashes(backslashToSlash($path));
$tem['type'] = "file"; $tem['type'] = "file";
$tem['size'] = transformFileSize($tem['size']); $tem['size'] = transformFileSize($tem['size']);
$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); $tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
@@ -73,7 +73,7 @@
$info .= sprintf(", %s:'%s'", $k, $v); $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); $info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME);
@@ -99,9 +99,9 @@
{ {
$v = transformFileSize($v); $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 "}\n";
} }
echo "};</script>\n"; echo "};</script>\n";
+4 -4
View File
@@ -33,15 +33,15 @@
$this->fileInfo['atime'] = $this->fileStat[8]; $this->fileInfo['atime'] = $this->fileStat[8];
$this->fileInfo['ctime'] = $this->fileStat[10]; $this->fileInfo['ctime'] = $this->fileStat[10];
$this->fileInfo['mtime'] = $this->fileStat[9]; $this->fileInfo['mtime'] = $this->fileStat[9];
$this->fileInfo['path'] = $path; $this->fileInfo['path'] = addslashes($path);
$this->fileInfo['name'] = basename($path); $this->fileInfo['name'] = addslashes(basename($path));
$this->fileInfo['is_writable'] = $this->isWritable(); $this->fileInfo['is_writable'] = $this->isWritable();
$this->fileInfo['is_readable'] = $this->isReadable(); $this->fileInfo['is_readable'] = $this->isReadable();
}elseif(is_dir($this->filePath)) }elseif(is_dir($this->filePath))
{ {
$this->fileStat = @stat($path); $this->fileStat = @stat($path);
$this->fileInfo['name'] = basename($path); $this->fileInfo['name'] = addslashes(basename($path));
$this->fileInfo['path'] = $path; $this->fileInfo['path'] = addslashes($path);
$this->fileInfo['atime'] = $this->fileStat[8]; $this->fileInfo['atime'] = $this->fileStat[8];
$this->fileInfo['ctime'] = $this->fileStat[10]; $this->fileInfo['ctime'] = $this->fileStat[10];
$this->fileInfo['mtime'] = $this->fileStat[9]; $this->fileInfo['mtime'] = $this->fileStat[9];
+45 -2
View File
@@ -37,7 +37,6 @@ $height = Tools::getValue('height');
$id_employee = Tools::getValue('id_employee'); $id_employee = Tools::getValue('id_employee');
$id_lang = Tools::getValue('id_lang'); $id_lang = Tools::getValue('id_lang');
if (!isset($cookie->id_employee) || !$cookie->id_employee || $cookie->id_employee != $id_employee) if (!isset($cookie->id_employee) || !$cookie->id_employee || $cookie->id_employee != $id_employee)
die(Tools::displayError()); die(Tools::displayError());
@@ -47,6 +46,51 @@ if (!Validate::isModuleName($module))
if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php')) if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php'))
die(Tools::displayError()); 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); require_once($module_path);
$graph = new $module(); $graph = new $module();
@@ -57,4 +101,3 @@ if ($option)
$graph->create($render, $type, $width, $height, $layers); $graph->create($render, $type, $width, $height, $layers);
$graph->draw(); $graph->draw();
+4 -4
View File
@@ -30,14 +30,14 @@ echo ' </div>
<div id="footer"> <div id="footer">
<div style="float:left;margin-left:10px;padding-top:6px"> <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 /> <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>
<div style="float:right;height:40px;margin-right:10px;line-height:38px;vertical-align:middle">'; <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 '; 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> 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('Bug Tracker').'</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('Forum').'</a> | <a href="http://www.prestashop.com/forums/" target="_blank" class="footer_link">'.Translate::getAdminTranslation('Forum').'</a>
</div> </div>
</div> </div>
</div> </div>
+16 -9
View File
@@ -223,8 +223,16 @@ function checkPSVersion()
return $upgrader->checkPSVersion(); return $upgrader->checkPSVersion();
} }
/**
* Deprecated since > 1.5.4.1
* Use Translate::getAdminTranslation($string) instead
*
* @param string $string
*/
function translate($string) function translate($string)
{ {
Tools::displayAsDeprecated();
global $_LANGADM; global $_LANGADM;
if (!is_array($_LANGADM)) if (!is_array($_LANGADM))
return str_replace('"', '&quot;', $string); return str_replace('"', '&quot;', $string);
@@ -233,7 +241,6 @@ function translate($string)
return str_replace('"', '&quot;', stripslashes($str)); return str_replace('"', '&quot;', stripslashes($str));
} }
/** /**
* Returns a new Tab object * Returns a new Tab object
* *
@@ -461,7 +468,7 @@ function runAdminTab($tab, $ajaxMode = false)
echo '<div class="path_bar"> 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 id="help-button" class="floatr" style="display: none; font-family: Verdana; font-size: 10px; margin-right: 4px; margin-top: 4px;">
</div> </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>'; '.$bread.'</div>';
if (!$ajaxMode && Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL) 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) if (Shop::getContext() == Shop::CONTEXT_GROUP)
{ {
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID()); $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) 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>'; echo '</div>';
} }
if (Validate::isLoadedObject($adminObj)) if (Validate::isLoadedObject($adminObj))
@@ -546,8 +553,8 @@ function runAdminTab($tab, $ajaxMode = false)
// we can display the correct url // we can display the correct url
// die(Tools::jsonEncode(array(translate('Invalid security token'),$url))); // die(Tools::jsonEncode(array(Translate::getAdminTranslation('Invalid security token'),$url)));
die(Tools::jsonEncode(translate('Invalid security token'))); die(Tools::jsonEncode(Translate::getAdminTranslation('Invalid security token')));
} }
else else
{ {
@@ -559,17 +566,17 @@ function runAdminTab($tab, $ajaxMode = false)
if (false === strpos($url, '?token=') AND false === strpos($url, '&token=')) if (false === strpos($url, '?token=') AND false === strpos($url, '&token='))
$url .= '&token='.$adminObj->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"> 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"> <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"> <img src="../img/admin/error2.png" style="margin:-4px 5px 0 0;vertical-align:middle">
'.$message.' '.$message.'
</div>'; </div>';
echo '<a href="'.htmlentities($url).'" method="get" style="float:left;margin:10px"> 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>
<a href="index.php" method="get" style="float:left;margin:10px"> <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> </a>
</body></html>'; </body></html>';
die; die;
+1 -1
View File
@@ -25,5 +25,5 @@
*/ */
define('_PS_ADMIN_DIR_', getcwd()); 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(); Controller::getController('GetFileController')->run();
+47
View File
@@ -50,6 +50,53 @@ if (!Validate::isModuleName($module))
if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php')) if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php'))
die(Tools::displayError()); 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); require_once($module_path);
$grid = new $module(); $grid = new $module();
+35 -35
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="'._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="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" /> <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"> <script type="text/javascript">
var helpboxes = '.Configuration::get('PS_HELPBOX').'; var helpboxes = '.Configuration::get('PS_HELPBOX').';
var roundMode = '.Configuration::get('PS_PRICE_ROUND_MODE').'; var roundMode = '.Configuration::get('PS_PRICE_ROUND_MODE').';
@@ -78,7 +78,7 @@ echo '
html = ""; html = "";
nb_notifs = 0; nb_notifs = 0;
$.each(json.order, function(property, value) { $.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 != "") if (html != "")
@@ -99,7 +99,7 @@ echo '
html = ""; html = "";
nb_notifs = 0; nb_notifs = 0;
$.each(json.customer, function(property, value) { $.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 != "") if (html != "")
{ {
@@ -121,7 +121,7 @@ echo '
html = ""; html = "";
nb_notifs = 0; nb_notifs = 0;
$.each(json.customer_message, function(property, value) { $.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 != "") if (html != "")
@@ -149,14 +149,14 @@ echo '
if (Shop::isFeatureActive()) if (Shop::isFeatureActive())
{ {
if (Shop::getContext() == Shop::CONTEXT_ALL) 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) elseif (Shop::getContext() == Shop::CONTEXT_GROUP)
{ {
$shop_group = new ShopGroup((int)Shop::getContextShopGroupID()); $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 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>\');'; 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> 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"> <div id="orders_notif_wrapper" class="notifs_wrapper">
<h3>'.translate('Last orders').'</h3> <h3>'.Translate::getAdminTranslation('Last orders').'</h3>
<p class="no_notifs">'.translate('No new orders has been made on your shop').'</p> <p class="no_notifs">'.Translate::getAdminTranslation('No new orders has been made on your shop').'</p>
<ul id="list_orders_notif"></ul> <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>
</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> 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"> <div id="customers_notif_wrapper" class="notifs_wrapper">
<h3>'.translate('Last customers').'</h3> <h3>'.Translate::getAdminTranslation('Last customers').'</h3>
<p class="no_notifs">'.translate('No new customers registered on your shop').'</p> <p class="no_notifs">'.Translate::getAdminTranslation('No new customers registered on your shop').'</p>
<ul id="list_customers_notif"></ul> <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>
</div>'; </div>';
} }
@@ -224,26 +224,26 @@ 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> 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"> <div id="customer_messages_notif_wrapper" class="notifs_wrapper">
<h3>'.translate('Last messages').'</h3> <h3>'.Translate::getAdminTranslation('Last messages').'</h3>
<p class="no_notifs">'.translate('No new messages posted on your shop').'</p> <p class="no_notifs">'.Translate::getAdminTranslation('No new messages posted on your shop').'</p>
<ul id="list_customer_messages_notif"></ul> <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>
</div>'; </div>';
} }
echo '</div> echo '</div>
<div id="employee_box"> <div id="employee_box">
<div id="employee_infos"> <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> <div class="clear"></div>
<ul id="employee_links"> <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 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>'; </ul>';
if (defined(_PS_BASE_URL_)) 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> echo '</div>
</div> </div>
@@ -252,18 +252,18 @@ echo ' var html = "";
<form method="post" action="index.php?controller=AdminSearch&amp;token='.Tools::getAdminTokenLite('AdminSearch').'"> <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'))).'" /> <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"> <select name="bo_search_type" id="bo_search_type" class="chosen no-search">
<option value="0">'.translate('everywhere').'</option> <option value="0">'.Translate::getAdminTranslation('everywhere').'</option>
<option value="1" '.(Tools::getValue('bo_search_type') == 1 ? 'selected="selected"' : '').'>'.translate('catalog').'</option> <option value="1" '.(Tools::getValue('bo_search_type') == 1 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('catalog').'</option>
<optgroup label="'.translate('customers').':"> <optgroup label="'.Translate::getAdminTranslation('customers').':">
<option value="2" '.(Tools::getValue('bo_search_type') == 2 ? 'selected="selected"' : '').'>'.translate('by name').'</option> <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('by ip address').'</option> <option value="6" '.(Tools::getValue('bo_search_type') == 6 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('by ip address').'</option>
</optgroup> </optgroup>
<option value="3" '.(Tools::getValue('bo_search_type') == 3 ? 'selected="selected"' : '').'>'.translate('orders').'</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('invoices').'</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('carts').'</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('modules').'</option> <option value="7" '.(Tools::getValue('bo_search_type') == 7 ? 'selected="selected"' : '').'>'.Translate::getAdminTranslation('modules').'</option>
</select> </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> </form>
</div> </div>
<div id="header_quick"> <div id="header_quick">
@@ -277,7 +277,7 @@ echo ' var html = "";
} }
</script> </script>
<select onchange="quickSelect(this);" id="quick_select"> <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) foreach (QuickAccess::getQuickAccesses(Context::getContext()->language->id) AS $quick)
{ {
preg_match('/controller=(.+)(&.+)?$/', $quick['link'], $adminTab); preg_match('/controller=(.+)(&.+)?$/', $quick['link'], $adminTab);
@@ -342,8 +342,8 @@ echo '
<div id="main"> <div id="main">
<div id="content">' <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;">' .(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::getAdminTranslation('For security reasons, you must also:').' '.
translate('delete the /install folder'). Translate::getAdminTranslation('delete the /install folder').
'</div>' : '').' '</div>' : '').'
'; ';
if(defined('_PS_MODE_DEV_') && _PS_MODE_DEV_) if(defined('_PS_MODE_DEV_') && _PS_MODE_DEV_)
@@ -352,7 +352,7 @@ echo '
if (Shop::isFeatureActive() && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL) if (Shop::isFeatureActive() && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL)
{ {
echo '<div class="multishop_toolbar"> 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(); Helper::renderShopList();
echo '</div>'; echo '</div>';
} }
+10 -5
View File
@@ -25,12 +25,15 @@ select[disabled="disabled"], input[disabled="disabled"],textarea[disabled="disab
.double_select select{width:300px;height:160px;} .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} .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*/
.button{ .button{
background: #e3e3e3 url('../img/bg-button-degrade.png') repeat-x scroll left top; 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: -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; 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[disabled=disabled]{color:#8C8C8C}
.button.bt-icon { display:inline-block; margin-bottom:7px;} .button.bt-icon { display:inline-block; margin-bottom:7px;}
.button.bt-icon span {padding-left:5px;} .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{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{ 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 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*/
.separation { background-color:#ccc;border-bottom:1px solid #fff; width:100%; height:1px; margin:10px 0;} .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; margin:0;
white-space: nowrap; white-space: nowrap;
overflow: auto; overflow: auto;
height: 335px; height: 370px;
} }
#modules_list_container_tab #modules_list_container_content li{display:inline-block;} #modules_list_container_tab #modules_list_container_content li{display:inline-block;}
#modules_list_container_tab table tr th { height:40px;} #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 dd { padding-right:10px;}
#modules_list_container_tab .moduleDesc .metadata dl dt { font-weight:bold; padding-right:5px;} #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 .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 .row-actions-module {float: right;}
#modules_list_container_tab .setup.non-install { background-color:#ec7000;} #modules_list_container_tab .setup.non-install { background-color:#ec7000;}
#modules_list_container_tab .setup.must-have { 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; } #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 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} .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:140px} #modules_list_container_tab ul li {height:105px}
/******** ie7 ******/ /******** ie7 ******/
.ie7 #modules_list_container_tab #modules_list_container_content li{zoom:1;display:inline;} .ie7 #modules_list_container_tab #modules_list_container_content li{zoom:1;display:inline;}
@@ -49,10 +49,12 @@
if (perm == 'all' && $(this).parent().parent().hasClass('parent')) if (perm == 'all' && $(this).parent().parent().hasClass('parent'))
{ {
checked = enabled ? 'checked': ''; if (enabled)
$(this).parent().parent().parent().find('.child-'+id_tab+' input[type=checkbox]').attr('checked', checked); $(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({ $.ajax({
url: "{$link->getAdminLink('AdminAccess')}", url: "{$link->getAdminLink('AdminAccess')|addslashes}",
cache: false, cache: false,
data : { data : {
ajaxMode : '1', ajaxMode : '1',
@@ -68,15 +70,12 @@
}, },
success : function(res,textStatus,jqXHR) success : function(res,textStatus,jqXHR)
{ {
try try {
{
if (res == 'ok') if (res == 'ok')
showSuccessMessage("{l s='Update successful'}"); showSuccessMessage("{l s='Update successful'}");
else else
showErrorMessage("{l s='Update error'}"); showErrorMessage("{l s='Update error'}");
} } catch(e) {
catch(e)
{
jAlert('Technical error'); jAlert('Technical error');
} }
} }
@@ -85,7 +84,7 @@
perfect_access_js_gestion(this, perm, id_tab, tabsize, tabnumber, table); perfect_access_js_gestion(this, perm, id_tab, tabsize, tabnumber, table);
$.ajax({ $.ajax({
url: "{$link->getAdminLink('AdminAccess')}", url: "{$link->getAdminLink('AdminAccess')|addslashes}",
cache: false, cache: false,
data : { data : {
ajaxMode : '1', ajaxMode : '1',
@@ -134,7 +133,7 @@
}); });
$.ajax({ $.ajax({
url: "{$link->getAdminLink('AdminAccess')}", url: "{$link->getAdminLink('AdminAccess')|addslashes}",
cache: false, cache: false,
data : { data : {
ajaxMode: '1', ajaxMode: '1',
@@ -303,7 +302,7 @@
{assign var=is_child value=true} {assign var=is_child value=true}
{assign var=result_accesses value=0} {assign var=result_accesses value=0}
<tr class="child-{$child.id_parent}"> <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} {foreach $perms as $perm}
{if $access_edit == 1} {if $access_edit == 1}
<td> <td>
@@ -27,13 +27,7 @@
{block name="label"} {block name="label"}
{if $input.name == 'vat_number'} {if $input.name == 'vat_number'}
{if $vat == 'is_applicable'} <div id="vat_area" style="display: visible">
<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}
{if $input.type == 'text_customer' && !isset($customer)} {if $input.type == 'text_customer' && !isset($customer)}
@@ -29,6 +29,9 @@
{if $input.type == 'color'} {if $input.type == 'color'}
<div id="colorAttributeProperties" style="display:{if $colorAttributeProperties}block{else}none{/if};"> <div id="colorAttributeProperties" style="display:{if $colorAttributeProperties}block{else}none{/if};">
{/if} {/if}
{if $input.type == 'closediv'}
</div>
{/if}
{$smarty.block.parent} {$smarty.block.parent}
{/block} {/block}
@@ -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}
@@ -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>
@@ -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;
@@ -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;
@@ -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;
@@ -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}
@@ -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>
@@ -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>
@@ -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}
@@ -34,7 +34,7 @@
{if $shared_category} {if $shared_category}
<p class="warn">{l s='If you delete this picture, it will be deleted in all of your shared shops!'}</p> <p class="warn">{l s='If you delete this picture, it will be deleted in all of your shared shops!'}</p>
{/if} {/if}
<br> <br />
<a href="{$current}&{$identifier}={$form_id}&token={$token}&{if $shared_category}forcedeleteImage=1{else}deleteImage=1{/if}"> <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'} <img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
</a> </a>
@@ -71,4 +71,4 @@
<span>{$input.customer}</span><br /> <span>{$input.customer}</span><br />
</p> </p>
{/if} {/if}
{/block} {/block}
@@ -33,7 +33,7 @@
&nbsp;<img src="../img/admin/home.gif" alt="" /> &nbsp;<img src="../img/admin/home.gif" alt="" />
{assign var=params_url value=""} {assign var=params_url value=""}
{else} {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}
{if $category.id_category == $categories_tree_current_id} {if $category.id_category == $categories_tree_current_id}
{$category.name} {$category.name}
@@ -43,7 +43,7 @@
{/foreach} {/foreach}
</div> </div>
{if isset($delete_category) && $delete_category} {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"> <div class="warn">
<h2> <h2>
{if $need_delete_mode} {if $need_delete_mode}
@@ -74,10 +74,10 @@
{if $key != 'deleteMode'} {if $key != 'deleteMode'}
{if is_array($value)} {if is_array($value)}
{foreach $value as $val} {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} {/foreach}
{else} {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}
{/if} {/if}
{/foreach} {/foreach}
@@ -48,6 +48,21 @@
</div> </div>
{else} {else}
{$smarty.block.parent} {$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} {/if}
{/block} {/block}
@@ -85,7 +100,11 @@
$('#need_zip_code_on, #need_zip_code_off').change(function() { $('#need_zip_code_on, #need_zip_code_off').change(function() {
disableZipFormat(); disableZipFormat();
}); });
$('#iso_code').change(function() {
disableTAASC();
});
disableTAASC();
}); });
function switchExplanationText(text) { function switchExplanationText(text) {
@@ -35,7 +35,7 @@
{/block} {/block}
{block name=leadin} {block name=leadin}
{if isset($delete_customer) && $delete_customer} {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"> <div class="warn">
<h2>{l s='How do you want to delete these customer(s)?'}</h2> <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> <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} {foreach $POST as $key => $value}
{if is_array($value)} {if is_array($value)}
{foreach $value as $val} {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} {/foreach}
{else} {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} {/foreach}
<br /><input type="submit" class="button" value="{l s='Delete'}" /> <br /><input type="submit" class="button" value="{l s='Delete'}" />
@@ -149,7 +149,7 @@
</div> </div>
<div style="width:50%;float:left;"> <div style="width:50%;float:left;">
<div style="margin-left:15px;" <div style="margin-left:15px;">
<h2>{l s='Vouchers'} ({count($discounts)})</h2> <h2>{l s='Vouchers'} ({count($discounts)})</h2>
{if count($discounts)} {if count($discounts)}
<table cellspacing="0" cellpadding="0" class="table"> <table cellspacing="0" cellpadding="0" class="table">
@@ -488,4 +488,4 @@
</div> </div>
{/block} {/block}
</div> </div>
<div class="clear">&nbsp;</div> <div class="clear">&nbsp;</div>
@@ -60,7 +60,7 @@
ifSuperAdmin($(this)); ifSuperAdmin($(this));
$.ajax({ $.ajax({
url: "{$link->getAdminLink('AdminEmployees')}", url: "{$link->getAdminLink('AdminEmployees')|addslashes}",
cache: false, cache: false,
data : { data : {
ajax : '1', ajax : '1',
@@ -106,63 +106,61 @@
if ($(this).attr('name') == 'category_reduction['+$('[name="id_category"]:checked').val()+']') if ($(this).attr('name') == 'category_reduction['+$('[name="id_category"]:checked').val()+']')
{ {
exist = true; 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; return false;
} }
}); });
if (exist) if (exist)
return; return;
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "ajax-tab.php", url: "ajax-tab.php",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
ajax: "1", ajax: "1",
token: "{getAdminToken tab='AdminGroups'}", token: "{getAdminToken tab='AdminGroups'}",
controller: "AdminGroups", controller: "AdminGroups",
action: "addCategoryReduction", action: "addCategoryReduction",
category_reduction: $('#category_reduction_fancybox').val() , category_reduction: $('#category_reduction_fancybox').val() ,
id_category: $('[name="id_category"]:checked').val() id_category: $('[name="id_category"]:checked').val()
}, },
success : function(jsonData) success : function(jsonData) {
if (jsonData.hasError)
{ {
if (jsonData.hasError) var errors = '';
{ for (error in jsonData.errors)
var errors = ''; //IE6 bug fix
for(error in jsonData.errors) if (error != 'indexOf')
//IE6 bug fix errors += $('<div />').html(jsonData.errors[error]).text() + "\n";
if(error != 'indexOf') jAlert(errors);
errors += jsonData.errors[error] + "\n";
jAlert(errors);
}
else
{
$('#group_discount_category_table').append('<tr class="alt_row" id="'+jsonData.id_category+'"><td>'+jsonData.catPath+'</td><td>{l s='Discount:'}'+jsonData.discount+'{l s='%'}</td><td><a href="#" onclick="deleteCategoryReduction('+jsonData.id_category+');"><img src="../img/admin/delete.gif"></a></td></tr>');
var input_hidden = document.createElement("input");
input_hidden.setAttribute('type', 'hidden');
input_hidden.setAttribute('value', jsonData.discount);
input_hidden.setAttribute('name', 'category_reduction['+jsonData.id_category+']');
input_hidden.setAttribute('class', 'category_reduction');
$('#group_discount_category_table tr#'+jsonData.id_category+' > td:last').append(input_hidden);
$.fancybox.close();
}
} }
}); else
{
$('#group_discount_category_table').append('<tr class="alt_row" id="'+jsonData.id_category+'"><td>'+jsonData.catPath+'</td><td>{l s='Discount:'}'+jsonData.discount+'{l s='%'}</td><td><a href="#" onclick="deleteCategoryReduction('+jsonData.id_category+');"><img src="../img/admin/delete.gif"></a></td></tr>');
var input_hidden = document.createElement("input");
input_hidden.setAttribute('type', 'hidden');
input_hidden.setAttribute('value', jsonData.discount);
input_hidden.setAttribute('name', 'category_reduction['+jsonData.id_category+']');
input_hidden.setAttribute('class', 'category_reduction');
$('#group_discount_category_table tr#'+jsonData.id_category+' > td:last').append(input_hidden);
$.fancybox.close();
}
}
});
return false; return false;
} }
function initFancyBox() function initFancyBox()
{ {
$('[name="id_category"]:checked').removeAttr('checked'); $('[name="id_category"]:checked').removeAttr('checked');
collapseAllCategories(); collapseAllCategories();
$('#category_reduction_fancybox').val('0.00'); $('#category_reduction_fancybox').val('0.00');
} }
</script> </script>
<div class="margin-form"> <div class="margin-form">
<a class="button" href="#group_discount_category_fancybox" id="group_discount_category">{l s='Add a category discount'}</a> <a class="button" href="#group_discount_category_fancybox" id="group_discount_category">{l s='Add a category discount'}</a>
@@ -270,4 +268,4 @@
{else} {else}
{$smarty.block.parent} {$smarty.block.parent}
{/if} {/if}
{/block} {/block}
@@ -223,7 +223,7 @@ $(document).ready(function() {
$.fancybox( $.fancybox(
this.href, this.href,
{ {
'width' : 660, 'width' : 920,
'height' : 384, 'height' : 384,
'transitionIn' : 'none', 'transitionIn' : 'none',
'transitionOut' : 'none', 'transitionOut' : 'none',
@@ -50,14 +50,14 @@
console.log(truncateAuthorized); console.log(truncateAuthorized);
if (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(); e.preventDefault();
} }
} }
else 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; return false;
} }
} }
@@ -58,7 +58,7 @@
</div> </div>
<form action="{$current}&token={$token}" method="post" id="import_form" name="import_form"> <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="csv" value="{$fields_value.csv}" />
<input type="hidden" name="convert" value="{$fields_value.convert}" /> <input type="hidden" name="convert" value="{$fields_value.convert}" />
<input type="hidden" name="entity" value="{$fields_value.entity}" /> <input type="hidden" name="entity" value="{$fields_value.entity}" />
@@ -32,7 +32,7 @@
{ {
$.ajax({ $.ajax({
type: 'GET', type: 'GET',
url: '{$link->getAdminLink('AdminInformation')}', url: '{$link->getAdminLink('AdminInformation')|addslashes}',
data: { data: {
'action': 'checkFiles', 'action': 'checkFiles',
'ajax': 1 'ajax': 1
@@ -49,14 +49,14 @@
<form action="#" id="login_form" method="post"> <form action="#" id="login_form" method="post">
<div class="field"> <div class="field">
<label for="email">{l s='Email address:'}</label> <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>
<div class="field"> <div class="field">
<label for="passwd">{l s='Password:'}</label> <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>
<div class="field"> <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"> <p class="fl no-margin hide ajax-loader">
<img src="../img/loader.gif" alt="" /> <img src="../img/loader.gif" alt="" />
</p> </p>
@@ -77,7 +77,7 @@
</dl> </dl>
</div> </div>
<p class="desc">{if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else}&nbsp;{/if}</p> <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"> <div class="row-actions-module">
{if !isset($module->not_on_disk)} {if !isset($module->not_on_disk)}
{$module->optionsHtml} {$module->optionsHtml}
@@ -58,7 +58,7 @@
</li> </li>
{foreach from=$list_modules_categories item=module_category key=module_category_key} {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"> <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> <div class="count">{$module_category.nb}</div>
</li> </li>
{/foreach} {/foreach}
@@ -31,10 +31,10 @@
<td valign="top" width="32" align="center"> <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}"> <img class="imgm" alt="" src="{if isset($module->image)}{$module->image}{else}../modules/{$module->name}/{$module->logo}{/if}">
</td> </td>
<td height="60" valign="top"> <td valign="top">
<div class="moduleDesc" id="anchor{$module->name|ucfirst}"> <div class="moduleDesc" id="anchor{$module->name|ucfirst}">
<h3> <h3>
{$module->displayName|truncate:40:'…'} {$module->version} {$module->displayName|truncate:36:'…'} {$module->version}
{if isset($module->id) && $module->id gt 0 } {if isset($module->id) && $module->id gt 0 }
{if $module->active} {if $module->active}
<span class="setup">{l s='Enabled'}</span> <span class="setup">{l s='Enabled'}</span>
@@ -52,7 +52,7 @@
</h3> </h3>
<p class="desc"> <p class="desc">
{if isset($module->description) && $module->description ne ''} {if isset($module->description) && $module->description ne ''}
{$module->description|truncate:100:'…'} {$module->description|truncate:86:'…'}
{else} {else}
&nbsp; &nbsp;
{/if} {/if}
@@ -26,7 +26,7 @@
{include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title}
<div class="leadin">{block name="leadin"}{/block}</div> <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} {if $display_key}
<input type="hidden" name="show_modules" value="{$display_key}" /> <input type="hidden" name="show_modules" value="{$display_key}" />
{/if} {/if}
@@ -49,38 +49,10 @@
</select><sup> *</sup> </select><sup> *</sup>
</div> </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> <label>{l s='Exceptions'} :</label>
<div class="margin-form"> <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} {if !$except_diff}
{$exception_list} {$exception_list}
{else} {else}
@@ -88,9 +60,6 @@
{$value} {$value}
{/foreach} {/foreach}
{/if} {/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>
<div class="margin-form"> <div class="margin-form">
@@ -102,4 +71,40 @@
</div> </div>
<div class="small"><sup>*</sup> {l s='Required field'}</div> <div class="small"><sup>*</sup> {l s='Required field'}</div>
</fieldset> </fieldset>
</form> </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>
@@ -22,7 +22,9 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA * 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> <h1>{l s='The controller %s is missing or invalid.' sprintf=$controller}</h1>
{/if}
<ul> <ul>
<li><a href="index.php">{l s='Go to the dashboard.'}</a></li> <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> <li><a href="#" onclick="window.history.back();">{l s='Back to the previous page.'}</a></li>
@@ -45,6 +45,7 @@
{/if} {/if}
</td> </td>
<td align="center" class="productQuantity">{$product['customizationQuantityTotal']}</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->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 ($order->hasBeenDelivered() || $order->hasProductReturned())}<td align="center" class="productQuantity">{$product['customizationQuantityReturned']}</td>{/if}
{if $stock_management}<td align="center" class=""> - </td>{/if} {if $stock_management}<td align="center" class=""> - </td>{/if}
@@ -103,6 +104,7 @@
</span> </span>
{/if} {/if}
</td> </td>
{if $display_warehouse}<td style="" align="center">&nbsp;</td>{/if}
{if ($order->hasBeenPaid())}<td align="center">{$customization['quantity_refunded']}</td>{/if} {if ($order->hasBeenPaid())}<td align="center">{$customization['quantity_refunded']}</td>{/if}
{if ($order->hasBeenDelivered())}<td align="center">{$customization['quantity_returned']}</td>{/if} {if ($order->hasBeenDelivered())}<td align="center">{$customization['quantity_returned']}</td>{/if}
<td align="center"> <td align="center">
@@ -68,9 +68,9 @@
{/if} {/if}
{if get_class($document) eq 'OrderInvoice'} {if get_class($document) eq 'OrderInvoice'}
{if isset($document->is_delivery)} {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} {else}
{$document->getInvoiceNumberFormatted($current_id_lang)} {$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
{/if} {/if}
{elseif get_class($document) eq 'OrderSlip'} {elseif get_class($document) eq 'OrderSlip'}
#{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id} #{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id}
@@ -110,7 +110,7 @@
{if !isset($document->is_delivery)} {if !isset($document->is_delivery)}
<tr id="invoiceNote{$document->id}" style="display:none" class="current-edit"> <tr id="invoiceNote{$document->id}" style="display:none" class="current-edit">
<td colspan="5"> <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> <p>
<label for="editNote{$document->id}" class="t">{l s='Note'}</label> <label for="editNote{$document->id}" class="t">{l s='Note'}</label>
<input type="hidden" name="id_order_invoice" value="{$document->id}" /> <input type="hidden" name="id_order_invoice" value="{$document->id}" />
@@ -130,7 +130,7 @@
<td colspan="5" class="center"> <td colspan="5" class="center">
<h3>{l s='No documents are available'}</h3> <h3>{l s='No documents are available'}</h3>
{if isset($invoice_management_active) && $invoice_management_active} {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} {/if}
</td> </td>
</tr> </tr>
@@ -40,6 +40,7 @@
</td> </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> <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 ($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} {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" 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> <td style="display:none;" align="center" id="add_product_product_total">{displayPrice price=0 currency=$currency->id}</td>
@@ -56,6 +56,7 @@
</span> </span>
{/if} {/if}
</td> </td>
{if $display_warehouse}<td>{$product.warehouse_name|escape:'htmlall':'UTF-8'}</td>{/if}
{if ($order->hasBeenPaid())} {if ($order->hasBeenPaid())}
<td align="center" class="productQuantity"> <td align="center" class="productQuantity">
{$product['product_quantity_refunded']} {$product['product_quantity_refunded']}
@@ -24,11 +24,11 @@
*} *}
<table class="table" width="100%" cellspacing="0" cellpadding="0" id="shipping_table"> <table class="table" width="100%" cellspacing="0" cellpadding="0" id="shipping_table">
<colgroup> <colgroup>
<col width="15%"> <col width="15%"/>
<col width="15%"> <col width="15%"/>
<col width=""> <col width=""/>
<col width="10%"> <col width="10%"/>
<col width="20%"> <col width="20%"/>
</colgroup> </colgroup>
<thead> <thead>
<tr> <tr>
@@ -46,7 +46,7 @@
<td>{dateFormat date=$line.date_add full=true}</td> <td>{dateFormat date=$line.date_add full=true}</td>
<td>{$line.type}</td> <td>{$line.type}</td>
<td>{$line.carrier_name}</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> <td>
{if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC} {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_INC}
{displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id} {displayPrice price=$line.shipping_cost_tax_incl currency=$currency->id}
@@ -55,7 +55,7 @@
{/if} {/if}
</td> </td>
<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} {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'}"> <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;"> <span class="shipping_number_edit" style="display:none;">
@@ -28,13 +28,13 @@
var changed_shipping_price = false; var changed_shipping_price = false;
var shipping_price_selected_carrier = ''; var shipping_price_selected_carrier = '';
var current_index = '{$current}&token={$token}'; 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 cart_quantity = new Array();
var currencies = new Array(); var currencies = new Array();
var id_currency = ''; var id_currency = '';
var id_lang = ''; var id_lang = '';
var txt_show_carts = '{l s='Show 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.'}'; var txt_hide_carts = '{l s='Hide carts and orders for this customer.' js=1}';
var defaults_order_state = new Array(); var defaults_order_state = new Array();
var customization_errors = false; var customization_errors = false;
var pic_dir = '{$pic_dir}'; var pic_dir = '{$pic_dir}';
@@ -100,7 +100,7 @@
$('#show_old_carts').click(); $('#show_old_carts').click();
$('#payment_module_name').change(); $('#payment_module_name').change();
$.ajaxSetup({ type:"post" }); $.ajaxSetup({ type:"post" });
$("#voucher").autocomplete('{$link->getAdminLink('AdminCartRules')}', { $("#voucher").autocomplete('{$link->getAdminLink('AdminCartRules')|addslashes}', {
minChars: 3, minChars: 3,
max: 15, max: 15,
width: 250, width: 250,
@@ -157,7 +157,7 @@
free_shipping = 1; free_shipping = 1;
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -217,7 +217,7 @@
e.preventDefault(); e.preventDefault();
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -254,7 +254,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -288,7 +288,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -324,7 +324,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -351,7 +351,7 @@
$('#id_cart').val(id_cart); $('#id_cart').val(id_cart);
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: false, async: false,
dataType: "json", dataType: "json",
data : { data : {
@@ -378,7 +378,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -401,7 +401,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -426,7 +426,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url : "{$link->getAdminLink('AdminOrders')}", url : "{$link->getAdminLink('AdminOrders')|escape:'html'}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -468,7 +468,7 @@
$('#new_address').attr('href', address_link.replace(/id_customer=[0-9]+/, 'id_customer='+id_customer)); $('#new_address').attr('href', address_link.replace(/id_customer=[0-9]+/, 'id_customer='+id_customer));
$.ajax({ $.ajax({
type:"POST", type:"POST",
url : "{$link->getAdminLink('AdminCarts')}", url : "{$link->getAdminLink('AdminCarts')|addslashes}",
async: false, async: false,
dataType: "json", dataType: "json",
data : { data : {
@@ -534,7 +534,7 @@
$('#products_part').show(); $('#products_part').show();
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminOrders')}", url: "{$link->getAdminLink('AdminOrders')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -661,17 +661,17 @@
{ {
$.each(this.customized_datas[this.id_product][this.id_product_attribute][id_address_delivery], function() { $.each(this.customized_datas[this.id_product][this.id_product_attribute][id_address_delivery], function() {
var customized_desc = ''; var customized_desc = '';
if(this.datas[1].length) if (this.datas[1].length)
{ {
$.each(this.datas[1],function() { $.each(this.datas[1],function() {
customized_desc += this.name+':'+this.value+'<br />'; customized_desc += this.name + ': ' + this.value + '<br />';
id_customization = this.id_customization; 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() { $.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; id_customization = this.id_customization;
}); });
} }
@@ -766,7 +766,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -822,7 +822,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -845,7 +845,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -868,7 +868,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -899,7 +899,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminOrders')}", url: "{$link->getAdminLink('AdminOrders')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -957,7 +957,7 @@
{ {
$.ajax({ $.ajax({
type:"POST", type:"POST",
url: "{$link->getAdminLink('AdminCarts')}", url: "{$link->getAdminLink('AdminCarts')|addslashes}",
async: true, async: true,
dataType: "json", dataType: "json",
data : { data : {
@@ -27,7 +27,7 @@
{block name="override_tpl"} {block name="override_tpl"}
<script type="text/javascript"> <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_order = {$order->id};
var id_lang = {$current_id_lang}; var id_lang = {$current_id_lang};
var id_currency = {$order->id_currency}; var id_currency = {$order->id_currency};
@@ -59,7 +59,7 @@
{assign var="hook_invoice" value={hook h="displayInvoice" id_order=$order->id}} {assign var="hook_invoice" value={hook h="displayInvoice" id_order=$order->id}}
{if ($hook_invoice)} {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} {/if}
<div class="bloc-command"> <div class="bloc-command">
@@ -113,9 +113,7 @@
<form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post"> <form action="{$currentIndex}&vieworder&token={$smarty.get.token}" method="post">
<select id="id_order_state" name="id_order_state"> <select id="id_order_state" name="id_order_state">
{foreach from=$states item=state} {foreach from=$states item=state}
{if $state['id_order_state'] != $currentState->id} <option value="{$state['id_order_state']}"{if $state['id_order_state'] == $currentState->id} selected="selected" disabled="disabled"{/if}>{$state['name']|stripslashes}</option>
<option value="{$state['id_order_state']}">{$state['name']|stripslashes}</option>
{/if}
{/foreach} {/foreach}
</select> </select>
<input type="hidden" name="id_order" value="{$order->id}" /> <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='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='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 /> {l s='Total spent since registration:'} <b>{displayPrice price=Tools::ps_round(Tools::convertPrice($customerStats['total_orders'], $currency), 2) currency=$currency->id}</b><br />
</fieldset>
{/if} {/if}
{/if} {/if}
</fieldset>
<!-- Sources block --> <!-- Sources block -->
{if (sizeof($sources))} {if (sizeof($sources))}
@@ -266,8 +264,8 @@
{if (!$order->valid && sizeof($currencies) > 1)} {if (!$order->valid && sizeof($currencies) > 1)}
<form method="post" action="{$currentIndex}&vieworder&id_order={$order->id}&token={$smarty.get.token|escape:'htmlall':'UTF-8'}"> <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> <p class="warn">{l s='Do not forget to update your exchange rate before making this change.'}</p>
<label>{l s='Don\'t forget to update your conversion rate before making this change.'}</label> <label>{l s='Do not forget to update your exchange rate before making this change.'}</label>
<select name="new_currency"> <select name="new_currency">
{foreach from=$currencies item=currency_change} {foreach from=$currencies item=currency_change}
{if $currency_change['id_currency'] != $order->id_currency} {if $currency_change['id_currency'] != $order->id_currency}
@@ -327,7 +325,7 @@
<td>{displayPrice price=$payment->amount currency=$payment->id_currency}</td> <td>{displayPrice price=$payment->amount currency=$payment->id_currency}</td>
<td> <td>
{if $invoice = $payment->getOrderInvoice($order->id)} {if $invoice = $payment->getOrderInvoice($order->id)}
{$invoice->getInvoiceNumberFormatted($current_id_lang)} {$invoice->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)}
{else} {else}
{l s='No invoice'} {l s='No invoice'}
{/if} {/if}
@@ -406,7 +404,7 @@
<td> <td>
<select name="payment_invoice" id="payment_invoice"> <select name="payment_invoice" id="payment_invoice">
{foreach from=$invoices_collection item=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} {/foreach}
</select> </select>
</td> </td>
@@ -594,6 +592,7 @@
<th>{l s='Product'}</th> <th>{l s='Product'}</th>
<th style="width: 15%; text-align: center">{l s='Unit Price'} <sup>*</sup></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> <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->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 ($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} {if $stock_management}<th style="width: 10%; text-align: center">{l s='Available quantity'}</th>{/if}
@@ -25,15 +25,20 @@
{extends file="helpers/view/view.tpl"} {extends file="helpers/view/view.tpl"}
{block name="override_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> <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)} {if isset($modules_list)}
{$modules_list} {$modules_list}
{/if} {/if}
<div class="space info">
<br /> {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} {if $display_restrictions}
<br /><h2 class="space">{l s='Payment module restrictions'}</h2> <br /><h2 class="space">{l s='Payment module restrictions'}</h2>
{foreach $lists as $list} {foreach $lists as $list}
@@ -44,5 +49,5 @@
<br /> <br />
<div class='warn'>{l s='No payment module installed'}</div> <div class='warn'>{l s='No payment module installed'}</div>
{/if} {/if}
{/if} {/if}
{/block} {/block}
@@ -34,10 +34,10 @@
{if $module->active} {if $module->active}
<th> <th>
{if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'} {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;"> <a href="javascript:checkPaymentBoxes('{$list['name_id']}', '{$module->name}')" style="text-decoration:none;">
{/if} {/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'} {if $list['name_id'] != 'currency' || $module->currencies_mode == 'checkbox'}
</a> </a>
{/if} {/if}
@@ -64,11 +64,9 @@
{$type = 'checkbox'} {$type = 'checkbox'}
{/if} {/if}
{if $type != 'null'} {if $type != 'null'}
<input type="checkbox" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}" <input type="{$type}" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}" {if $item['check_list'][$key_module] == 'checked'}checked="checked"{/if}/>
{if $item['check_list'][$key_module] == 'checked'}checked="checked"{/if}
/>
{else} {else}
-- <input type="hidden" name="{$module->name}_{$list['name_id']}[]" value="{$item[$list['identifier']]}"/>--
{/if} {/if}
</td> </td>
{/if} {/if}
@@ -96,4 +94,4 @@
</table> </table>
<div><input type="submit" class="button space" name="submitModule{$list['name_id']}" value="{l s='Save restrictions'}" /></div> <div><input type="submit" class="button space" name="submitModule{$list['name_id']}" value="{l s='Save restrictions'}" /></div>
</fieldset> </fieldset>
</form> </form>
@@ -40,6 +40,9 @@
</div> </div>
{/if} {/if}
{$smarty.block.parent} {$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}
{block name="description"} {block name="description"}
@@ -186,7 +189,7 @@
return false; 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); $('#smarty_up').val(1);
}); });
@@ -78,7 +78,7 @@
<tr id="image_id"> <tr id="image_id">
<td style="padding: 4px;"> <td style="padding: 4px;">
<a href="{$smarty.const._THEME_PROD_DIR_}image_path.jpg" class="fancybox"> <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> </a>
</td> </td>
<td id="td_image_id" class="pointer dragHandle center positionImage"> <td id="td_image_id" class="pointer dragHandle center positionImage">
@@ -313,12 +313,13 @@
{ {
line = $("#lineType").html(); line = $("#lineType").html();
line = line.replace(/image_id/g, id); 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_path/g, path);
line = line.replace(/image_position/g, position); line = line.replace(/image_position/g, position);
line = line.replace(/blank/g, cover); line = line.replace(/blank/g, cover);
line = line.replace(/<tbody>/gi, ""); line = line.replace(/<tbody>/gi, "");
line = line.replace(/<\/tbody>/gi, ""); line = line.replace(/<\/tbody>/gi, "");
if (shops != false) if (shops != false)
{ {
$.each(shops, function(key, value){ $.each(shops, function(key, value){
@@ -326,8 +327,10 @@
line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked'); line = line.replace('id="' + key + '' + id + '"','id="' + key + '' + id + '" checked=checked');
}); });
} }
$("#imageList").append(line); $("#imageList").append(line);
} }
$('.fancybox').fancybox(); $('.fancybox').fancybox();
}); });
{/literal} {/literal}
@@ -43,7 +43,7 @@
$('document').ready( function() { $('document').ready( function() {
$(".check_product_name") $(".check_product_name")
.autocomplete( .autocomplete(
'{$link->getAdminLink('AdminProducts', true)}', { '{$link->getAdminLink('AdminProducts', true)|addslashes}', {
minChars: 3, minChars: 3,
max: 10, max: 10,
width: $(".check_product_name").width(), width: $(".check_product_name").width(),
@@ -24,8 +24,8 @@
*} *}
<script type="text/javascript"> <script type="text/javascript">
var msg_select_one = "{l s="Please select at least one 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}"; var msg_set_quantity = "{l s='Please set a quantity to add a product.' js=1}";
</script> </script>
<input type="hidden" name="submitted_tabs[]" value="Pack" /> <input type="hidden" name="submitted_tabs[]" value="Pack" />
<h4>{l s='Pack'}</h4> <h4>{l s='Pack'}</h4>
@@ -25,7 +25,7 @@
<script type="text/javascript"> <script type="text/javascript">
var Customer = new Object(); 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}); var ecotax_tax_excl = parseFloat({$ecotax_tax_excl});
$(document).ready(function () { $(document).ready(function () {
Customer = { Customer = {
@@ -56,7 +56,7 @@ $(document).ready(function () {
Customer.showLoader(); Customer.showLoader();
jQuery.ajax({ jQuery.ajax({
"type": "POST", "type": "POST",
"url": "{$link->getAdminLink('AdminCustomers')}", "url": "{$link->getAdminLink('AdminCustomers')|addslashes}",
"async": true, "async": true,
"dataType": "json", "dataType": "json",
"data": { "data": {
@@ -71,7 +71,7 @@
<label>{l s='Carriers:'}</label> <label>{l s='Carriers:'}</label>
</td> </td>
<td class="padding-bottom:5px;"> <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} {foreach $carrier_list as $carrier}
<option value="{$carrier.id_reference}" {if isset($carrier.selected) && $carrier.selected}selected="selected"{/if}>{$carrier.name}</option> <option value="{$carrier.id_reference}" {if isset($carrier.selected) && $carrier.selected}selected="selected"{/if}>{$carrier.name}</option>
{/foreach} {/foreach}
@@ -88,4 +88,4 @@
$('#carriers_restriction option').each(function () { $(this).removeAttr('selected')}); $('#carriers_restriction option').each(function () { $(this).removeAttr('selected')});
return false; return false;
} }
</script> </script>
@@ -159,7 +159,10 @@
<input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$up_filename}" /> <input type="hidden" id="virtual_product_filename" name="virtual_product_filename" value="{$up_filename}" />
{/if} {/if}
<div class="conf"> <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'}"/> <img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
</a> </a>
</div> </div>
@@ -173,7 +176,7 @@
</td> </td>
<td class="col-right"> <td class="col-right">
{$product->productDownload->getHtmlLink(false, true)} {$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'}"/> <img src="../img/admin/delete.gif" alt="{l s='Delete this file'}"/>
</a> </a>
</td> </td>
@@ -90,7 +90,7 @@
var table = $('#selectTables select').val(); var table = $('#selectTables select').val();
if (!table) if (!table)
jAlert("{l s='Please choose a table.'}"); jAlert("{l s='Please choose a table.' js=1}");
else else
AddRequestSql(table); AddRequestSql(table);
}); });
@@ -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>
@@ -24,9 +24,9 @@
*} *}
<a href="{$href}" class="delete" <a href="{$href}" class="delete"
{if in_array($id_shop, $shops_having_dependencies)} {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)} {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}"> {/if} title="{$action}">
<img src="../img/admin/delete.gif" alt="{$action}" /> <img src="../img/admin/delete.gif" alt="{$action}" />
</a> </a>
@@ -186,7 +186,7 @@ $("#multishop-tree").jstree({
'plugins': ["themes","json_data","cookies","contextmenu"], 'plugins': ["themes","json_data","cookies","contextmenu"],
'json_data': { 'json_data': {
'ajax': { 'ajax': {
'url': "{$link->getAdminLink('AdminShop')}", 'url': "{$link->getAdminLink('AdminShop')|addslashes}",
'data': function(n) 'data': function(n)
{ {
return { return {
@@ -161,6 +161,13 @@ function add_condition(id_condition_group, type, value)
function delete_condition(condition) function delete_condition(condition)
{ {
delete conditions[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(); $('#'+condition).remove();
return false; return false;
} }
@@ -178,7 +185,7 @@ function new_condition_group()
function appendConditionToGroup(html) function appendConditionToGroup(html)
{ {
if ($('#condition_group_'+current_id_condition_group+' table tbody tr').length > 0) 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); $('#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_group option[value="{$condition.id_attribute_group}"]').attr('selected', true);
$('#id_attribute_{$condition.id_attribute_group} option[value="{$condition.value}"]').attr('selected', true); $('#id_attribute_{$condition.id_attribute_group} option[value="{$condition.value}"]').attr('selected', true);
{elseif $condition.type == 'feature'} {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); $('#id_feature_{$condition.id_feature} option[value="{$condition.value}"]').attr('selected', true);
{else} {else}
$('#id_{$condition.type} option[value="{$condition.value}"]').attr('selected', true); $('#id_{$condition.type} option[value="{$condition.value}"]').attr('selected', true);
@@ -25,7 +25,7 @@
<div id="statsContainer"> <div id="statsContainer">
<div id="calendar"> <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="submitDateDay" class="button submitDateDay" value="{$translations.Day}">
<input type="submit" name="submitDateMonth" class="button submitDateMonth" value="{$translations.Month}"> <input type="submit" name="submitDateMonth" class="button submitDateMonth" value="{$translations.Month}">
<input type="submit" name="submitDateYear" class="button submitDateYear" value="{$translations.Year}"> <input type="submit" name="submitDateYear" class="button submitDateYear" value="{$translations.Year}">
@@ -51,4 +51,4 @@
}); });
}); });
</script> </script>
</div> </div>
@@ -30,55 +30,44 @@
<h2>{$supplier->name}</h2> <h2>{$supplier->name}</h2>
<h3>{l s='Number of products:'} {count($products)}</h3> <h3>{l s='Number of products:'} {count($products)}</h3>
<table border="0" cellpadding="0" cellspacing="0" class="table" width="100%">
<tr>
<th>{l s='Product name'}</th>
<th>{l s='Attribute name'}</th>
<th>{l s='Supplier Reference'}</th>
<th>{l s='Wholesale price'}</th>
<th>{l s='Reference'}</th>
<th>{l s='EAN13'}</th>
<th>{l s='UPC'}</th>
{if $stock_management && $shopContext != Shop::CONTEXT_ALL}<th class="right">{l s='Available Quantity'}</th>{/if}
</tr>
{foreach $products AS $product} {foreach $products AS $product}
<hr />
{if !$product->hasAttributes()} {if !$product->hasAttributes()}
<table border="0" cellpadding="0" cellspacing="0" class="table" style=""> <tr>
<tr> <td><a href="?tab=AdminProducts&id_product={$product->id}&updateproduct&token={getAdminToken tab='AdminProducts'}">{$product->name}</a></td>
<th width="450">{l s='Name'} {$product->name}</th> <td>{l s='N/A'}</td>
{if !empty($product->product_supplier_reference)}<th width="190">{l s='Supplier Reference:'} {$product->product_supplier_reference}</th>{/if} <td>{if empty($product->product_supplier_reference)}{l s='N/A'}{else}{$product->product_supplier_reference}{/if}</td>
{if !empty($product->product_supplier_price_te)}<th width="190">{l s='Wholesale price:'} {$product->product_supplier_price_te}</th>{/if} <td>{if empty($product->product_supplier_price_te)}0{else}{$product->product_supplier_price_te}{/if}</td>
{if !empty($product->reference)}<th width="150">{l s='Reference:'} {$product->reference}</th>{/if} <td>{if empty($product->reference)}{l s='N/A'}{else}{$product->reference}{/if}</td>
{if !empty($product->ean13)}<th width="120">{l s='EAN13:'} {$product->ean13}</th>{/if} <td>{if empty($product->ean13)}{l s='N/A'}{else}{$product->ean13}{/if}</td>
{if !empty($product->upc)}<th width="120">{l s='UPC:'} {$product->upc}</th>{/if} <td>{if empty($product->upc)}{l s='N/A'}{else}{$product->upc}{/if}</td>
{if $stock_management}<th class="right" width="150">{l s='Available Quantity:'} {$product->quantity}</th>{/if} {if $stock_management && $shopContext != Shop::CONTEXT_ALL}<td class="right" width="150">{$product->quantity}</td>{/if}
</tr> </tr>
</table>
{else} {else}
<h3><a href="?tab=AdminProducts&id_product={$product->id}&updateproduct&token={getAdminToken tab='AdminProducts'}">{$product->name}</a></h3> {foreach $product->combination AS $id_product_attribute => $product_attribute}
<table border="0" cellpadding="0" cellspacing="0" class="table" style="width:100%;"> <tr {if $id_product_attribute %2}class="alt_row"{/if} >
<colgroup> <td><a href="?tab=AdminProducts&id_product={$product->id}&updateproduct&token={getAdminToken tab='AdminProducts'}">{$product->name}</a></td>
<col> <td>{if empty($product_attribute.attributes)}{l s='N/A'}{else}{$product_attribute.attributes}{/if}</td>
<col width="190"> <td>{if empty($product_attribute.product_supplier_reference)}{l s='N/A'}{else}{$product_attribute.product_supplier_reference}{/if}</td>
<col width="190"> <td>{if empty($product_attribute.product_supplier_price_te)}0{else}{$product_attribute.product_supplier_price_te}{/if}</td>
<col width="80"> <td>{if empty($product_attribute.reference)}{l s='N/A'}{else}{$product_attribute.reference}{/if}</td>
<col width="80"> <td>{if empty($product_attribute.ean13)}{l s='N/A'}{else}{$product_attribute.ean13}{/if}</td>
<col width="80"> <td>{if empty($product_attribute.upc)}{l s='N/A'}{else}{$product_attribute.upc}{/if}</td>
<col width="80"> {if $stock_management && $shopContext != Shop::CONTEXT_ALL}<td class="right">{$product_attribute.quantity}</td>{/if}
</colgroup>
<tr>
<th style="height:40px;">{l s='Attribute name'}</th>
<th>{l s='Supplier Reference'}</th>
<th >{l s='Wholesale price'}</th>
<th>{l s='Reference'}</th>
<th>{l s='EAN13'}</th>
<th>{l s='UPC'}</th>
{if $stock_management && $shopContext != Shop::CONTEXT_ALL}<th class="right">{l s='Available Quantity'}</th>{/if}
</tr> </tr>
{foreach $product->combination AS $id_product_attribute => $product_attribute} {/foreach}
<tr {if $id_product_attribute %2}class="alt_row"{/if} >
<td>{$product_attribute.attributes}</td>
<td>{$product_attribute.product_supplier_reference}</td>
<td>{$product_attribute.product_supplier_price_te}</td>
<td>{$product_attribute.reference}</td>
<td>{$product_attribute.ean13}</td>
<td>{$product_attribute.upc}</td>
{if $stock_management && $shopContext != Shop::CONTEXT_ALL}<td class="right">{$product_attribute.quantity}</td>{/if}
</tr>
{/foreach}
</table>
{/if} {/if}
{/foreach} {/foreach}
</table>
{/block} {/block}
@@ -138,7 +138,7 @@
// check if it's possible to add the product // check if it's possible to add the product
if (product_infos == null || $('#cur_product_name').val() == '') 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; return false;
} }
@@ -92,7 +92,7 @@
<br /> <br />
{foreach $modules_translations as $theme_name => $theme} {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} {foreach $theme as $module_name => $module}
<h3>{l s='Module:'} <a name="{$module_name}" style="font-style:italic">{$module_name}</a></h3> <h3>{l s='Module:'} <a name="{$module_name}" style="font-style:italic">{$module_name}</a></h3>
{foreach $module as $template_name => $newLang} {foreach $module as $template_name => $newLang}
@@ -107,7 +107,7 @@
{$missing_translations_module = 0} {$missing_translations_module = 0}
{/if} {/if}
<fieldset> <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>) <font color="blue">{$newLang|count}</font> {l s='expressions'} (<font color="red">{$missing_translations_module}</font>)
</legend> </legend>
<div name="{$type}_div" id="{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}" style="display:{if $missing_translations_module}block{else}none{/if}"> <div name="{$type}_div" id="{$theme_name}_{$module_name}_{$template_name|replace:'.':'_'}" style="display:{if $missing_translations_module}block{else}none{/if}">
+5 -4
View File
@@ -35,11 +35,12 @@
</div> </div>
<div class="footerRight"> <div class="footerRight">
{if $iso_is_fr} {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} {/if}
|&nbsp;<a href="http://www.prestashop.com/en/contact_us/" target="_blank" class="footer_link">{l s='Contact'}</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" target="_blank" class="footer_link">{l s='Bug Tracker'}</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/" target="_blank" class="footer_link">{l s='Forum'}</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> </div>
</div> </div>
+2 -1
View File
@@ -69,6 +69,7 @@
var token_admin_customers = '{getAdminToken tab='AdminCustomers' slashes=1}'; var token_admin_customers = '{getAdminToken tab='AdminCustomers' slashes=1}';
var token_admin_customer_threads = '{getAdminToken tab='AdminCustomerThreads' slashes=1}'; var token_admin_customer_threads = '{getAdminToken tab='AdminCustomerThreads' slashes=1}';
var currentIndex = '{$currentIndex}'; var currentIndex = '{$currentIndex}';
var choose_language_translate = "{l s='Choose language' slashes=1 }";
</script> </script>
{/if} {/if}
@@ -204,7 +205,7 @@
<ul class="submenu"> <ul class="submenu">
{foreach from=$t.sub_tabs item=t2} {foreach from=$t.sub_tabs item=t2}
{if $t2.active} {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} {/if}
{/foreach} {/foreach}
</ul> </ul>
@@ -30,7 +30,7 @@
{if isset($fields.title)}<h2>{$fields.title}</h2>{/if} {if isset($fields.title)}<h2>{$fields.title}</h2>{/if}
{block name="defaultForm"} {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} {if $form_id}
<input type="hidden" name="{$identifier}" id="{$identifier}" value="{$form_id}" /> <input type="hidden" name="{$identifier}" id="{$identifier}" value="{$form_id}" />
{/if} {/if}
@@ -234,17 +234,29 @@
{/foreach} {/foreach}
{elseif $input.type == 'file'} {elseif $input.type == 'file'}
{if isset($input.display_image) && $input.display_image} {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"> <div id="image">
{$fields_value.image} {$fields_value[$input.name].image}
<p align="center">{l s='File size'} {$fields_value.size}kb</p> <p align="center">{l s='File size'} {$fields_value[$input.name].size}kb</p>
<a href="{$current}&{$identifier}={$form_id}&token={$token}&deleteImage=1"> <a href="{$current}&{$identifier}={$form_id}&token={$token}&deleteImage=1">
<img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'} <img src="../img/admin/delete.gif" alt="{l s='Delete'}" /> {l s='Delete'}
</a> </a>
</div><br /> </div><br />
{/if} {/if}
{/if} {/if}
<input type="file" name="{$input.name}" {if isset($input.id)}id="{$input.id}"{/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} {if !empty($input.hint)}<span class="hint" name="help_box">{$input.hint}<span class="hint-pointer">&nbsp;</span></span>{/if}
{elseif $input.type == 'password'} {elseif $input.type == 'password'}
<input type="password" <input type="password"
@@ -302,7 +314,6 @@
{if isset($input.class)}class="{$input.class}" {if isset($input.class)}class="{$input.class}"
{else}class="color mColorPickerInput"{/if} {else}class="color mColorPickerInput"{/if}
name="{$input.name}" name="{$input.name}"
class="{if isset($input.class)}{$input.class}{/if}"
value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}" /> value="{$fields_value[$input.name]|escape:'htmlall':'UTF-8'}" />
{elseif $input.type == 'date'} {elseif $input.type == 'date'}
<input type="text" <input type="text"
@@ -343,13 +354,13 @@
{/if} {/if}
{/if} {/if}
{/foreach} {/foreach}
{hook h='displayAdminForm'} {hook h='displayAdminForm' fieldset=$f}
{if isset($name_controller)} {if isset($name_controller)}
{capture name=hookName assign=hookName}display{$name_controller|ucfirst}Form{/capture} {capture name=hookName assign=hookName}display{$name_controller|ucfirst}Form{/capture}
{hook h=$hookName} {hook h=$hookName fieldset=$f}
{elseif isset($smarty.get.controller)} {elseif isset($smarty.get.controller)}
{capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}Form{/capture} {capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}Form{/capture}
{hook h=$hookName} {hook h=$hookName fieldset=$f}
{/if} {/if}
{elseif $key == 'submit'} {elseif $key == 'submit'}
<div class="margin-form"> <div class="margin-form">
@@ -59,7 +59,7 @@
{block name="td_content"} {block name="td_content"}
{if isset($params.prefix)}{$params.prefix}{/if} {if isset($params.prefix)}{$params.prefix}{/if}
{if isset($params.color) && isset($tr[$params.color])} {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}
{if isset($tr.$key)} {if isset($tr.$key)}
{if isset($params.active)} {if isset($params.active)}
@@ -27,8 +27,8 @@
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
$('table.{$table} .filter').keypress(function(event){ $('table.{$list_id} .filter').keypress(function(event){
formSubmit(event, 'submitFilterButton{$table}') formSubmit(event, 'submitFilterButton{$list_id}')
}) })
}); });
</script> </script>
@@ -37,7 +37,7 @@
<script type="text/javascript" src="../js/jquery/plugins/jquery.tablednd.js"></script> <script type="text/javascript" src="../js/jquery/plugins/jquery.tablednd.js"></script>
<script type="text/javascript"> <script type="text/javascript">
var token = '{$token}'; var token = '{$token}';
var come_from = '{$table}'; var come_from = '{$list_id}';
var alternate = {if $order_way == 'DESC'}'1'{else}'0'{/if}; var alternate = {if $order_way == 'DESC'}'1'{else}'0'{/if};
</script> </script>
<script type="text/javascript" src="../js/admin-dnd.js"></script> <script type="text/javascript" src="../js/admin-dnd.js"></script>
@@ -45,8 +45,8 @@
<script type="text/javascript"> <script type="text/javascript">
$(function() { $(function() {
if ($("table.{$table} .datepicker").length > 0) if ($("table.{$list_id} .datepicker").length > 0)
$("table.{$table} .datepicker").datepicker({ $("table.{$list_id} .datepicker").datepicker({
prevText: '', prevText: '',
nextText: '', nextText: '',
dateFormat: 'yy-mm-dd' dateFormat: 'yy-mm-dd'
@@ -83,7 +83,7 @@
{block name="override_form_extra"}{/block} {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} {/if}
<table class="table_grid" name="list_table"> <table class="table_grid" name="list_table">
{if !$simple_header} {if !$simple_header}
@@ -91,16 +91,16 @@
<td style="vertical-align: bottom;"> <td style="vertical-align: bottom;">
<span style="float: left;"> <span style="float: left;">
{if $page > 1} {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-prev2.gif" onclick="getE('submitFilter{$list_id}').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-prev.gif" onclick="getE('submitFilter{$list_id}').value={$page - 1}"/>
{/if} {/if}
{l s='Page'} <b>{$page}</b> / {$total_pages} {l s='Page'} <b>{$page}</b> / {$total_pages}
{if $page < $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-next.gif" onclick="getE('submitFilter{$list_id}').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-next2.gif" onclick="getE('submitFilter{$list_id}').value={$total_pages}"/>
{/if} {/if}
| {l s='Display'} | {l s='Display'}
<select name="pagination" onchange="submit()"> <select name="{$list_id}_pagination" onchange="submit()">
{* Choose number of results per page *} {* Choose number of results per page *}
{foreach $pagination AS $value} {foreach $pagination AS $value}
<option value="{$value|intval}"{if $selected_pagination == $value} selected="selected" {elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option> <option value="{$value|intval}"{if $selected_pagination == $value} selected="selected" {elseif $selected_pagination == NULL && $value == $pagination[1]} selected="selected2"{/if}>{$value|intval}</option>
@@ -109,8 +109,8 @@
/ {$list_total} {l s='result(s)'} / {$list_total} {l s='result(s)'}
</span> </span>
<span style="float: right;"> <span style="float: right;">
<input type="submit" name="submitReset{$table}" value="{l s='Reset'}" class="button" /> <input type="submit" id="submitFilterButton{$list_id}" name="submitFilter" value="{l s='Filter'}" class="button" />
<input type="submit" id="submitFilterButton{$table}" name="submitFilter" value="{l s='Filter'}" class="button" /> <input type="submit" name="submitReset{$list_id}" value="{l s='Reset'}" class="button" />
</span> </span>
<span class="clear"></span> <span class="clear"></span>
</td> </td>
@@ -120,7 +120,7 @@
<td{if $simple_header} style="border:none;"{/if}> <td{if $simple_header} style="border:none;"{/if}>
<table <table
{if $table_id} id={$table_id}{/if} {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" cellpadding="0" cellspacing="0"
style="width: 100%; margin-bottom:10px;"> style="width: 100%; margin-bottom:10px;">
<col width="10px" /> <col width="10px" />
@@ -137,7 +137,7 @@
<tr class="nodrag nodrop" style="height: 40px"> <tr class="nodrag nodrop" style="height: 40px">
<th class="center"> <th class="center">
{if $has_bulk_actions} {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} {/if}
</th> </th>
{foreach $fields_display AS $key => $params} {foreach $fields_display AS $key => $params}
@@ -148,9 +148,9 @@
</span> </span>
{if (!isset($params.orderby) || $params.orderby) && !$simple_header} {if (!isset($params.orderby) || $params.orderby) && !$simple_header}
<br /> <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> <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> <img border="0" src="../img/admin/up{if isset($order_by) && ($key == $order_by) && ($order_way == 'ASC')}_d{/if}.gif" /></a>
{elseif !$simple_header} {elseif !$simple_header}
<br />&nbsp; <br />&nbsp;
@@ -186,7 +186,7 @@
-- --
{else} {else}
{if $params.type == 'bool'} {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="">--</option>
<option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option> <option value="1" {if $params.value == 1} selected="selected" {/if}>{l s='Yes'}</option>
<option value="0" {if $params.value == 0 && $params.value != ''} selected="selected" {/if}>{l s='No'}</option> <option value="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}/> {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'} {elseif $params.type == 'select'}
{if isset($params.filter_key)} {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> <option value="" {if $params.value == ''} selected="selected" {/if}>--</option>
{if isset($params.list) && is_array($params.list)} {if isset($params.list) && is_array($params.list)}
{foreach $params.list AS $option_value => $option_display} {foreach $params.list AS $option_value => $option_display}
@@ -206,7 +206,7 @@
</select> </select>
{/if} {/if}
{else} {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}
{/if} {/if}
</td> </td>
@@ -31,7 +31,7 @@
{counter start=1 assign="count"} {counter start=1 assign="count"}
{foreach from=$modules_list item=module} {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> <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>
<li> <li>
{/if} {/if}
+1 -1
View File
@@ -35,7 +35,7 @@
</span> </span>
{if count($errors) == 1} {if count($errors) == 1}
{$errors[0]} {reset($errors)}
{else} {else}
{l s='%d errors' sprintf=$errors|count} {l s='%d errors' sprintf=$errors|count}
<br/> <br/>
@@ -38,7 +38,7 @@
<div style="float:right;margin:5px"> <div style="float:right;margin:5px">
<a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png"></a> <a href="#" onclick="$('#modules_list_container').slideUp();return false;"><img alt="X" src="../img/admin/close.png"></a>
</div> </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 id="modules_list_container_tab" style="display:none;"></div>
</div> </div>
{/if} {/if}
+1 -1
View File
@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php'); require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated(); 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');
+1 -1
View File
@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php'); require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated(); 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');
+1 -1
View File
@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php'); require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated(); 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');
+2
View File
@@ -25,6 +25,8 @@
'AdminAttributesGroupsControllerCore' => 'controllers/admin/AdminAttributesGroupsController.php', 'AdminAttributesGroupsControllerCore' => 'controllers/admin/AdminAttributesGroupsController.php',
'AdminBackupController' => '', 'AdminBackupController' => '',
'AdminBackupControllerCore' => 'controllers/admin/AdminBackupController.php', 'AdminBackupControllerCore' => 'controllers/admin/AdminBackupController.php',
'AdminCarrierWizardController' => '',
'AdminCarrierWizardControllerCore' => 'controllers/admin/AdminCarrierWizardController.php',
'AdminCarriersController' => '', 'AdminCarriersController' => '',
'AdminCarriersControllerCore' => 'controllers/admin/AdminCarriersController.php', 'AdminCarriersControllerCore' => 'controllers/admin/AdminCarriersController.php',
'AdminCartRulesController' => '', 'AdminCartRulesController' => '',
+1 -1
View File
@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php'); require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated(); 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');
+1 -1
View File
@@ -34,4 +34,4 @@
require(dirname(__FILE__).'/config/config.inc.php'); require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated(); 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');
+10 -6
View File
@@ -222,7 +222,7 @@ class AddressCore extends ObjectModel
public function validateController($htmlentities = true) public function validateController($htmlentities = true)
{ {
$errors = parent::validateController($htmlentities); $errors = parent::validateController($htmlentities);
if (!Configuration::get('VATNUMBER_CHECKING')) if (!Configuration::get('VATNUMBER_MANAGEMENT') || !Configuration::get('VATNUMBER_CHECKING'))
return $errors; return $errors;
include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php'); include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php');
if (class_exists('VatNumber', false)) if (class_exists('VatNumber', false))
@@ -237,6 +237,8 @@ class AddressCore extends ObjectModel
*/ */
public static function getZoneById($id_address) public static function getZoneById($id_address)
{ {
if(!isset($id_address) || empty($id_address))
return false;
if (isset(self::$_idZones[$id_address])) if (isset(self::$_idZones[$id_address]))
return self::$_idZones[$id_address]; return self::$_idZones[$id_address];
@@ -259,6 +261,9 @@ class AddressCore extends ObjectModel
*/ */
public static function isCountryActiveById($id_address) public static function isCountryActiveById($id_address)
{ {
if(!isset($id_address) || empty($id_address))
return false;
if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
SELECT c.`active` SELECT c.`active`
FROM `'._DB_PREFIX_.'address` a FROM `'._DB_PREFIX_.'address` a
@@ -308,11 +313,10 @@ class AddressCore extends ObjectModel
{ {
$key = 'address_exists_'.(int)$id_address; $key = 'address_exists_'.(int)$id_address;
if (!Cache::isStored($key)) if (!Cache::isStored($key))
Cache::store( {
$key, Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' $id_address = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue('SELECT `id_address` FROM '._DB_PREFIX_.'address a WHERE a.`id_address` = '.(int)$id_address);
SELECT `id_address` Cache::store($key, (bool)$id_address);
FROM '._DB_PREFIX_.'address a }
WHERE a.`id_address` = '.(int)$id_address));
return Cache::retrieve($key); return Cache::retrieve($key);
} }
+2 -2
View File
@@ -1676,9 +1676,9 @@ abstract class AdminTabCore
elseif (isset($params['float'])) elseif (isset($params['float']))
echo rtrim(rtrim($tr[$key], '0'), '.'); echo rtrim(rtrim($tr[$key], '0'), '.');
elseif (isset($params['type']) && $params['type'] == 'date') 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') 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])) elseif (isset($tr[$key]))
{ {
if ($key == 'price') if ($key == 'price')
+2 -2
View File
@@ -71,7 +71,7 @@ class AttributeCore extends ObjectModel
public function delete() 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); $result = Db::getInstance()->executeS('SELECT id_product_attribute FROM '._DB_PREFIX_.'product_attribute_combination WHERE id_attribute = '.(int)$this->id);
foreach ($result as $row) foreach ($result as $row)
@@ -343,4 +343,4 @@ class AttributeCore extends ObjectModel
return (is_numeric($position)) ? $position : -1; return (is_numeric($position)) ? $position : -1;
} }
} }
+20 -7
View File
@@ -70,6 +70,11 @@ class AttributeGroupCore extends ObjectModel
public function add($autodate = true, $nullValues = false) 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) if ($this->position <= 0)
$this->position = AttributeGroup::getHigherPosition() + 1; $this->position = AttributeGroup::getHigherPosition() + 1;
@@ -80,11 +85,16 @@ class AttributeGroupCore extends ObjectModel
public function update($nullValues = false) 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); $return = parent::update($nullValues);
Hook::exec('actionAttributeGroupSave', array('id_attribute_group' => $this->id)); Hook::exec('actionAttributeGroupSave', array('id_attribute_group' => $this->id));
return $return; return $return;
} }
public static function cleanDeadCombinations() public static function cleanDeadCombinations()
{ {
$attribute_combinations = Db::getInstance()->executeS(' $attribute_combinations = Db::getInstance()->executeS('
@@ -109,7 +119,7 @@ class AttributeGroupCore extends ObjectModel
public function delete() public function delete()
{ {
if (!$this->hasMultishopEntries()) if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL)
{ {
/* Select children in order to find linked combinations */ /* Select children in order to find linked combinations */
$attribute_ids = Db::getInstance()->executeS(' $attribute_ids = Db::getInstance()->executeS('
@@ -132,12 +142,15 @@ class AttributeGroupCore extends ObjectModel
if (!AttributeGroup::cleanDeadCombinations()) if (!AttributeGroup::cleanDeadCombinations())
return false; return false;
/* Also delete related attributes */ /* Also delete related attributes */
if (Db::getInstance()->execute(' if (count($to_remove))
if (!Db::getInstance()->execute('
DELETE FROM `'._DB_PREFIX_.'attribute_lang` DELETE FROM `'._DB_PREFIX_.'attribute_lang`
WHERE `id_attribute` WHERE `id_attribute` IN ('.implode(',', $to_remove).')') ||
IN (SELECT id_attribute FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id.')') === false || !Db::getInstance()->execute('
Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'attribute` WHERE `id_attribute_group` = '.(int)$this->id) === false) DELETE FROM `'._DB_PREFIX_.'attribute_shop`
return false; 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(); $this->cleanPositions();
} }
$return = parent::delete(); $return = parent::delete();
+10 -20
View File
@@ -136,27 +136,17 @@ class Autoload
} }
else else
{ {
// Let's write index content in cache file $filename_tmp = tempnam(dirname($filename), basename($filename.'.'));
// In order to be sure that this file is correctly written, a check is done on the file content if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE)
$loop_protection = 0; {
do rename($filename_tmp, $filename);
{ @chmod($filename, 0664);
$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;
} }
while (!$integrity_is_ok); else
{
if (!$integrity_is_ok) // $filename_tmp couldn't be written. $filename should be there anyway (even if outdated),
{ // no need to die.
file_put_contents($filename, '<?php return array(); ?>', LOCK_EX); error_log('Cannot write temporary file '.$filename_tmp);
// Cannot use PrestaShopException in this context
die('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically');
} }
} }
+1 -1
View File
@@ -42,7 +42,7 @@ class BlowfishCore extends Crypt_Blowfish
$piece = substr($paddedtext, $x, 8); $piece = substr($paddedtext, $x, 8);
$cipher_piece = parent::encrypt($piece); $cipher_piece = parent::encrypt($piece);
$encoded = base64_encode($cipher_piece); $encoded = base64_encode($cipher_piece);
$ciphertext = $ciphertext.$encoded; $ciphertext = $ciphertext.$encoded;
} }
return $ciphertext.sprintf('%06d', $length); return $ciphertext.sprintf('%06d', $length);
} }
+1 -1
View File
@@ -53,7 +53,7 @@ class CMSCore extends ObjectModel
'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), '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), '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), '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),
), ),
); );
+67 -18
View File
@@ -165,6 +165,14 @@ class CarrierCore extends ObjectModel
public function __construct($id = null, $id_lang = null) public function __construct($id = null, $id_lang = null)
{ {
parent::__construct($id, $id_lang); 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 * keep retrocompatibility id_tax_rules_group
* @deprecated 1.5.0 * @deprecated 1.5.0
@@ -370,13 +378,12 @@ class CarrierCore extends ObjectModel
*/ */
public static function getDeliveryPriceByRanges($range_table, $id_carrier) public static function getDeliveryPriceByRanges($range_table, $id_carrier)
{ {
$range_table = pSQL($range_table); $sql = 'SELECT d.`id_'.bqSQL($range_table).'`, d.id_carrier, d.id_zone, d.price
$sql = 'SELECT d.id_'.$range_table.', d.id_carrier, d.id_zone, d.price
FROM '._DB_PREFIX_.'delivery d 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.' WHERE d.id_carrier = '.(int)$id_carrier.'
AND d.id_'.$range_table.' IS NOT NULL AND d.`id_'.bqSQL($range_table).'` IS NOT NULL
AND d.id_'.$range_table.' != 0 AND d.`id_'.bqSQL($range_table).'` != 0
'.Carrier::sqlDeliveryRangeShop($range_table).' '.Carrier::sqlDeliveryRangeShop($range_table).'
ORDER BY r.delimiter1'; ORDER BY r.delimiter1';
return Db::getInstance()->executeS($sql); return Db::getInstance()->executeS($sql);
@@ -456,6 +463,22 @@ class CarrierCore extends ObjectModel
return $carriers; 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) public static function getDeliveredCountries($id_lang, $active_countries = false, $active_carriers = false, $contain_states = null)
{ {
if (!Validate::isBool($active_countries) || !Validate::isBool($active_carriers)) if (!Validate::isBool($active_countries) || !Validate::isBool($active_carriers))
@@ -467,7 +490,9 @@ class CarrierCore extends ObjectModel
ORDER BY s.`name` ASC'); ORDER BY s.`name` ASC');
$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' $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.') 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 '. 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) ' : ') ').' ($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['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'] = (($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_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' : ''; $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) // If price is false, then the carrier is unavailable (carrier module)
@@ -710,7 +735,7 @@ class CarrierCore extends ObjectModel
*/ */
public function deleteDeliveryPrice($range_table) 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) if (Shop::getContext() == Shop::CONTEXT_ALL)
$where .= 'AND id_shop IS NULL AND id_shop_group IS NULL'; $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) * @param array $priceList Prices list in multiple arrays (changed to array since 1.5.0)
* @return boolean Insertion result * @return boolean Insertion result
*/ */
public function addDeliveryPrice($price_list) public function addDeliveryPrice($price_list, $delete = false)
{ {
if (!$price_list) if (!$price_list)
return false; return false;
@@ -747,6 +772,17 @@ class CarrierCore extends ObjectModel
if (!isset($values['id_shop_group'])) if (!isset($values['id_shop_group']))
$values['id_shop_group'] = (Shop::getContext() != Shop::CONTEXT_ALL) ? Shop::getContextShopGroupID() : null; $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 .= '('; $sql .= '(';
foreach ($values as $v) foreach ($values as $v)
{ {
@@ -850,8 +886,7 @@ class CarrierCore extends ObjectModel
(SELECT '.(int)$this->id.', `id_tax_rules_group`, `id_shop` (SELECT '.(int)$this->id.', `id_tax_rules_group`, `id_shop`
FROM `'._DB_PREFIX_.'carrier_tax_rules_group_shop` FROM `'._DB_PREFIX_.'carrier_tax_rules_group_shop`
WHERE `id_carrier`='.(int)$old_id.')'); 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; return false;
} }
public function getRangeObject() public function getRangeObject($shipping_method = false)
{ {
$shipping_method = $this->getShippingMethod(); if (!$shipping_method)
$shipping_method = $this->getShippingMethod();
if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT) if ($shipping_method == Carrier::SHIPPING_METHOD_WEIGHT)
return new RangeWeight(); return new RangeWeight();
elseif ($shipping_method == Carrier::SHIPPING_METHOD_PRICE) elseif ($shipping_method == Carrier::SHIPPING_METHOD_PRICE)
@@ -1031,9 +1068,9 @@ class CarrierCore extends ObjectModel
$sql = 'AND '.$alias.'.id_delivery = ( $sql = 'AND '.$alias.'.id_delivery = (
SELECT d2.id_delivery SELECT d2.id_delivery
FROM '._DB_PREFIX_.'delivery d2 FROM '._DB_PREFIX_.'delivery d2
WHERE d2.id_carrier = '.$alias.'.id_carrier WHERE d2.id_carrier = `'.bqSQL($alias).'`.id_carrier
AND d2.id_zone = '.$alias.'.id_zone AND d2.id_zone = `'.bqSQL($alias).'`.id_zone
AND d2.id_'.$range_table.' = '.$alias.'.id_'.$range_table.' AND d2.`id_'.bqSQL($range_table).'` = `'.bqSQL($alias).'`.`id_'.bqSQL($range_table).'`
'.$where.' '.$where.'
ORDER BY d2.id_shop DESC, d2.id_shop_group DESC ORDER BY d2.id_shop DESC, d2.id_shop_group DESC
LIMIT 1 LIMIT 1
@@ -1249,5 +1286,17 @@ class CarrierCore extends ObjectModel
return true; 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, ','));
}
}
+83 -98
View File
@@ -134,6 +134,7 @@ class CartCore extends ObjectModel
'cart_rows' => array('resource' => 'cart_row', 'virtual_entity' => true, 'fields' => array( 'cart_rows' => array('resource' => 'cart_row', 'virtual_entity' => true, 'fields' => array(
'id_product' => array('required' => true, 'xlink_resource' => 'products'), 'id_product' => array('required' => true, 'xlink_resource' => 'products'),
'id_product_attribute' => array('required' => true, 'xlink_resource' => 'combinations'), 'id_product_attribute' => array('required' => true, 'xlink_resource' => 'combinations'),
'id_address_delivery' => array('required' => true, 'xlink_resource' => 'addresses'),
'quantity' => array('required' => true), 'quantity' => array('required' => true),
) )
), ),
@@ -209,7 +210,7 @@ class CartCore extends ObjectModel
if (!isset($this->id_address_invoice) || $this->id_address_invoice == $id_address) if (!isset($this->id_address_invoice) || $this->id_address_invoice == $id_address)
{ {
$to_update = true; $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) if (!isset($this->id_address_delivery) || $this->id_address_delivery == $id_address)
{ {
@@ -424,9 +425,10 @@ class CartCore extends ObjectModel
// Build SELECT // Build SELECT
$sql->select('cp.`id_product_attribute`, cp.`id_product`, cp.`quantity` AS cart_quantity, cp.id_shop, pl.`name`, p.`is_virtual`, $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`, 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`, p.`id_manufacturer`, product_shop.`on_sale`, product_shop.`ecotax`, product_shop.`additional_shipping_cost`,
stock.`quantity` quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, product_shop.`active`, p.`date_add`, product_shop.`available_for_order`, product_shop.`price`, product_shop.`active`, product_shop.`unity`, product_shop.`unit_price_ratio`,
p.`date_upd`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category, 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, 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'); 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(' $row2 = Db::getInstance()->getRow('
SELECT image_shop.`id_image` id_image, il.`legend` SELECT image_shop.`id_image` id_image, il.`legend`
FROM `'._DB_PREFIX_.'image` i'. FROM `'._DB_PREFIX_.'image` i
Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' 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.') 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' 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)) if (!Validate::isLoadedObject($cartRule))
return false; 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 // Add the cart rule to the cart
if (!Db::getInstance()->insert('cart_cart_rule', array( if (!Db::getInstance()->insert('cart_cart_rule', array(
'id_cart_rule' => (int)$id_cart_rule, '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)) if (empty($id_carrier) && $this->isCarrierInRange((int)Configuration::get('PS_CARRIER_DEFAULT'), (int)$id_zone))
$id_carrier = (int)Configuration::get('PS_CARRIER_DEFAULT'); $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 (empty($id_carrier))
{ {
if ((int)$this->id_customer) 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); $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); $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 // 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; $id_zone = (int)$default_country->id_zone;
} }
$check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight((int)$carrier->id, $this->getTotalWeight(), (int)$id_zone); 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)
// 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
)) ))
$shipping_cost += 0; $shipping_cost += 0;
else else
@@ -2845,7 +2833,10 @@ class CartCore extends ObjectModel
$formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery); $formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery);
$formatted_addresses['invoice'] = AddressFormat::getFormattedLayoutData($invoice); $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) if ($total_tax < 0)
$total_tax = 0; $total_tax = 0;
@@ -2943,9 +2934,9 @@ class CartCore extends ObjectModel
'total_shipping_tax_exc' => $total_shipping_tax_exc, 'total_shipping_tax_exc' => $total_shipping_tax_exc,
'total_products_wt' => $total_products_wt, 'total_products_wt' => $total_products_wt,
'total_products' => $total_products, 'total_products' => $total_products,
'total_price' => $this->getOrderTotal(), 'total_price' => $base_total_tax_inc,
'total_tax' => $total_tax, '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), 'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1),
'free_ship' => $total_shipping ? 0 : 1, 'free_ship' => $total_shipping ? 0 : 1,
'carrier' => new Carrier($this->id_carrier, $id_lang), 'carrier' => new Carrier($this->id_carrier, $id_lang),
@@ -2958,12 +2949,8 @@ class CartCore extends ObjectModel
return false; return false;
foreach ($this->getProducts() as $product) foreach ($this->getProducts() as $product)
if (!$product['active'] || !$product['available_for_order']
if (!$product['active'] || (!$product['allow_oosp'] && $product['stock_quantity'] < $product['cart_quantity']))
|| (
!$product['allow_oosp'] && $product['stock_quantity'] < $product['cart_quantity']
)
|| !$product['available_for_order'])
return false; return false;
return true; return true;
@@ -3047,8 +3034,10 @@ class CartCore extends ObjectModel
public function addTextFieldToProduct($id_product, $index, $type, $text_value) public function addTextFieldToProduct($id_product, $index, $type, $text_value)
{ {
$text_value = str_replace(array("\n", "\r"), '', nl2br($text_value)); $text_value = str_replace(array("\n", "\r"), '', nl2br($text_value));
$text_value = str_replace('\\', '\\\\', $text_value); if (!_PS_MAGIC_QUOTES_GPC_){
$text_value = str_replace('\'', '\\\'', $text_value); $text_value = str_replace('\\', '\\\\', $text_value);
$text_value = str_replace('\'', '\\\'', $text_value);
}
return $this->_addCustomization($id_product, 0, $index, $type, $text_value, 0); return $this->_addCustomization($id_product, 0, $index, $type, $text_value, 0);
} }
@@ -3224,25 +3213,24 @@ class CartCore extends ObjectModel
public function getWsCartRows() public function getWsCartRows()
{ {
$query = ' return Db::getInstance()->executeS('
SELECT id_product, id_product_attribute, quantity SELECT id_product, id_product_attribute, quantity
FROM `'._DB_PREFIX_.'cart_product` FROM `'._DB_PREFIX_.'cart_product`
WHERE id_cart = '.(int)$this->id.' WHERE id_cart = '.(int)$this->id.' AND id_shop = '.(int)Context::getContext()->shop->id
AND id_shop = '.(int)Context::getContext()->shop->id; );
$result = Db::getInstance()->executeS($query);
return $result;
} }
public function setWsCartRows($values) public function setWsCartRows($values)
{ {
if ($this->deleteAssociations()) 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) foreach ($values as $value)
$query .= '('.(int)$this->id.', '.(int)$value['id_product'].', '. $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, ',')); Db::getInstance()->execute(rtrim($query, ','));
} }
@@ -3427,62 +3415,59 @@ class CartCore extends ObjectModel
*/ */
public function setNoMultishipping() public function setNoMultishipping()
{ {
// Upgrading quantities if (Configuration::get('PS_ALLOW_MULTISHIPPING'))
$sql = 'SELECT sum(`quantity`) as quantity, id_product, id_product_attribute, count(*) as count
FROM `'._DB_PREFIX_.'cart_product`
WHERE `id_cart` = '.(int)$this->id.'
AND `id_shop` = '.(int)$this->id_shop.'
GROUP BY id_product, id_product_attribute
HAVING count > 1';
foreach (Db::getInstance()->executeS($sql) as $product)
{ {
$sql = 'UPDATE `'._DB_PREFIX_.'cart_product` // Upgrading quantities
SET `quantity` = '.$product['quantity'].' $sql = 'SELECT sum(`quantity`) as quantity, id_product, id_product_attribute, count(*) as count
WHERE `id_cart` = '.(int)$this->id.' FROM `'._DB_PREFIX_.'cart_product`
AND `id_shop` = '.(int)$this->id_shop.' WHERE `id_cart` = '.(int)$this->id.'
AND id_product = '.$product['id_product'].' AND `id_shop` = '.(int)$this->id_shop.'
AND id_product_attribute = '.$product['id_product_attribute']; GROUP BY id_product, id_product_attribute
Db::getInstance()->execute($sql); HAVING count > 1';
foreach (Db::getInstance()->executeS($sql) as $product)
{
$sql = 'UPDATE `'._DB_PREFIX_.'cart_product`
SET `quantity` = '.$product['quantity'].'
WHERE `id_cart` = '.(int)$this->id.'
AND `id_shop` = '.(int)$this->id_shop.'
AND id_product = '.$product['id_product'].'
AND id_product_attribute = '.$product['id_product_attribute'];
Db::getInstance()->execute($sql);
}
// Merging multiple lines
$sql = 'DELETE cp1
FROM `'._DB_PREFIX_.'cart_product` cp1
INNER JOIN `'._DB_PREFIX_.'cart_product` cp2
ON (
(cp1.id_cart = cp2.id_cart)
AND (cp1.id_product = cp2.id_product)
AND (cp1.id_product_attribute = cp2.id_product_attribute)
AND (cp1.id_address_delivery <> cp2.id_address_delivery)
AND (cp1.date_add > cp2.date_add)
)';
Db::getInstance()->execute($sql);
} }
// Merging multiple lines // Update delivery address for each product line
$sql = 'DELETE cp1 Db::getInstance()->execute('
FROM `'._DB_PREFIX_.'cart_product` cp1 UPDATE `'._DB_PREFIX_.'cart_product`
INNER JOIN `'._DB_PREFIX_.'cart_product` cp2 SET `id_address_delivery` = (
ON ( SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
(cp1.id_cart = cp2.id_cart) WHERE `id_cart` = '.(int)$this->id.' AND `id_shop` = '.(int)$this->id_shop.'
AND (cp1.id_product = cp2.id_product) )
AND (cp1.id_product_attribute = cp2.id_product_attribute) WHERE `id_cart` = '.(int)$this->id.'
AND (cp1.id_address_delivery <> cp2.id_address_delivery) '.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : ''));
AND (cp1.date_add > cp2.date_add)
)'; if (Customization::isFeatureActive())
Db::getInstance()->execute($sql); Db::getInstance()->execute('
UPDATE `'._DB_PREFIX_.'customization`
// Upgrading address delivery SET `id_address_delivery` = (
$sql = 'UPDATE `'._DB_PREFIX_.'cart_product` SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart`
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 : '');
Db::getInstance()->execute($sql);
$sql = '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.'
) )
WHERE `id_cart` = '.(int)$this->id; WHERE `id_cart` = '.(int)$this->id);
Db::getInstance()->execute($sql);
} }
/** /**
+39 -52
View File
@@ -10,7 +10,7 @@
* http://opensource.org/licenses/osl-3.0.php * http://opensource.org/licenses/osl-3.0.php
* If you did not receive a copy of the license and are unable to * 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 * 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 * DISCLAIMER
* *
@@ -333,11 +333,8 @@ class CartRuleCore extends ObjectModel
return array(); return array();
$productRuleGroups = array(); $productRuleGroups = array();
$results = Db::getInstance()->executeS(' $result = Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'cart_rule_product_rule_group WHERE id_cart_rule = '.(int)$this->id);
SELECT * foreach ($result as $row)
FROM '._DB_PREFIX_.'cart_rule_product_rule_group prg
WHERE prg.id_cart_rule = '.(int)$this->id, false);
foreach ($results as $row)
{ {
if (!isset($productRuleGroups[$row['id_product_rule_group']])) 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']); $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); $cartTotal = $context->cart->getOrderTotal($this->minimum_amount_tax, Cart::ONLY_PRODUCTS);
if ($this->minimum_amount_shipping) if ($this->minimum_amount_shipping)
$cartTotal += $context->cart->getOrderTotal($this->minimum_amount_tax, Cart::ONLY_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 foreach ($cart_rules as &$cart_rule)
if ($this->gift_product && $alreadyInCart) if ($cart_rule['gift_product'])
{ foreach ($products as $key => &$product)
$query = new DbQuery(); 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_);
$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;
}
}
if ($cartTotal < $minimum_amount) if ($cartTotal < $minimum_amount)
return (!$display_error) ? false : Tools::displayError('You have not reached the minimum amount required to use this voucher'); 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 /* This loop checks:
// 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 - 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(); $otherCartRules = $context->cart->getCartRules();
if (count($otherCartRules)) if (count($otherCartRules))
foreach ($otherCartRules as $otherCartRule) foreach ($otherCartRules as $otherCartRule)
{ {
if ($otherCartRule['id_cart_rule'] == $this->id && !$alreadyInCart) if ($otherCartRule['id_cart_rule'] == $this->id && !$alreadyInCart)
return (!$display_error) ? false : Tools::displayError('This voucher is already in your cart'); 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) if ($this->cart_rule_restriction && $otherCartRule['cart_rule_restriction'] && $otherCartRule['id_cart_rule'] != $this->id)
{ {
$combinable = Db::getInstance()->getValue(' $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) if (!$display_error)
return true; return true;
} }
@@ -630,7 +615,8 @@ class CartRuleCore extends ObjectModel
FROM `'._DB_PREFIX_.'cart_product` cp FROM `'._DB_PREFIX_.'cart_product` cp
LEFT JOIN `'._DB_PREFIX_.'category_product` catp ON cp.id_product = catp.id_product LEFT JOIN `'._DB_PREFIX_.'category_product` catp ON cp.id_product = catp.id_product
WHERE cp.`id_cart` = '.(int)$context->cart->id.' 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; $countMatchingProducts = 0;
$matchingProductsList = array(); $matchingProductsList = array();
foreach ($cartCategories as $cartCategory) foreach ($cartCategories as $cartCategory)
@@ -1096,32 +1082,33 @@ class CartRuleCore extends ObjectModel
'.($context->customer->id ? 'OR cr.id_customer = '.(int)$context->cart->id_customer : '').' '.($context->customer->id ? 'OR cr.id_customer = '.(int)$context->cart->id_customer : '').'
) )
AND ( AND (
cr.carrier_restriction = 0 cr.`carrier_restriction` = 0
'.($context->cart->id_carrier ? 'OR c.id_carrier = '.(int)$context->cart->id_carrier : '').' '.($context->cart->id_carrier ? 'OR c.id_carrier = '.(int)$context->cart->id_carrier : '').'
) )
AND ( AND (
cr.shop_restriction = 0 cr.`shop_restriction` = 0
'.((Shop::isFeatureActive() && $context->shop->id) ? 'OR crs.id_shop = '.(int)$context->shop->id : '').' '.((Shop::isFeatureActive() && $context->shop->id) ? 'OR crs.id_shop = '.(int)$context->shop->id : '').'
) )
AND ( AND (
cr.group_restriction = 0 cr.`group_restriction` = 0
'.($context->customer->id ? 'OR 0 < ( '.($context->customer->id ? 'OR 0 < (
SELECT cg.id_group SELECT cg.`id_group`
FROM '._DB_PREFIX_.'customer_group cg 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.') INNER JOIN `'._DB_PREFIX_.'cart_rule_group` crg ON cg.id_group = crg.id_group
WHERE cr.id_cart_rule = crg.id_cart_rule WHERE cr.`id_cart_rule` = crg.`id_cart_rule`
AND cg.id_customer = '.(int)$context->customer->id.' LIMIT 1 AND cg.`id_customer` = '.(int)$context->customer->id.'
LIMIT 1
)' : '').' )' : '').'
) )
AND ( AND (
cr.reduction_product <= 0 cr.`reduction_product` <= 0
OR cr.reduction_product IN ( OR cr.`reduction_product` IN (
SELECT id_product SELECT `id_product`
FROM '._DB_PREFIX_.'cart_product FROM `'._DB_PREFIX_.'cart_product`
WHERE id_cart = '.(int)$context->cart->id.' 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.') AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.')
ORDER BY priority'; ORDER BY priority';
$result = Db::getInstance()->executeS($sql); $result = Db::getInstance()->executeS($sql);
if ($result) if ($result)
+14 -21
View File
@@ -109,7 +109,7 @@ class CategoryCore extends ObjectModel
// Lang fields // Lang fields
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 64), '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), '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_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_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), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255),
@@ -510,7 +510,7 @@ class CategoryCore extends ObjectModel
die(Tools::displayError()); die(Tools::displayError());
$groups = FrontController::getCurrentCustomerGroups(); $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(' $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 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 else
return new Category($shop->getCategory(), $id_lang); return new Category($shop->getCategory(), $id_lang);
$is_more_than_one_root_category = count(Category::getCategoriesWithoutParent()) > 1; $is_more_than_one_root_category = count(Category::getCategoriesWithoutParent()) > 1;
if ((!Shop::isFeatureActive() && $is_more_than_one_root_category) || if (Shop::isFeatureActive() && $is_more_than_one_root_category && Shop::getContext() != Shop::CONTEXT_SHOP)
Shop::isFeatureActive() && $is_more_than_one_root_category && Shop::getContext() != Shop::CONTEXT_SHOP)
$category = Category::getTopCategory($id_lang); $category = Category::getTopCategory($id_lang);
else else
$category = new Category($shop->getCategory(), $id_lang); $category = new Category($shop->getCategory(), $id_lang);
@@ -797,7 +796,7 @@ class CategoryCore extends ObjectModel
)).')'; )).')';
$flag = Db::getInstance()->execute(' $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) VALUES '.implode(',', $row)
); );
return $flag; return $flag;
@@ -832,20 +831,15 @@ class CategoryCore extends ObjectModel
if (!Validate::isUnsignedId($id_category) || !Validate::isUnsignedId($id_lang)) if (!Validate::isUnsignedId($id_category) || !Validate::isUnsignedId($id_lang))
return false; return false;
if (isset(self::$_links[$id_category.'-'.$id_lang])) if (!isset(self::$_links[$id_category.'-'.$id_lang]))
return self::$_links[$id_category.'-'.$id_lang]; self::$_links[$id_category.'-'.$id_lang] = Db::getInstance()->getValue('
SELECT cl.`link_rewrite`
$result = Db::getInstance()->getRow(' FROM `'._DB_PREFIX_.'category_lang` cl
SELECT cl.`link_rewrite` WHERE `id_lang` = '.(int)$id_lang.'
FROM `'._DB_PREFIX_.'category_lang` cl '.Shop::addSqlRestrictionOnLang('cl').'
WHERE `id_lang` = '.(int)$id_lang.' AND cl.`id_category` = '.(int)$id_category
'.Shop::addSqlRestrictionOnLang('cl').' );
AND cl.`id_category` = '.(int)$id_category return self::$_links[$id_category.'-'.$id_lang];
);
self::$_links[$id_category.'-'.$id_lang] = $result['link_rewrite'];
return $result['link_rewrite'];
} }
public function getLink(Link $link = null) public function getLink(Link $link = null)
@@ -1396,8 +1390,7 @@ class CategoryCore extends ObjectModel
SELECT DISTINCT c.* SELECT DISTINCT c.*
FROM `'._DB_PREFIX_.'category` 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.') 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() public function isRootCategoryForAShop()
+43
View File
@@ -74,6 +74,16 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
* @var int Total of elements for iteration * @var int Total of elements for iteration
*/ */
protected $total; protected $total;
/**
* @var int Page number
*/
protected $page_number = 0;
/**
* @var int Size of a page
*/
protected $page_size = 0;
protected $fields = array(); protected $fields = array();
protected $alias = array(); protected $alias = array();
@@ -334,6 +344,11 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
break; break;
} }
} }
// 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 ? // Shall we display query for debug ?
if ($display_query) if ($display_query)
@@ -659,6 +674,34 @@ class CollectionCore implements Iterator, ArrayAccess, Countable
} }
return $this->fields[$field]; 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 * Generate uniq alias from association name
+9 -1
View File
@@ -102,7 +102,14 @@ class CombinationCore extends ObjectModel
// Removes the product from StockAvailable, for the current shop // Removes the product from StockAvailable, for the current shop
StockAvailable::removeProductFromStockAvailable((int)$this->id_product, (int)$this->id); 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()) if (!$this->hasMultishopEntries() && !$this->deleteAssociations())
return false; return false;
return true; 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('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('cart_product', '`id_product_attribute` = '.(int)$this->id);
$result &= Db::getInstance()->delete('product_attribute_image', '`id_product_attribute` = '.(int)$this->id);
return $result; return $result;
} }
+2 -2
View File
@@ -505,9 +505,9 @@ class ConfigurationCore extends ObjectModel
if ($id_shop) if ($id_shop)
return ' AND id_shop = '.(int)$id_shop; return ' AND id_shop = '.(int)$id_shop;
elseif ($id_shop_group) 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 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)';
} }
/** /**
-1
View File
@@ -49,7 +49,6 @@ class ConfigurationTestCore
'mysql_support' => false, 'mysql_support' => false,
'config_dir' => 'config', 'config_dir' => 'config',
'cache_dir' => 'cache', 'cache_dir' => 'cache',
'sitemap' => 'sitemap.xml',
'log_dir' => 'log', 'log_dir' => 'log',
'img_dir' => 'img', 'img_dir' => 'img',
'mails_dir' => 'mails', 'mails_dir' => 'mails',
+4
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 // 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))) if (!isset($cookie->id_connections) || !strstr(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '', Tools::getHttpHost(false, false)))
$id_page = Connection::setNewConnection($cookie); $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) if (!isset($id_page) || !$id_page)
$id_page = Page::getCurrentId(); $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')) if (!Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS'))
return array('id_page' => $id_page); return array('id_page' => $id_page);
+20 -15
View File
@@ -61,32 +61,37 @@ class ConnectionsSourceCore extends ObjectModel
$cookie = Context::getContext()->cookie; $cookie = Context::getContext()->cookie;
if (!isset($cookie->id_connections) || !Validate::isUnsignedId($cookie->id_connections)) if (!isset($cookie->id_connections) || !Validate::isUnsignedId($cookie->id_connections))
return false; 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')) if (!isset($_SERVER['HTTP_REFERER']) && !Configuration::get('TRACKING_DIRECT_TRAFFIC'))
return false; return false;
$source = new ConnectionsSource(); $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 = parse_url($_SERVER['HTTP_REFERER']);
$parsed_host = parse_url(Tools::getProtocol().Tools::getHttpHost(false, false).__PS_BASE_URI__); $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))) 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__)))
&& !strncmp($parsed['path'], $parsed_host['path'], strlen(__PS_BASE_URI__)))
return false; return false;
if (Validate::isAbsoluteUrl(strval($_SERVER['HTTP_REFERER'])))
{ $source->http_referer = substr($_SERVER['HTTP_REFERER'], 0, ConnectionsSource::$uri_max_size);
$source->http_referer = substr(strval($_SERVER['HTTP_REFERER']), 0, ConnectionsSource::$uri_max_size); $source->keywords = substr(trim(SearchEngine::getKeywords($_SERVER['HTTP_REFERER'])), 0, ConnectionsSource::$uri_max_size);
$source->keywords = trim(SearchEngine::getKeywords(strval($_SERVER['HTTP_REFERER'])));
if (!Validate::isMessage($source->keywords))
return false;
}
} }
$source->id_connections = (int)$cookie->id_connections; $source->id_connections = (int)$cookie->id_connections;
$source->request_uri = Tools::getHttpHost(false, false); $source->request_uri = Tools::getHttpHost(false, false);
if (isset($_SERVER['REDIRECT_URL']))
$source->request_uri .= strval($_SERVER['REDIRECT_URL']); if (isset($_SERVER['REQUEST_URI']))
elseif (isset($_SERVER['REQUEST_URI'])) $source->request_uri .= $_SERVER['REQUEST_URI'];
$source->request_uri .= strval($_SERVER['REQUEST_URI']); elseif (isset($_SERVER['REDIRECT_URL']))
$source->request_uri .= $_SERVER['REDIRECT_URL'];
if (!Validate::isUrl($source->request_uri)) if (!Validate::isUrl($source->request_uri))
$source->request_uri = ''; $source->request_uri = '';
$source->request_uri = substr($source->request_uri, 0, ConnectionsSource::$uri_max_size); $source->request_uri = substr($source->request_uri, 0, ConnectionsSource::$uri_max_size);
@@ -104,4 +109,4 @@ class ConnectionsSourceCore extends ObjectModel
WHERE id_order = '.(int)($id_order).' WHERE id_order = '.(int)($id_order).'
ORDER BY cos.date_add DESC'); ORDER BY cos.date_add DESC');
} }
} }

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