diff --git a/.gitignore b/.gitignore index c136b27fb..46dfd57d9 100644 --- a/.gitignore +++ b/.gitignore @@ -4,8 +4,18 @@ .settings .idea .svn +.DS_Store robots.txt sitemap.xml +cache/cachefs/* +!cache/cachefs/index.php +download/* +!download/index.php +upload/* +!upload/index.php +admin-dev/autoupgrade/* +admin-dev/backups/* +!admin-dev/backups/index.php cache/smarty/cache/* !cache/smarty/cache/index.php cache/smarty/compile/* @@ -15,6 +25,7 @@ cache/tcpdf/* !cache/tcpdf/index.php config/xml/*.xml config/settings.inc.php +config/settings.old.php log/*.log img/* !img/index.php @@ -25,4 +36,72 @@ tools/smarty*/compile/*.php !tools/smarty*/compile/index.php override/classes/*.php themes/default/cache/*.js -themes/default/cache/*.css \ No newline at end of file +themes/default/cache/*.css +themes/default/modules/*/*.php +!themes/default/modules/*/index.php +themes/default/lang/*.php +!themes/default/lang/index.php +modules/*/translations/*.php +!modules/*/translations/index.php +mails/* +!mails/en +modules/*/mails/* +!modules/*/mails/en +translations/* +!translations/*.gzip +modules/atos/* +modules/addshoppers +modules/alliedwallet +modules/authorizeaim +modules/autoupgrade +modules/avalaratax +modules/backwardcompatibility +modules/canadapost +modules/cloudcache +modules/ebay +modules/fedexcarrier +modules/fianetfraud +modules/fianetsceau +modules/fidbag +modules/firstdata +modules/gadwords +modules/gamification +modules/ganalytics +modules/gsitemap +modules/hipay +modules/iadvize +modules/itembase +modules/jirafe +modules/kiala +modules/kialasmall +modules/klarnaprestashop +modules/kwixo +modules/livezilla +modules/mailjet +modules/merchantware +modules/mobile_theme +modules/mondialrelay +modules/moneybookers +modules/nqgatewayneteven +modules/ogone +modules/pagseguro +modules/paypal +modules/payulatam +modules/prediggo +modules/prestafraud +modules/shipwire +modules/shoppingfeedexport +modules/shoppingfluxexport +modules/socolissimo +modules/stripejs +modules/themeinstallator +modules/tntcarrier +modules/treepodia +modules/trustedshops +modules/trustly +modules/twenga +modules/upscarrier +modules/uspscarrier +modules/wexpay +modules/yotpo +modules/zingaya \ No newline at end of file diff --git a/404.php b/404.php index 856c99e72..9fd4270f4 100644 --- a/404.php +++ b/404.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ -/* Send the proper status code in HTTP headers */ -header('HTTP/1.1 404 Not Found'); -header('Status: 404 Not Found'); - -if (in_array(substr($_SERVER['REQUEST_URI'], -3), array('png', 'jpg', 'gif'))) -{ - require_once(dirname(__FILE__).'/config/settings.inc.php'); - header('Location: '.__PS_BASE_URI__.'img/404.gif'); - exit; -} -elseif (in_array(substr($_SERVER['REQUEST_URI'], -3), array('.js', 'css'))) - die(''); - require_once(dirname(__FILE__).'/config/config.inc.php'); +Tools::displayFileAsDeprecated(); Controller::getController('PageNotFoundController')->run(); diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f9c682fca..29f1cdfdc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,5 +8,5 @@ All core files you commit in your pull request must have Open Software License ( All modules files you commit in your pull request must have Academic Free License (AFL 3.0) [1]: https://help.github.com/articles/using-pull-requests -[2]: http://docs.prestashop.com/display/PS15/Coding+Standard -[3]: http://docs.prestashop.com/display/PS15/Commit+norme \ No newline at end of file +[2]: http://docs.prestashop.com/display/PS15/Coding+Standards +[3]: http://docs.prestashop.com/display/PS15/How+to+write+a+commit+message diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index db8ff6095..06dcfe350 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -1,40 +1,80 @@ -CONTRIBUTORS -============ + - (d)oekia + - Alexander Otchenashev + - Benjamin PONGY + - Burhan + - Caleydon Media + - Damien Metzger + - DamienMetzger + - Damon Skelhorn + - Daniel + - David Gasperoni + - DrySs + - DrÿSs' + - François Gaillard + - Gabriel Schwardy + - Gregory Roussac + - Ha!*!*y + - Jonathan Danse + - Krystian Podemski + - Marco Cervellin + - Michel Courtade + - Milow + - Patanock + - Pierre + - PrestaEdit + - Raphaël Malié + - Rémi Gaillard + - Samy Rabih + - Sarah Lorenzini + - Shagshag + - Vincent Augagneur + - Xavier POITAU + - aFolletete + - aKorczak + - aNiassy + - adonis karavokyros + - anat + - bLeveque + - bMancone + - bumbu + - cmouleyre + - dMetzger + - dSevere + - djfm + - fBrignoli + - fSerny + - fram + - gBrunier + - gCharmes + - gPoulain + - gRoussac + - hAitmansour + - ivancasasempere + - jBreux + - jObregon + - jessylenne + - jmCollin + - kpodemski + - lBrieu + - lCherifi + - lLefevre + - mBertholino + - mDeflotte + - mMarinetti + - marcinsz101 + - montes + - nPellicari + - nezenmoins + - oleacorner + - rGaillard + - rMalie + - rMontagne + - root + - sLorenzini + - sThiebaut + - tDidierjean + - vAugagneur + - vChabot + - vKham + - vSchoener -- DamienMetzger -- François Gaillard -- Rémi Gaillard -- Vincent Augagneur -- aFolletete -- aKorczak -- aNiassy -- bLeveque -- bMancone -- dMetzger -- dSevere -- fBrignoli -- fSerny -- gBrunier -- gCharmes -- gPoulain -- hAitmansour -- jBreux -- jObregon -- jmCollin -- lBrieu -- lCherifi -- lLefevre -- mBertholino -- mDeflotte -- mMarinetti -- nPellicari -- rGaillard -- rMalie -- rMontagne -- sLorenzini -- sThiebaut -- tDidierjean -- vAugagneur -- vChabot -- vKham -- vSchoener \ No newline at end of file diff --git a/address.php b/address.php index 8d2a7ee75..4dbf1d223 100644 --- a/address.php +++ b/address.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=address'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/addresses.php b/addresses.php index 71a0007c2..cda46efcf 100644 --- a/addresses.php +++ b/addresses.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=addresses'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/admin-dev/ajax-tab.php b/admin-dev/ajax-tab.php index d3b865930..24c751f9d 100755 --- a/admin-dev/ajax-tab.php +++ b/admin-dev/ajax-tab.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ define('_PS_ADMIN_DIR_', getcwd()); -require(dirname(__FILE__).'/../config/config.inc.php'); -require(dirname(__FILE__).'/functions.php'); +require(_PS_ADMIN_DIR_.'/../config/config.inc.php'); +require(_PS_ADMIN_DIR_.'/functions.php'); // For retrocompatibility with "tab" parameter if (!isset($_GET['controller']) && isset($_GET['tab'])) diff --git a/admin-dev/ajax.php b/admin-dev/ajax.php index 01c35c7db..8f41e44cb 100644 --- a/admin-dev/ajax.php +++ b/admin-dev/ajax.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -27,7 +27,7 @@ define('_PS_ADMIN_DIR_', getcwd()); include(_PS_ADMIN_DIR_.'/../config/config.inc.php'); /* Getting cookie or logout */ -require_once(dirname(__FILE__).'/init.php'); +require_once(_PS_ADMIN_DIR_.'/init.php'); $context = Context::getContext(); @@ -171,110 +171,6 @@ if (Tools::isSubmit('updateElementEmployee') && Tools::getValue('updateElementEm die($notification->updateEmployeeLastElement(Tools::getValue('updateElementEmployeeType'))); } -if (Tools::isSubmit('syncImapMail')) -{ - if (!($url = Configuration::get('PS_SAV_IMAP_URL')) - || !($port = Configuration::get('PS_SAV_IMAP_PORT')) - || !($user = Configuration::get('PS_SAV_IMAP_USER')) - || !($password = Configuration::get('PS_SAV_IMAP_PWD'))) - die('{"hasError" : true, "errors" : ["Configuration is not correct"]}'); - - $conf = Configuration::getMultiple(array( - 'PS_SAV_IMAP_OPT_NORSH', 'PS_SAV_IMAP_OPT_SSL', - 'PS_SAV_IMAP_OPT_VALIDATE-CERT', 'PS_SAV_IMAP_OPT_NOVALIDATE-CERT', - 'PS_SAV_IMAP_OPT_TLS', 'PS_SAV_IMAP_OPT_NOTLS')); - - $conf_str = ''; - if ($conf['PS_SAV_IMAP_OPT_NORSH']) - $conf_str .= '/norsh'; - if ($conf['PS_SAV_IMAP_OPT_SSL']) - $conf_str .= '/ssl'; - if ($conf['PS_SAV_IMAP_OPT_VALIDATE-CERT']) - $conf_str .= '/validate-cert'; - if ($conf['PS_SAV_IMAP_OPT_NOVALIDATE-CERT']) - $conf_str .= '/novalidate-cert'; - if ($conf['PS_SAV_IMAP_OPT_TLS']) - $conf_str .= '/tls'; - if ($conf['PS_SAV_IMAP_OPT_NOTLS']) - $conf_str .= '/notls'; - - if (!function_exists('imap_open')) - die('{"hasError" : true, "errors" : ["imap is not installed on this server"]}'); - - $mbox = @imap_open('{'.$url.':'.$port.$conf_str.'}', $user, $password); - - //checks if there is no error when connecting imap server - $errors = imap_errors(); - $str_errors = ''; - $str_error_delete = ''; - if (sizeof($errors) && is_array($errors)) - { - var_dump($errors); - $str_errors = ''; - foreach($errors as $error) - $str_errors .= '"'.$error.'",'; - $str_errors = rtrim($str_errors, ',').''; - } - //checks if imap connexion is active - if (!$mbox) - die('{"hasError" : true, "errors" : ["Cannot connect to the mailbox"]}'); - - //Returns information about the current mailbox. Returns FALSE on failure. - $check = imap_check($mbox); - if (!$check) - die('{"hasError" : true, "errors" : ["Fail to get information about the current mailbox"]}'); - - if ($check->Nmsgs == 0) - die('{"hasError" : true, "errors" : ["NO message to sync"]}'); - - $result = imap_fetch_overview($mbox,"1:{$check->Nmsgs}",0); - foreach ($result as $overview) - { - //check if message exist in database - if (isset($overview->subject)) - $subject = $overview->subject; - else - $subject = ''; - - //Creating an md5 to check if message has been allready processed - $md5 = md5($overview->date.$overview->from.$subject.$overview->msgno); - $exist = Db::getInstance()->getValue( - 'SELECT `md5_header` - FROM `'._DB_PREFIX_.'customer_message_sync_imap` - WHERE `md5_header` = \''.pSQL($md5).'\''); - if ($exist) - { - if (Configuration::get('PS_SAV_IMAP_DELETE_MSG')) - if (!imap_delete($mbox, $overview->msgno)) - $str_error_delete = ', "Fail to delete message"'; - } - else - { - //check if subject has id_order - preg_match('/\#ct([0-9]*)/', $subject, $matches1); - preg_match('/\#tc([0-9-a-z-A-Z]*)/', $subject, $matches2); - - if (isset($matches1[1]) && isset($matches2[1])) - { - //check if order exist in database - $ct = new CustomerThread((int)$matches1[1]); - - if (Validate::isLoadedObject($ct) && $ct->token == $matches2[1]) - { - $cm = new CustomerMessage(); - $cm->id_customer_thread = $ct->id; - $cm->message = imap_fetchbody($mbox, $overview->msgno, 1); - $cm->add(); - } - } - Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'customer_message_sync_imap` (`md5_header`) VALUES (\''.pSQL($md5).'\')'); - } - } - imap_expunge($mbox); - imap_close($mbox); - die('{"hasError" : false, "errors" : ["'.$str_errors.$str_error_delete.'"]}'); -} - if (Tools::isSubmit('searchCategory')) { $q = Tools::getValue('q'); diff --git a/admin-dev/ajax_products_list.php b/admin-dev/ajax_products_list.php index f3c747e18..f14a9a8c8 100644 --- a/admin-dev/ajax_products_list.php +++ b/admin-dev/ajax_products_list.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -27,7 +27,7 @@ define('_PS_ADMIN_DIR_', getcwd()); include(_PS_ADMIN_DIR_.'/../config/config.inc.php'); /* Getting cookie or logout */ -require_once(dirname(__FILE__).'/init.php'); +require_once(_PS_ADMIN_DIR_.'/init.php'); $query = Tools::getValue('q', false); if (!$query OR $query == '' OR strlen($query) < 1) @@ -51,13 +51,16 @@ else // Excluding downloadable products from packs because download from pack is not supported $excludeVirtuals = (bool)Tools::getValue('excludeVirtuals', false); +$exclude_packs = (bool)Tools::getValue('exclude_packs', false); $sql = 'SELECT p.`id_product`, `reference`, pl.name FROM `'._DB_PREFIX_.'product` p LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (pl.id_product = p.id_product AND pl.id_lang = '.(int)Context::getContext()->language->id.Shop::addSqlRestrictionOnLang('pl').') WHERE (pl.name LIKE \'%'.pSQL($query).'%\' OR p.reference LIKE \'%'.pSQL($query).'%\')'. (!empty($excludeIds) ? ' AND p.id_product NOT IN ('.$excludeIds.') ' : ' '). - ($excludeVirtuals ? 'AND p.id_product NOT IN (SELECT pd.id_product FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : ''); + ($excludeVirtuals ? 'AND p.id_product NOT IN (SELECT pd.id_product FROM `'._DB_PREFIX_.'product_download` pd WHERE (pd.id_product = p.id_product))' : ''). + ($exclude_packs ? 'AND (p.cache_is_pack IS NULL OR p.cache_is_pack = 0)' : ''); + $items = Db::getInstance()->executeS($sql); if ($items) diff --git a/admin-dev/ajaxfilemanager/ajax_file_upload.php b/admin-dev/ajaxfilemanager/ajax_file_upload.php index 309490e06..b21a39c13 100755 --- a/admin-dev/ajaxfilemanager/ajax_file_upload.php +++ b/admin-dev/ajaxfilemanager/ajax_file_upload.php @@ -60,7 +60,7 @@ $tem[$k] = $v; } - $tem['path'] = backslashToSlash($path); + $tem['path'] = addslashes(backslashToSlash($path)); $tem['type'] = "file"; $tem['size'] = transformFileSize($tem['size']); $tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); @@ -73,7 +73,7 @@ $info .= sprintf(", %s:'%s'", $k, $v); } - $info .= sprintf(", url:'%s'", getFileUrl($path)); + $info .= sprintf(", url:'%s'", addslashes(getFileUrl($path))); $info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME); diff --git a/admin-dev/ajaxfilemanager/ajax_get_file_listing.php b/admin-dev/ajaxfilemanager/ajax_get_file_listing.php index 133486637..c72110344 100755 --- a/admin-dev/ajaxfilemanager/ajax_get_file_listing.php +++ b/admin-dev/ajaxfilemanager/ajax_get_file_listing.php @@ -99,9 +99,9 @@ { $v = transformFileSize($v); } - echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'"; + echo (($j++ > 1)?",":'') . "'" . addslashes($k) . "':'" . addslashes($v) . "'"; } - echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'"; + echo (($j++ > 1)?",":'') . "'url':'" . addslashes(getFileUrl($file['path'])) . "'"; echo "}\n"; } echo "};\n"; diff --git a/admin-dev/ajaxfilemanager/inc/class.file.php b/admin-dev/ajaxfilemanager/inc/class.file.php index 85512eb02..d35ff7a33 100755 --- a/admin-dev/ajaxfilemanager/inc/class.file.php +++ b/admin-dev/ajaxfilemanager/inc/class.file.php @@ -33,15 +33,15 @@ $this->fileInfo['atime'] = $this->fileStat[8]; $this->fileInfo['ctime'] = $this->fileStat[10]; $this->fileInfo['mtime'] = $this->fileStat[9]; - $this->fileInfo['path'] = $path; - $this->fileInfo['name'] = basename($path); + $this->fileInfo['path'] = addslashes($path); + $this->fileInfo['name'] = addslashes(basename($path)); $this->fileInfo['is_writable'] = $this->isWritable(); $this->fileInfo['is_readable'] = $this->isReadable(); }elseif(is_dir($this->filePath)) { $this->fileStat = @stat($path); - $this->fileInfo['name'] = basename($path); - $this->fileInfo['path'] = $path; + $this->fileInfo['name'] = addslashes(basename($path)); + $this->fileInfo['path'] = addslashes($path); $this->fileInfo['atime'] = $this->fileStat[8]; $this->fileInfo['ctime'] = $this->fileStat[10]; $this->fileInfo['mtime'] = $this->fileStat[9]; diff --git a/admin-dev/ajaxfilemanager/inc/index.php b/admin-dev/ajaxfilemanager/inc/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/inc/index.php +++ b/admin-dev/ajaxfilemanager/inc/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/index.php b/admin-dev/ajaxfilemanager/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/index.php +++ b/admin-dev/ajaxfilemanager/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/index.php b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/jscripts/edit_area/images/index.php +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/images/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/index.php b/admin-dev/ajaxfilemanager/jscripts/edit_area/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/jscripts/edit_area/index.php +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/index.php b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/index.php +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/index.php b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/index.php +++ b/admin-dev/ajaxfilemanager/jscripts/edit_area/reg_syntax/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/jscripts/index.php b/admin-dev/ajaxfilemanager/jscripts/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/jscripts/index.php +++ b/admin-dev/ajaxfilemanager/jscripts/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/langs/index.php b/admin-dev/ajaxfilemanager/langs/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/langs/index.php +++ b/admin-dev/ajaxfilemanager/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/session/index.php b/admin-dev/ajaxfilemanager/session/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/session/index.php +++ b/admin-dev/ajaxfilemanager/session/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/theme/default/css/index.php b/admin-dev/ajaxfilemanager/theme/default/css/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/theme/default/css/index.php +++ b/admin-dev/ajaxfilemanager/theme/default/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/theme/default/images/action/index.php b/admin-dev/ajaxfilemanager/theme/default/images/action/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/theme/default/images/action/index.php +++ b/admin-dev/ajaxfilemanager/theme/default/images/action/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/theme/default/images/big_icon/index.php b/admin-dev/ajaxfilemanager/theme/default/images/big_icon/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/theme/default/images/big_icon/index.php +++ b/admin-dev/ajaxfilemanager/theme/default/images/big_icon/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/theme/default/images/file_type/index.php b/admin-dev/ajaxfilemanager/theme/default/images/file_type/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/theme/default/images/file_type/index.php +++ b/admin-dev/ajaxfilemanager/theme/default/images/file_type/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/theme/default/images/index.php b/admin-dev/ajaxfilemanager/theme/default/images/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/theme/default/images/index.php +++ b/admin-dev/ajaxfilemanager/theme/default/images/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/theme/default/images/pagination/index.php b/admin-dev/ajaxfilemanager/theme/default/images/pagination/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/theme/default/images/pagination/index.php +++ b/admin-dev/ajaxfilemanager/theme/default/images/pagination/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/theme/default/images/standard/index.php b/admin-dev/ajaxfilemanager/theme/default/images/standard/index.php index ec45b2dfe..f42f03e4d 100644 --- a/admin-dev/ajaxfilemanager/theme/default/images/standard/index.php +++ b/admin-dev/ajaxfilemanager/theme/default/images/standard/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/theme/default/index.php b/admin-dev/ajaxfilemanager/theme/default/index.php index 7a626751d..319128b59 100644 --- a/admin-dev/ajaxfilemanager/theme/default/index.php +++ b/admin-dev/ajaxfilemanager/theme/default/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/ajaxfilemanager/theme/index.php b/admin-dev/ajaxfilemanager/theme/index.php index 7a626751d..319128b59 100644 --- a/admin-dev/ajaxfilemanager/theme/index.php +++ b/admin-dev/ajaxfilemanager/theme/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/autoupgrade/index.php b/admin-dev/autoupgrade/index.php index cadb1ea6e..5ca842ada 100644 --- a/admin-dev/autoupgrade/index.php +++ b/admin-dev/autoupgrade/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/backup.php b/admin-dev/backup.php index bf13d08ad..8a4f66fef 100644 --- a/admin-dev/backup.php +++ b/admin-dev/backup.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ define('_PS_ADMIN_DIR_', getcwd()); - include(_PS_ADMIN_DIR_.'/../config/config.inc.php'); if (!Context::getContext()->employee->isLoggedBack()) @@ -34,15 +33,15 @@ if (!Context::getContext()->employee->isLoggedBack()) $tabAccess = Profile::getProfileAccess(Context::getContext()->employee->id_profile, Tab::getIdFromClassName('AdminBackup')); if ($tabAccess['view'] !== '1') - die (Tools::displayError('You do not have permission to view here')); + die (Tools::displayError('You do not have permission to view this.')); $backupdir = realpath(_PS_ADMIN_DIR_ . '/backups/'); if ($backupdir === false) - die (Tools::displayError('Backups directory does not exist.')); + die (Tools::displayError('A "Backup" directory does not exist.')); if (!$backupfile = Tools::getValue('filename')) - die (Tools::displayError('No file specified')); + die (Tools::displayError('No file has been specified.')); // Check the realpath so we can validate the backup file is under the backup directory $backupfile = realpath($backupdir.'/'.$backupfile); @@ -59,7 +58,7 @@ else $fp = @fopen($backupfile, 'r'); if ($fp === false) - die (Tools::displayError('Unable to open backup file').' "'.addslashes($backupfile).'"'); + die (Tools::displayError('Unable to open backup file(s).').' "'.addslashes($backupfile).'"'); // Add the correct headers, this forces the file is saved header('Content-Type: '.$contentType); @@ -71,4 +70,4 @@ $ret = @fpassthru($fp); fclose($fp); if ($ret === false) - die (Tools::displayError('Unable to display backup file').' "'.addslashes($backupfile).'"'); \ No newline at end of file + die (Tools::displayError('Unable to display backup file(s).').' "'.addslashes($backupfile).'"'); \ No newline at end of file diff --git a/admin-dev/backups/index.php b/admin-dev/backups/index.php index 88e934d59..195fab225 100644 --- a/admin-dev/backups/index.php +++ b/admin-dev/backups/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/cron_currency_rates.php b/admin-dev/cron_currency_rates.php index 36015d7e5..2bf94de21 100644 --- a/admin-dev/cron_currency_rates.php +++ b/admin-dev/cron_currency_rates.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/displayImage.php b/admin-dev/displayImage.php index 17ac32918..f873fdb22 100644 --- a/admin-dev/displayImage.php +++ b/admin-dev/displayImage.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ -require_once(dirname(__FILE__).'/../config/config.inc.php'); -require_once(dirname(__FILE__).'/init.php'); +define('_PS_ADMIN_DIR_', getcwd()); +require_once(_PS_ADMIN_DIR_.'/../config/config.inc.php'); +require_once(_PS_ADMIN_DIR_.'/init.php'); if (isset($_GET['img']) AND Validate::isMd5($_GET['img']) AND isset($_GET['name']) AND Validate::isGenericName($_GET['name']) AND file_exists(_PS_UPLOAD_DIR_.$_GET['img'])) { diff --git a/admin-dev/drawer.php b/admin-dev/drawer.php index 6d6c78384..22baa705c 100644 --- a/admin-dev/drawer.php +++ b/admin-dev/drawer.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ define('_PS_ADMIN_DIR_', getcwd()); -include_once(dirname(__FILE__).'/../config/config.inc.php'); +include_once(_PS_ADMIN_DIR_.'/../config/config.inc.php'); $module = Tools::getValue('module'); $render = Tools::getValue('render'); @@ -37,7 +37,6 @@ $height = Tools::getValue('height'); $id_employee = Tools::getValue('id_employee'); $id_lang = Tools::getValue('id_lang'); - if (!isset($cookie->id_employee) || !$cookie->id_employee || $cookie->id_employee != $id_employee) die(Tools::displayError()); @@ -47,6 +46,51 @@ if (!Validate::isModuleName($module)) if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php')) die(Tools::displayError()); +$shop_id = ''; +Shop::setContext(Shop::CONTEXT_ALL); +if (Context::getContext()->cookie->shopContext) +{ + $split = explode('-', Context::getContext()->cookie->shopContext); + if (count($split) == 2) + { + if ($split[0] == 'g') + { + if (Context::getContext()->employee->hasAuthOnShopGroup($split[1])) + Shop::setContext(Shop::CONTEXT_GROUP, $split[1]); + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } + else if (Shop::getShop($split[1]) && Context::getContext()->employee->hasAuthOnShop($split[1])) + { + $shop_id = $split[1]; + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } +} + +// Check multishop context and set right context if need +if (Shop::getContext()) +{ + if (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::CONTEXT_SHOP) + Shop::setContext(Shop::CONTEXT_GROUP, Shop::getContextShopGroupID()); + if (Shop::getContext() == Shop::CONTEXT_GROUP && !Shop::CONTEXT_GROUP) + Shop::setContext(Shop::CONTEXT_ALL); +} + +// Replace existing shop if necessary +if (!$shop_id) + Context::getContext()->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT')); +elseif (Context::getContext()->shop->id != $shop_id) + Context::getContext()->shop = new Shop($shop_id); + require_once($module_path); $graph = new $module(); @@ -57,4 +101,3 @@ if ($option) $graph->create($render, $type, $width, $height, $layers); $graph->draw(); - diff --git a/admin-dev/export/index.php b/admin-dev/export/index.php index 88e934d59..195fab225 100644 --- a/admin-dev/export/index.php +++ b/admin-dev/export/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/footer.inc.php b/admin-dev/footer.inc.php index e41c93db3..de8dc6a14 100644 --- a/admin-dev/footer.inc.php +++ b/admin-dev/footer.inc.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -30,14 +30,14 @@ echo ' diff --git a/admin-dev/functions.php b/admin-dev/functions.php index a79749b62..314d2b867 100644 --- a/admin-dev/functions.php +++ b/admin-dev/functions.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ - require_once(dirname(__FILE__).'/../images.inc.php'); - function bindDatepicker($id, $time) { if ($time) @@ -96,6 +94,8 @@ function rewriteSettingsFile($baseUrls = NULL, $theme = NULL, $arrayDB = NULL) $defines['_DB_PASSWD_'] = (($arrayDB AND isset($arrayDB['_DB_PASSWD_'])) ? $arrayDB['_DB_PASSWD_'] : _DB_PASSWD_); $defines['_COOKIE_KEY_'] = addslashes(_COOKIE_KEY_); $defines['_COOKIE_IV_'] = addslashes(_COOKIE_IV_); + $defines['_PS_CREATION_DATE_'] = addslashes(_PS_CREATION_DATE_); + if (defined('_RIJNDAEL_KEY_')) $defines['_RIJNDAEL_KEY_'] = addslashes(_RIJNDAEL_KEY_); if (defined('_RIJNDAEL_IV_')) @@ -223,8 +223,16 @@ function checkPSVersion() return $upgrader->checkPSVersion(); } +/** + * Deprecated since > 1.5.4.1 + * Use Translate::getAdminTranslation($string) instead + * + * @param string $string + */ function translate($string) { + Tools::displayAsDeprecated(); + global $_LANGADM; if (!is_array($_LANGADM)) return str_replace('"', '"', $string); @@ -233,7 +241,6 @@ function translate($string) return str_replace('"', '"', stripslashes($str)); } - /** * Returns a new Tab object * @@ -252,7 +259,7 @@ function checkingTab($tab) { if (isset(AdminTab::$tabParenting[$tab])) Tools::redirectAdmin('?tab='.AdminTab::$tabParenting[$tab].'&token='.Tools::getAdminTokenLite(AdminTab::$tabParenting[$tab])); - echo sprintf(Tools::displayError('Page %s cannot be found.'),$tab); + echo sprintf(Tools::displayError('Page %s cannot be found..'),$tab); return false; } @@ -265,7 +272,7 @@ function checkingTab($tab) $adminObj = new $tab; if (!$adminObj->viewAccess() AND ($adminObj->table != 'employee' OR Context::getContext()->employee->id != Tools::getValue('id_employee') OR !Tools::isSubmit('updateemployee'))) { - $adminObj->_errors = array(Tools::displayError('Access denied')); + $adminObj->_errors = array(Tools::displayError('Access denied.')); echo $adminObj->displayErrors(); return false; } @@ -431,7 +438,7 @@ function runAdminTab($tab, $ajaxMode = false) $bread = ''; foreach ($tabs AS $key => $item) { - $bread .= ' >'; + $bread .= ' >'; if (count($tabs) - 1 > $key) $bread .= ''; @@ -461,7 +468,7 @@ function runAdminTab($tab, $ajaxMode = false) echo '
- '.translate('Back Office').' + '.Translate::getAdminTranslation('Back Office').' '.$bread.'
'; if (!$ajaxMode && Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && Context::getContext()->controller->multishop_context != Shop::CONTEXT_ALL) @@ -470,10 +477,10 @@ function runAdminTab($tab, $ajaxMode = false) if (Shop::getContext() == Shop::CONTEXT_GROUP) { $shop_group = new ShopGroup((int)Shop::getContextShopGroupID()); - printf(translate('You are configuring your store for group shop %s'), ''.$shop_group->name.''); + printf(Translate::getAdminTranslation('You are configuring your store for group shop %s'), ''.$shop_group->name.''); } elseif (Shop::getContext() == Shop::CONTEXT_SHOP) - printf(translate('You are configuring your store for shop %s'), ''.Context::getContext()->shop->name.''); + printf(Translate::getAdminTranslation('You are configuring your store for shop %s'), ''.Context::getContext()->shop->name.''); echo ''; } if (Validate::isLoadedObject($adminObj)) @@ -546,8 +553,8 @@ function runAdminTab($tab, $ajaxMode = false) // we can display the correct url - // die(Tools::jsonEncode(array(translate('Invalid security token'),$url))); - die(Tools::jsonEncode(translate('Invalid security token'))); + // die(Tools::jsonEncode(array(Translate::getAdminTranslation('Invalid security token'),$url))); + die(Tools::jsonEncode(Translate::getAdminTranslation('Invalid security token'))); } else { @@ -559,17 +566,17 @@ function runAdminTab($tab, $ajaxMode = false) if (false === strpos($url, '?token=') AND false === strpos($url, '&token=')) $url .= '&token='.$adminObj->token; - $message = translate('Invalid security token'); + $message = Translate::getAdminTranslation('Invalid security token'); echo ''.$message.'
'.$message.'
'; echo ' - + - + '; die; diff --git a/admin-dev/get-file-admin.php b/admin-dev/get-file-admin.php index bc9e28e82..39fcd8a85 100644 --- a/admin-dev/get-file-admin.php +++ b/admin-dev/get-file-admin.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ define('_PS_ADMIN_DIR_', getcwd()); -require(dirname(dirname(__FILE__)).'/config/config.inc.php'); +require(_PS_ADMIN_DIR_.'/../config/config.inc.php'); Controller::getController('GetFileController')->run(); \ No newline at end of file diff --git a/admin-dev/grider.php b/admin-dev/grider.php index 4fffad24a..a8506a94d 100644 --- a/admin-dev/grider.php +++ b/admin-dev/grider.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ define('_PS_ADMIN_DIR_', getcwd()); -include_once(dirname(__FILE__).'/../config/config.inc.php'); +include_once(_PS_ADMIN_DIR_.'/../config/config.inc.php'); $module = Tools::getValue('module'); $render = Tools::getValue('render'); @@ -50,6 +50,53 @@ if (!Validate::isModuleName($module)) if (!Tools::file_exists_cache($module_path = dirname(__FILE__).'/../modules/'.$module.'/'.$module.'.php')) die(Tools::displayError()); + +$shop_id = ''; +Shop::setContext(Shop::CONTEXT_ALL); +if (Context::getContext()->cookie->shopContext) +{ + $split = explode('-', Context::getContext()->cookie->shopContext); + if (count($split) == 2) + { + if ($split[0] == 'g') + { + if (Context::getContext()->employee->hasAuthOnShopGroup($split[1])) + Shop::setContext(Shop::CONTEXT_GROUP, $split[1]); + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } + else if (Shop::getShop($split[1]) && Context::getContext()->employee->hasAuthOnShop($split[1])) + { + $shop_id = $split[1]; + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + else + { + $shop_id = Context::getContext()->employee->getDefaultShopID(); + Shop::setContext(Shop::CONTEXT_SHOP, $shop_id); + } + } +} + +// Check multishop context and set right context if need +if (Shop::getContext()) +{ + if (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::CONTEXT_SHOP) + Shop::setContext(Shop::CONTEXT_GROUP, Shop::getContextShopGroupID()); + if (Shop::getContext() == Shop::CONTEXT_GROUP && !Shop::CONTEXT_GROUP) + Shop::setContext(Shop::CONTEXT_ALL); +} + +// Replace existing shop if necessary +if (!$shop_id) + Context::getContext()->shop = new Shop(Configuration::get('PS_SHOP_DEFAULT')); +elseif (Context::getContext()->shop->id != $shop_id) + Context::getContext()->shop = new Shop($shop_id); + + require_once($module_path); $grid = new $module(); diff --git a/admin-dev/header.inc.php b/admin-dev/header.inc.php index 0f92567d4..5ed525a84 100644 --- a/admin-dev/header.inc.php +++ b/admin-dev/header.inc.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -36,12 +36,12 @@ echo ' - + - + - PrestaShop™ - '.translate('Administration panel').' + PrestaShop™ - '.Translate::getAdminTranslation('Administration panel').' + +

+ {l s='Remove the logo'} +

+ {l s='Format:'} JPG, GIF, PNG. {l s='Filesize:'} {$max_image_size|string_format:"%.2f"} {l s='MB max.'} +
{l s='Current size:'} {l s='undefined'}. +

+ + + \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/carrier_wizard/summary.tpl b/admin-dev/themes/default/template/controllers/carrier_wizard/summary.tpl new file mode 100644 index 000000000..42cfd89af --- /dev/null +++ b/admin-dev/themes/default/template/controllers/carrier_wizard/summary.tpl @@ -0,0 +1,63 @@ +{* +* 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 +* @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 +*} + + + +
+ {l s='Carrier name:'} +
 
+
+
 
+
+
 
+
+
 
+
+ {l s='It will be displayed only for the following zones:'} +
    +
    +
     
    +
    + {l s='It will be displayed only for the following groups:'} +
      +
      +
       
      +
      + {l s='It will be displayed only for the following shops:'} +
        +
        +
        diff --git a/admin-dev/themes/default/template/controllers/carriers/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/carriers/helpers/form/form.tpl index 0f29b842c..964c2bd8e 100644 --- a/admin-dev/themes/default/template/controllers/carriers/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/carriers/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/carriers/helpers/form/index.php b/admin-dev/themes/default/template/controllers/carriers/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/carriers/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/carriers/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/carriers/helpers/index.php b/admin-dev/themes/default/template/controllers/carriers/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/carriers/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/carriers/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/carriers/helpers/list/list_content.tpl b/admin-dev/themes/default/template/controllers/carriers/helpers/list/list_content.tpl new file mode 100644 index 000000000..a106c0b2f --- /dev/null +++ b/admin-dev/themes/default/template/controllers/carriers/helpers/list/list_content.tpl @@ -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 +* @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"} + + {else} + > + {/if} + {/block} diff --git a/admin-dev/themes/default/template/controllers/carriers/index.php b/admin-dev/themes/default/template/controllers/carriers/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/carriers/index.php +++ b/admin-dev/themes/default/template/controllers/carriers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/cart_rules/actions.tpl b/admin-dev/themes/default/template/controllers/cart_rules/actions.tpl index 4ee1ec5ce..bce3cfe7a 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/actions.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/actions.tpl @@ -30,7 +30,7 @@
        - + getFieldValue($currentObject, 'reduction_product')|intval == 0}checked="checked"{/if} /> diff --git a/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl b/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl index 401630929..158c4d117 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/conditions.tpl @@ -2,17 +2,17 @@
        -

        {l s='Optional, the cart rule will be available for everyone if you leave this field blank.'}

        +

        {l s='Optional: The cart rule will be available to everyone if you leave this field blank.'}

        - {l s='from'} + {l s='From'} - {l s='to'} + {l s='To'} -

        {l s='Default period is one month.'}

        +

        {l s='The default period is one month.'}

        @@ -37,17 +37,17 @@ -

        {l s='You can choose a minimum amount for the cart either with or without the taxes, and with or without shipping.'}

        +

        {l s='You can choose a minimum amount for the cart either with or without the taxes and shipping.'}

        -

        {l s='The cart rule will be applied to the first X customers only.'}

        +

        {l s='The cart rule will be applied to the first "X" customers only.'}

        - +
        -

        {l s='A customer will only be able to use the cart rule X time(s).'}

        +

        {l s='A customer will only be able to use the cart rule "X" time(s).'}

        {if $countries.unselected|@count + $countries.selected|@count > 1}
        @@ -85,6 +85,7 @@ +

        {l s='This restriction applies to the country of delivery.'}

        {/if} {if $carriers.unselected|@count + $carriers.selected|@count > 1} @@ -97,7 +98,7 @@

        {l s='Unselected carriers'}



        {l s='Selected carriers'}



        {l s='Product selection'} diff --git a/admin-dev/themes/default/template/controllers/cart_rules/form.js b/admin-dev/themes/default/template/controllers/cart_rules/form.js index 5a426fb4e..82cc6c8af 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/form.js +++ b/admin-dev/themes/default/template/controllers/cart_rules/form.js @@ -1,5 +1,5 @@ /* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,13 +18,14 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ function addProductRuleGroup() { + $('#product_rule_group_table').show(); product_rule_groups_counter += 1; product_rule_counters[product_rule_groups_counter] = 0; @@ -84,6 +85,13 @@ function addCartRuleOption(item) function updateProductRuleShortDescription(item) { + /******* For IE: put a product in condition on cart rules *******/ + if(typeof String.prototype.trim !== 'function') { + String.prototype.trim = function() { + return this.replace(/^\s+|\s+$/g, ''); + } + } + var id1 = $(item).attr('id').replace('_add', '').replace('_remove', ''); var id2 = id1.replace('_select', ''); var length = $('#' + id1 + '_2 option').length; @@ -338,7 +346,8 @@ function searchProducts() $.ajax({ type: 'POST', - url: 'ajax-tab.php', + headers: { "cache-control": "no-cache" }, + url: 'ajax-tab.php' + '?rand=' + new Date().getTime(), async: true, dataType: 'json', data: { diff --git a/admin-dev/themes/default/template/controllers/cart_rules/form.tpl b/admin-dev/themes/default/template/controllers/cart_rules/form.tpl index b5827cb45..033ea8d0e 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/form.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/form.tpl @@ -20,17 +20,17 @@ {if $currentObject->id}{/if}
        -

        {l s='Cart rule information'}

        +

        {l s='Cart-rule information'}

        {include file='controllers/cart_rules/informations.tpl'}
        -

        {l s='Cart rule conditions'}

        +

        {l s='Cart-rule conditions'}

        {include file='controllers/cart_rules/conditions.tpl'}
        -

        {l s='Cart rule actions'}

        +

        {l s='Cart-rule actions'}

        {include file='controllers/cart_rules/actions.tpl'}
        diff --git a/admin-dev/themes/default/template/controllers/cart_rules/helpers/index.php b/admin-dev/themes/default/template/controllers/cart_rules/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/cart_rules/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/cart_rules/helpers/list/index.php b/admin-dev/themes/default/template/controllers/cart_rules/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/cart_rules/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/cart_rules/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/cart_rules/helpers/list/list_header.tpl index 29e706c33..396a824b6 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/cart_rules/index.php b/admin-dev/themes/default/template/controllers/cart_rules/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/index.php +++ b/admin-dev/themes/default/template/controllers/cart_rules/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/cart_rules/informations.tpl b/admin-dev/themes/default/template/controllers/cart_rules/informations.tpl index de1b93b60..ba957e11d 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/informations.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/informations.tpl @@ -11,12 +11,12 @@
        {/foreach} -

        {l s='Will be displayed in the cart summary as well as on the invoice.'}

        +

        {l s='This will be displayed in the cart summary, as well as on the invoice.'}

        -

        {l s='For you only, never displayed to the customer.'}

        +

        {l s='For your eyes only. This will never be displayed to the customer.'}

        @@ -24,6 +24,18 @@ {l s='(Click to generate random code)'}

        {l s='Caution! The rule will automatically be applied if you leave this field blank.'}

        + +
        +    + getFieldValue($currentObject, 'highlight')|intval}checked="checked"{/if} /> + +    + getFieldValue($currentObject, 'highlight')|intval}checked="checked"{/if} /> + +

        + {l s='If the voucher is not yet in the cart, it will be displayed in the cart summary.'} +

        +
           @@ -34,13 +46,13 @@

        {l s='Only applicable if the voucher value is greater than the cart total.'}
        - {l s='If you do not allow partial use, the voucher value will be lowered to the total order amount, but if you do, a new voucher will be created with the remainder.'} + {l s='If you do not allow partial use, the voucher value will be lowered to the total order amount. If you allow partial use, however, a new voucher will be created with the remainder.'}

        -

        {l s='Cart rules are applied to the cart by priority. A cart rule with priority of "1" will be processed before a cart rule with a priority of "2".'}

        +

        {l s='Cart rules are applied by priority. A cart rule with a priority of "1" will be processed before a cart rule with a priority of "2".'}

        diff --git a/admin-dev/themes/default/template/controllers/cart_rules/product_rule.tpl b/admin-dev/themes/default/template/controllers/cart_rules/product_rule.tpl index fbc351835..9c5d80438 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/product_rule.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/product_rule.tpl @@ -8,7 +8,7 @@ {* Everything is on a single line in order to avoid a empty space between the [ ] and the word *} - [{if $product_rule_type == 'products'}{l s='Products'}{elseif $product_rule_type == 'categories'}{l s='Categories'}{elseif $product_rule_type == 'manufacturers'}{l s='Manufacturers'}{elseif $product_rule_type == 'suppliers'}{l s='Suppliers'}{elseif $product_rule_type == 'attributes'}{l s='Attributes'}{/if}] + [{if $product_rule_type == 'products'}{l s='Products:'}{elseif $product_rule_type == 'categories'}{l s='Categories:'}{elseif $product_rule_type == 'manufacturers'}{l s='Manufacturers:'}{elseif $product_rule_type == 'suppliers'}{l s='Suppliers'}{elseif $product_rule_type == 'attributes'}{l s='Attributes'}{/if}] {l s='The product(s) are matching on of these'} diff --git a/admin-dev/themes/default/template/controllers/cart_rules/product_rule_group.tpl b/admin-dev/themes/default/template/controllers/cart_rules/product_rule_group.tpl index c7eec816d..8e9fad2dd 100644 --- a/admin-dev/themes/default/template/controllers/cart_rules/product_rule_group.tpl +++ b/admin-dev/themes/default/template/controllers/cart_rules/product_rule_group.tpl @@ -8,7 +8,7 @@ {l s='The cart must contain at least'} - {l s='product(s) matching the following rules:'} + {l s='Product(s) matching the following rules:'}
        {l s='Add'} @@ -16,10 +16,10 @@ diff --git a/admin-dev/themes/default/template/controllers/carts/helpers/index.php b/admin-dev/themes/default/template/controllers/carts/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/carts/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/carts/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/carts/helpers/view/index.php b/admin-dev/themes/default/template/controllers/carts/helpers/view/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/carts/helpers/view/index.php +++ b/admin-dev/themes/default/template/controllers/carts/helpers/view/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl index 0d15aa3a8..514dcaa75 100755 --- a/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/carts/helpers/view/view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -28,7 +28,7 @@ {block name="override_tpl"}
        -

        {if $customer->id}{$customer->firstname} {$customer->lastname}{else}{l s='Guest'}{/if} - {l s='Cart #'}{$cart->id|string_format:"%06d"}{l s='on'} {$cart->date_upd}

        +

        {if $customer->id}{$customer->firstname} {$customer->lastname}{else}{l s='Guest'}{/if} - {l s='Cart #'}{$cart->id|string_format:"%06d"}{l s='On'} {$cart->date_upd}


        -

        {l s='Products'}{l s='Cart summary'}

        +

        {l s='Products:'}{l s='Cart summary'}


        @@ -138,25 +138,25 @@ {/if} {/foreach} - + {if $total_discounts != 0} - + {/if} {if $total_wrapping > 0} - + {/if} {if $cart->getOrderTotal(true, Cart::ONLY_SHIPPING) > 0} - + {/if} @@ -181,7 +181,7 @@
        {l s='Total products:'}{l s='Total cost of products:'} {displayWtPriceWithCurrency price=$total_products currency=$currency}
        {l s='Total vouchers:'}{l s='Total value of vouchers:'} {displayWtPriceWithCurrency price=$total_discounts currency=$currency}
        {l s='Total gift-wrapping:'}{l s='Total cost of gift wrapping:'} {displayWtPriceWithCurrency price=$total_wrapping currency=$currency}
        {l s='Total shipping:'}{l s='Total cost of shipping:'} {displayWtPriceWithCurrency price=$total_shipping currency=$currency}
        {/if}
        - {l s='For this customer\'s group, prices are displayed as:'} {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC}{l s='tax excluded'}{else}{l s='tax included'}{/if} + {l s='For this particular customer group, prices are displayed as:'} {if $order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC}{l s='Tax excluded'}{else}{l s='Tax included'}{/if}
         
        diff --git a/admin-dev/themes/default/template/controllers/carts/index.php b/admin-dev/themes/default/template/controllers/carts/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/carts/index.php +++ b/admin-dev/themes/default/template/controllers/carts/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl index ee35a72d0..cfc2cf8df 100644 --- a/admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/categories/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -32,7 +32,7 @@ {$fields_value.image}

        {l s='File size'} {$fields_value.size}kb

        {if $shared_category} -

        {l s='If you delete this picture it\'s will be deleted for all shared shop'}

        +

        {l s='If you delete this picture, it will be deleted in all of your shared shops!'}

        {/if}
        diff --git a/admin-dev/themes/default/template/controllers/categories/helpers/form/index.php b/admin-dev/themes/default/template/controllers/categories/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/categories/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/categories/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/categories/helpers/index.php b/admin-dev/themes/default/template/controllers/categories/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/categories/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/categories/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/categories/helpers/list/index.php b/admin-dev/themes/default/template/controllers/categories/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/categories/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/categories/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/categories/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/categories/helpers/list/list_header.tpl index c2cc39d0f..bedd47b5f 100644 --- a/admin-dev/themes/default/template/controllers/categories/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/categories/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -33,9 +33,9 @@   {assign var=params_url value=""} {else} - {assign var=params_url value="&id_category={$category.id_category}&viewcategory"} + {assign var=params_url value="&id_category={$category.id_category|intval}&viewcategory"} {/if} - {if $key == 0} + {if $category.id_category == $categories_tree_current_id} {$category.name} {else} {$category.name} >  @@ -43,11 +43,11 @@ {/foreach}
        {if isset($delete_category) && $delete_category} -
        +

        {if $need_delete_mode} - {l s='Do you want to delete products too?'} + {l s='Do you want to delete the products too?'} {else} {l s='Deleting this category will remove products linked only within this category and no others. Are you sure you want to continue?'} {/if} @@ -56,15 +56,15 @@
        • - +
        • - +
        • - +
        {else} @@ -74,10 +74,10 @@ {if $key != 'deleteMode'} {if is_array($value)} {foreach $value as $val} - + {/foreach} {else} - + {/if} {/if} {/foreach} diff --git a/admin-dev/themes/default/template/controllers/categories/index.php b/admin-dev/themes/default/template/controllers/categories/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/categories/index.php +++ b/admin-dev/themes/default/template/controllers/categories/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/cms/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/cms/helpers/form/form.tpl index dca7b479c..225f3b30e 100644 --- a/admin-dev/themes/default/template/controllers/cms/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/cms/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,13 +18,26 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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="input"} + {if $input.name == "link_rewrite"} + + {$smarty.block.parent} + {else} + {$smarty.block.parent} + {/if} +{/block} {block name="script"} $(document).ready(function() { if (btn_submit.length > 0) diff --git a/admin-dev/themes/default/template/controllers/cms/helpers/form/index.php b/admin-dev/themes/default/template/controllers/cms/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/cms/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/cms/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/cms/helpers/index.php b/admin-dev/themes/default/template/controllers/cms/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/cms/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/cms/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/cms/index.php b/admin-dev/themes/default/template/controllers/cms/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/cms/index.php +++ b/admin-dev/themes/default/template/controllers/cms/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/cms_categories/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/cms_categories/helpers/form/form.tpl index 6c5c3de00..a61506b6d 100644 --- a/admin-dev/themes/default/template/controllers/cms_categories/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/cms_categories/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,13 +18,26 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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="input"} + {if $input.name == "link_rewrite"} + + {$smarty.block.parent} + {else} + {$smarty.block.parent} + {/if} +{/block} {block name="input"} {if $input.type == 'select_category'} + {l s='Email'}

        @@ -74,9 +74,9 @@ {l s='ID'} {l s='Date'} - {l s='Products'} + {l s='Products:'} {l s='Total paid'} - {l s='Payment'} + {l s='Payment: '} {l s='State'} {l s='Actions'} @@ -106,7 +106,7 @@ {/if} {if $products && count($products)}
        -

        {l s='Products'}

        +

        {l s='Products:'}

        diff --git a/admin-dev/themes/default/template/controllers/customer_threads/index.php b/admin-dev/themes/default/template/controllers/customer_threads/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/customer_threads/index.php +++ b/admin-dev/themes/default/template/controllers/customer_threads/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/customer_threads/message.tpl b/admin-dev/themes/default/template/controllers/customer_threads/message.tpl index 8a8355493..533d12610 100644 --- a/admin-dev/themes/default/template/controllers/customer_threads/message.tpl +++ b/admin-dev/themes/default/template/controllers/customer_threads/message.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -49,7 +49,7 @@
        {l s='Customer ID:'}
        - {$message.id_customer} {l s='view'} + {$message.id_customer} {l s='View'}
        @@ -73,7 +73,7 @@
        {l s='File attachment'}
        - {l s='view'} + {l s='View'}
        @@ -83,7 +83,7 @@
        {l s='Order #'}
        - {$message.id_order} {l s='view'} + {$message.id_order} {l s='View'}
        {/if} @@ -92,7 +92,7 @@
        {l s='Product #'}
        - {$message.id_product} {l s='view'} + {$message.id_product} {l s='View'}
        {/if} @@ -163,7 +163,7 @@ {/if} -
        {l s='Date'}
        - - - - - - {foreach $messages AS $message} +
        +

        {l s='Messages'} ({count($messages)})

        + {if count($messages)} +
        {l s='Status'}{l s='Message'}{l s='Sent on'}
        - - - + + + - {/foreach} -
        {$message['status']} - - {$message['message']}... - - {$message['date_add']}{l s='Status'}{l s='Message'}{l s='Sent on'}
        -
         
        - {else} - {l s='%1$s %2$s has never contacted you' sprintf=[$customer->firstname, $customer->lastname]} - {/if} + {foreach $messages AS $message} + + {$message['status']} + + + {$message['message']}... + + + {$message['date_add']} + + {/foreach} + +
         
        + {else} + {l s='%1$s %2$s has never contacted you' sprintf=[$customer->firstname, $customer->lastname]} + {/if} +
        + +
        +
        {l s='Vouchers'} ({count($discounts)}) + {if count($discounts)} + + + + + + + + + {foreach $discounts AS $key => $discount} + + + + + + + + {/foreach} +
        {l s='ID'}{l s='Code'}{l s='Name'}{l s='Status'}{l s='Actions'}
        {$discount['id_cart_rule']}{$discount['code']}{$discount['name']}{l s='Status'} + + +
        + {else} + {l s='%1$s %2$s has no discount vouchers' sprintf=[$customer->firstname, $customer->lastname]}. + {/if} +
        +
        {* display hook specified to this page : AdminCustomers *}
        {hook h="displayAdminCustomers" id_customer=$customer->id}
         
        -

        - {l s='Groups'} ({count($groups)}) - - - -

        - {if $groups AND count($groups)} - - - - - - - - - - - - {foreach $groups AS $key => $group} - - - - - - {/foreach} -
        {l s='ID'}{l s='Name'}{l s='Actions'}
        {$group['id_group']}{$group['name']}
        - {/if} -
         
        - - +

        {l s='Orders'} ({count($orders)})

        {if $orders AND count($orders)} {assign var=count_ok value=count($orders_ok)} {if $count_ok}
        -

        +

        {l s='Valid orders:'} {$count_ok} {l s='for'} {$total_ok}

        @@ -202,18 +206,18 @@ - + - - + + {foreach $orders_ok AS $key => $order} - - - - + + + + @@ -225,7 +229,6 @@ {assign var=count_ko value=count($orders_ko)} {if $count_ko}
        -

        {l s='Invalid orders:'} {$count_ko}

        {l s='ID'} {l s='Date'}{l s='Payment'}{l s='Payment: '} {l s='State'}{l s='Products'}{l s='Total spent'}{l s='Products'}{l s='Total spent'} {l s='Actions'}
        {$order['id_order']}{$order['date_add']}{$order['payment']}{$order['order_state']}{$order['id_order']}{$order['date_add']}{$order['payment']}{$order['order_state']} {$order['nb_products']} {$order['total_paid_real']}
        @@ -237,36 +240,73 @@ - - - - - - + + + + + + {foreach $orders_ko AS $key => $order} - - - - - + + + + + {/foreach}
        {l s='ID'}{l s='Date'}{l s='Payment'}{l s='State'}{l s='Products'}{l s='Total spent'}{l s='ID'}{l s='Date'}{l s='Payment: '}{l s='State'}{l s='Products'}{l s='Total spent'} {l s='Actions'}
        {$order['id_order']}{$order['date_add']}{$order['payment']}{$order['order_state']}{$order['nb_products']}{$order['id_order']}{$order['date_add']}{$order['payment']}{$order['order_state']}{$order['nb_products']} {$order['total_paid_real']}
        +

        {l s='Invalid orders:'} {$count_ko}

        -
         
        {/if} {else} {l s='%1$s %2$s has not placed any orders yet' sprintf=[$customer->firstname, $customer->lastname]} {/if} +
        +
        +
        +

        {l s='Carts'} ({count($carts)})

        + {if $carts AND count($carts)} + + + + + + + + + + + + + + + + {foreach $carts AS $key => $cart} + + + + + + + + {/foreach} +
        {l s='ID'}{l s='Date'}{l s='Carrier'}{l s='Total'}{l s='Actions'}
        {$cart['id_cart']}{$cart['date_add']}{$cart['name']}{$cart['total_price']}
        + {else} + {l s='No cart is available'}. + {/if} +
        +
        + +
         
        {if $products AND count($products)}
         
        -

        {l s='Products'} ({count($products)})

        +

        {l s='Products:'} ({count($products)})

        @@ -291,116 +331,90 @@
        {/if}
         
        - -

        {l s='Addresses'} ({count($addresses)})

        - {if count($addresses)} - - - - - - - - - - - - - - - - - - {foreach $addresses AS $key => $address} - - - - - - - - - {/foreach} -
        {l s='Company'}{l s='Name'}{l s='Address'}{l s='Country'}{l s='Phone number(s)'}{l s='Actions'}
        {if $address['company']}{$address['company']}{else}--{/if}{$address['firstname']} {$address['lastname']}{$address['address1']} {if $address['address2']}{$address['address2']}{/if} {$address['postcode']} {$address['city']}{$address['country']} - {if $address['phone']} - {$address['phone']} - {if $address['phone_mobile']}
        {$address['phone_mobile']}{/if} - {else} - {if $address['phone_mobile']}
        {$address['phone_mobile']}{else}--{/if} - {/if} -
        - - -
        - {else} - {l s='%1$s %2$s has not registered any addresses yet' sprintf=[$customer->firstname, $customer->lastname]} - {/if} - -
         
        -

        {l s='Vouchers'} ({count($discounts)})

        - {if count($discounts)} - - - - - - - - - {foreach $discounts AS $key => $discount} - - - - - - - - {/foreach} -
        {l s='ID'}{l s='Code'}{l s='Name'}{l s='Status'}{l s='Actions'}
        {$discount['id_cart_rule']}{$discount['code']}{$discount['name']}{l s='Status'} - - -
        - {else} - {l s='%1$s %2$s has no discount vouchers' sprintf=[$customer->firstname, $customer->lastname]}. - {/if} -
         
        - -
        -

        {l s='Carts'} ({count($carts)})

        - {if $carts AND count($carts)} - - - - - - - - + +
        +

        {l s='Addresses'} ({count($addresses)})

        + {if count($addresses)} +
        + + + + + + + + - - - - + + + + + - {foreach $carts AS $key => $cart} - - - - - - + {foreach $addresses AS $key => $address} + + + + + + + {/foreach}
        {l s='ID'}{l s='Date'}{l s='Carrier'}{l s='Total'}{l s='Company'}{l s='Name'}{l s='Address'}{l s='Country'}{l s='Phone number(s)'} {l s='Actions'}
        {$cart['id_cart']}{$cart['date_add']}{$cart['name']}{$cart['total_price']}
        {if $address['company']}{$address['company']}{else}--{/if}{$address['firstname']} {$address['lastname']}{$address['address1']} {if $address['address2']}{$address['address2']}{/if} {$address['postcode']} {$address['city']}{$address['country']} + {if $address['phone']} + {$address['phone']} + {if $address['phone_mobile']}
        {$address['phone_mobile']}{/if} + {else} + {if $address['phone_mobile']}
        {$address['phone_mobile']}{else}--{/if} + {/if} +
        + + +
        {else} - {l s='No cart available'}. + {l s='%1$s %2$s has not registered any addresses yet' sprintf=[$customer->firstname, $customer->lastname]} {/if}
        - + +
        +
        +

        + {l s='Groups'} ({count($groups)}) + + + +

        + {if $groups AND count($groups)} + + + + + + + + + + + + {foreach $groups AS $key => $group} + + + + + + {/foreach} +
        {l s='ID'}{l s='Name'}{l s='Actions'}
        {$group['id_group']}{$group['name']}
        + {/if} +
        +
        + +
         
        + {if count($interested)}
        -

        {l s='Products'} ({count($interested)})

        +

        {l s='Products:'} ({count($interested)})

        @@ -417,9 +431,9 @@
        {/if} - +
         
        - +
        {* Last connections *} {if count($connections)}

        {l s='Last connections'}

        @@ -432,42 +446,46 @@ - {l s='Date'} - {l s='Pages viewed'} - {l s='Total time'} - {l s='Origin'} - {l s='IP Address'} + {l s='Date'} + {l s='Pages viewed'} + {l s='Total time'} + {l s='Origin'} + {l s='IP Address'} {foreach $connections as $connection} - {$connection['date_add']} - {$connection['pages']} - {$connection['time']} - {$connection['http_referer']} - {$connection['ipaddress']} + {$connection['date_add']} + {$connection['pages']} + {$connection['time']} + {$connection['http_referer']} + {$connection['ipaddress']} {/foreach}
         
        {/if} - - {if count($referrers)} -

        {l s='Referrers'}

        - - - - - {if $shop_is_feature_active}{/if} - - {foreach $referrers as $referrer} - - - - {if $shop_is_feature_active}{/if} - - {/foreach} -
        {l s='Date'}{l s='Name'}{l s='Shop'}
        {$referrer['date_add']}{$referrer['name']}{$referrer['shop_name']}
        - {/if} +
        +
        +
        + {if count($referrers)} +

        {l s='Referrers'}

        + + + + + {if $shop_is_feature_active}{/if} + + {foreach $referrers as $referrer} + + + + {if $shop_is_feature_active}{/if} + + {/foreach} +
        {l s='Date'}{l s='Name'}{l s='Shop'}
        {$referrer['date_add']}{$referrer['name']}{$referrer['shop_name']}
        + {/if} +
        +
        {/block}
        -
         
        +
         
        \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/customers/index.php b/admin-dev/themes/default/template/controllers/customers/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/customers/index.php +++ b/admin-dev/themes/default/template/controllers/customers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/emails/content.tpl b/admin-dev/themes/default/template/controllers/emails/content.tpl index 8931488e6..7ae001ff5 100644 --- a/admin-dev/themes/default/template/controllers/emails/content.tpl +++ b/admin-dev/themes/default/template/controllers/emails/content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,18 +18,18 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *}
        {l s='Add a category discount'} @@ -182,10 +180,10 @@
        -

        {l s='Take part in the e-commerce adventure with PrestaShop, the fast, powerful, and customizable e-commerce solution. With more than 275 features, PrestaShop will help you create a world of opportunities without limits. Discover the solution that already powers more than 120,000 active stores worldwide!'}

        +

        {l s='Take part in the e-commerce adventure with PrestaShop, the best open-source shopping-cart solution on the planet. With more than 310 native features, PrestaShop comes fully equipped to help create a world of opportunity without limits. '}

        diff --git a/admin-dev/themes/default/template/controllers/home/index.php b/admin-dev/themes/default/template/controllers/home/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/home/index.php +++ b/admin-dev/themes/default/template/controllers/home/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/home/optimizationTips.tpl b/admin-dev/themes/default/template/controllers/home/optimizationTips.tpl index 9ddfca027..8f0853532 100644 --- a/admin-dev/themes/default/template/controllers/home/optimizationTips.tpl +++ b/admin-dev/themes/default/template/controllers/home/optimizationTips.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/images/content.tpl b/admin-dev/themes/default/template/controllers/images/content.tpl index 0ec1f0a2e..2e8e0ea65 100644 --- a/admin-dev/themes/default/template/controllers/images/content.tpl +++ b/admin-dev/themes/default/template/controllers/images/content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -30,14 +30,14 @@ {l s='Regenerates thumbnails for all existing images'}

        - {l s='Please be patient, this can take several minutes'}
        + {l s='Please be patient. This can take several minutes.'}
        {l s='Be careful! Manually uploaded thumbnails will be erased and replaced by automatically generated thumbnails.'}
        {l s='Regenerate thumbnails'}
        - +
        @@ -76,23 +76,23 @@ {/if} -{if isset($display_move)} +{if isset($display_move) && $display_move}

        {l s='Move images'}

        - {l s='PrestaShop now uses a new storage system for product images. It offers better performance if your shop has a very large number of products.'}
        + {l s='PrestaShop now uses a new storage system for product images. It offers better performance if your shop has a large number of products.'}

        {if $safe_mode}
        - {l s='PrestaShop has detected that your server configuration is not compatible with the new storage system (directive "safe_mode" is activated). You should continue to use the existing system.'} + {l s='PrestaShop has detected that your server configuration is not compatible with the new storage system (directive "safe_mode" is activated). You should therefore continue to use the existing system.'}
        {else}
        {l s='Move images'}
        - {l s='You can choose to keep your images stored in the previous system - there is nothing wrong with that.'}
        - {l s='You can also decide to move your images to the new storage system: in this case, click on the "Move images" button below. Please be patient, this can take several minutes.'} + {l s='You can choose to keep your images stored in the previous system. There\'s nothing wrong with that.'}
        + {l s='You can also decide to move your images to the new storage system. In this case, click on the "Move images" button below. Please be patient. This can take several minutes.'}

          - {l s='After moving all your product images, for best performance, set the "Use the legacy image filesystem" option above to "No".'} + {l s='After moving all of your product images, set the "Use the legacy image filesystem" option above to "No" for best performance.'}
        diff --git a/admin-dev/themes/default/template/controllers/images/index.php b/admin-dev/themes/default/template/controllers/images/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/images/index.php +++ b/admin-dev/themes/default/template/controllers/images/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl index 7b36488f9..059ccfdd2 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/import/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -50,14 +50,14 @@ console.log(truncateAuthorized); if (truncateAuthorized) { - if (!confirm('{l s='Are you sure you want to delete' js=1}' + ' ' + $.trim($('#entity > option:selected').text().toLowerCase()) + '{l s='?' js=1}')) + if (!confirm('{l s='Are you sure that you would like to delete this' js=1}' + ' ' + $.trim($('#entity > option:selected').text().toLowerCase()) + '?')) { e.preventDefault(); } } else { - jAlert('{l s='You do not have permission to delete here. When the multi-store is enable, only a SuperAdmin can delete all items before 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; } } @@ -95,25 +95,6 @@

        -
         
        - -
         
        @@ -130,7 +111,7 @@ class="clear">
        - {l s='Import'} + {l s='Import '}
        @@ -144,8 +125,24 @@   Uplaod{l s='Upload'}
        - - + +
        - +
        - {l s='If you don\'t use this option, all IDs will be auto-incremented.'} + {l s='If you don\'t use this option, all ID\'s will be auto-incremented.'}
        - {if empty($files_to_import)}{l s='You must upload a file for go to the next step.'}{/if} + {if empty($files_to_import)}{l s='You must upload a file in order to proceed to the next step'}{/if}

        {l s='Note that the category import does not support categories of the same name.'}

        {l s='Note that you can have several products with the same reference.'}

        {if !count($files_to_import)}
        -

        {l s='There is no CSV file available, please upload one using the \'Upload\' button above.'}

        +

        {l s='There is no CSV file available. Please upload one using the \'Upload\' button above.'}

        @@ -225,7 +222,7 @@
        -

        {l s='*Required field'} +

        {l s='* Required field'}
        diff --git a/admin-dev/themes/default/template/controllers/import/helpers/form/index.php b/admin-dev/themes/default/template/controllers/import/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/import/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/import/helpers/index.php b/admin-dev/themes/default/template/controllers/import/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/import/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/import/helpers/view/index.php b/admin-dev/themes/default/template/controllers/import/helpers/view/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/view/index.php +++ b/admin-dev/themes/default/template/controllers/import/helpers/view/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl index 173e4108c..12a8f5850 100644 --- a/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/import/helpers/view/view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -33,7 +33,7 @@

        {l s='View your data'}

        - {l s='Save and load your matching configuration'} :

        + {l s='Save and load your configuration for importing files'} :

        {l s='Save'}

        diff --git a/admin-dev/themes/default/template/controllers/import/index.php b/admin-dev/themes/default/template/controllers/import/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/import/index.php +++ b/admin-dev/themes/default/template/controllers/import/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/index.php b/admin-dev/themes/default/template/controllers/index.php index 192f88787..67d9932bf 100644 --- a/admin-dev/themes/default/template/controllers/index.php +++ b/admin-dev/themes/default/template/controllers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/information/helpers/index.php b/admin-dev/themes/default/template/controllers/information/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/information/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/information/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/information/helpers/view/index.php b/admin-dev/themes/default/template/controllers/information/helpers/view/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/information/helpers/view/index.php +++ b/admin-dev/themes/default/template/controllers/information/helpers/view/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/information/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/information/helpers/view/view.tpl index da9d5daf8..d11e4721c 100644 --- a/admin-dev/themes/default/template/controllers/information/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/information/helpers/view/view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -32,7 +32,7 @@ { $.ajax({ type: 'GET', - url: '{$link->getAdminLink('AdminInformation')}', + url: '{$link->getAdminLink('AdminInformation')|addslashes}', data: { 'action': 'checkFiles', 'ajax': 1 @@ -46,7 +46,7 @@ }; if (json.missing.length || json.updated.length) - $('#changedFiles').html('
        {l s='Changed/missing files have been detected'}
        '); + $('#changedFiles').html('
        {l s='Changed/missing files have been detected.'}
        '); else $('#changedFiles').html('
        {l s='No change has been detected in your files'}
        '); @@ -70,12 +70,12 @@
        - {l s='Configuration Information'} + {l s='Configuration information'}

        {l s='This information must be provided when you report an issue on our bug tracker or forum.'}


        - {l s='Information about your configuration'} + {l s='Information about your configuration.'}

        {l s='Server information'}

        {if count($uname)}

        @@ -113,7 +113,7 @@


        {l s='Store information'}

        - {l s='Prestashop version'}: {$shop.ps|escape:'htmlall':'UTF-8'} + {l s='PrestaShop version'}: {$shop.ps|escape:'htmlall':'UTF-8'}

        {l s='Shop URL'}: {$shop.url|escape:'htmlall':'UTF-8'} @@ -127,7 +127,7 @@ {l s='Mail method'}: {if $mail} - {l s='You are using the PHP mail() function.'}

        + {l s='You are using the PHP mail function.'}

        {else} {l s='You are using your own SMTP parameters.'}

        diff --git a/admin-dev/themes/default/template/controllers/information/index.php b/admin-dev/themes/default/template/controllers/information/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/information/index.php +++ b/admin-dev/themes/default/template/controllers/information/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/invoices/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/invoices/helpers/form/form.tpl index 873130cd4..e1ba3492b 100644 --- a/admin-dev/themes/default/template/controllers/invoices/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/invoices/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/invoices/helpers/form/index.php b/admin-dev/themes/default/template/controllers/invoices/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/invoices/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/invoices/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/invoices/helpers/index.php b/admin-dev/themes/default/template/controllers/invoices/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/invoices/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/invoices/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/invoices/index.php b/admin-dev/themes/default/template/controllers/invoices/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/invoices/index.php +++ b/admin-dev/themes/default/template/controllers/invoices/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/languages/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/languages/helpers/form/form.tpl index e29a421e8..d8b551b02 100644 --- a/admin-dev/themes/default/template/controllers/languages/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/languages/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -36,10 +36,10 @@ {/block} {block name=script} - var langPackOk = "\"\" {l s='A language pack is available for this ISO (name is'}"; - var langPackVersion = "{l s='The compatible Prestashop version for this language and your system is:'}"; - var langPackInfo = "{l s='After creating the language, you can import the content of the language pack, which you can download above under "Localization - Translations"'}"; - var noLangPack = "\"\" {l s='No language pack available on prestashop.com for this ISO code'}"; + var langPackOk = "\"\" {l s='A language pack is available for this ISO.'}"; + var langPackVersion = "{l s='The Prestashop version compatible with this language and your system is:'}"; + var langPackInfo = "{l s='After creating the language, you can import the content of the language pack, which you can download under "Localization -- Translations."'}"; + var noLangPack = "\"\" {l s='No language pack is available on prestashop.com for this ISO code'}"; var download = "{l s='Download'}"; $(document).ready(function() { @@ -62,7 +62,7 @@ {if isset($field.image)}{$field.title}{/if} {$field.title} -

        {l s='This language is NOT complete and cannot be used in the Front or Back Office because some files are missing.'}

        +

        {l s='This language pack is NOT complete and cannot be used in the Front or Back Office because some files are missing.'}


        {elseif $key == 'list_files'} {foreach $field as $list} diff --git a/admin-dev/themes/default/template/controllers/languages/helpers/form/index.php b/admin-dev/themes/default/template/controllers/languages/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/languages/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/languages/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/languages/helpers/index.php b/admin-dev/themes/default/template/controllers/languages/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/languages/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/languages/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/languages/index.php b/admin-dev/themes/default/template/controllers/languages/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/languages/index.php +++ b/admin-dev/themes/default/template/controllers/languages/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/localization/content.tpl b/admin-dev/themes/default/template/controllers/localization/content.tpl index f8abc659f..3fefc850d 100644 --- a/admin-dev/themes/default/template/controllers/localization/content.tpl +++ b/admin-dev/themes/default/template/controllers/localization/content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,11 +18,15 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} -{$localization_form} +
        + {$localization_form} +

        -{$localization_options} \ No newline at end of file +
        + {$localization_options} +
        \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/localization/index.php b/admin-dev/themes/default/template/controllers/localization/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/localization/index.php +++ b/admin-dev/themes/default/template/controllers/localization/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/login/content.tpl b/admin-dev/themes/default/template/controllers/login/content.tpl index c945e3981..047f6bf5f 100755 --- a/admin-dev/themes/default/template/controllers/login/content.tpl +++ b/admin-dev/themes/default/template/controllers/login/content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,95 +18,83 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} - - -
        -
        - {if isset($errors)} -

        {if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}

        -
          - {foreach from=$errors item="error"} -
        1. {$error}
        2. - {/foreach} -
        - {/if} -
        -
        - {if isset($warningSslMessage)} -
        - {$warningSslMessage} -
        - {/if} -
        -

        {$shop_name}

        - {if !isset($wrong_folder_name)} -
        -
        - - -
        - -
        - - -
        - -
        - - -

        - -

        - -

        - {l s='Lost password?'} -

        -
        -
        - -
        - -
        -

        {l s='Forgot your password?'}

        -

        {l s='Please enter the e-mail address you provided during the registration process in order to receive your access code by e-mail'}

        - -
        - - -
        - -
        - - -

        - -

        - -

        - -

        -
        -
        -
        - {else} -
        -

        {l s='For security reasons, you cannot connect to the Back Office until after you have:'}

        -
          -
        • {l s='deleted the /install folder'}
        • -
        • {l s='renamed the /admin folder (e.g. /admin123%d)' sprintf=$randomNb}
        • -
        -

        {l s='Please then access this page by the new URL (e.g. http://www.yoursite.com/admin123%d)' sprintf=$randomNb}

        -
        - {/if} -
        -

        © 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.

        -
        + +
        +
        +{if isset($errors)} +

        {if $nbErrors > 1}{l s='There are %d errors.' sprintf=$nbErrors}{else}{l s='There is %d error.' sprintf=$nbErrors}{/if}

        +
          + {foreach from=$errors item="error"} +
        1. {$error}
        2. + {/foreach} +
        +{/if} +
        +
        +{if isset($warningSslMessage)} +
        {$warningSslMessage}
        +{/if} +
        +

        {$shop_name}

        +{if !isset($wrong_folder_name) && !isset($wrong_install_name)} +
        +
        + + +
        +
        + + +
        +
        + +

        + +

        +

        + {l s='Lost password?'} +

        +
        +
        + +
        +
        +

        {l s='Forgot your password?'}

        +

        {l s='In order to receive your access code by email, please enter the address you provided during the registration process.'}

        +
        + + +
        +
        + +

        + +

        +

        + +

        +
        +
        +
        +{else} +
        +

        {l s='For security reasons, you cannot connect to the Back Office until after you have:'}

        +
          + {if isset($wrong_install_name) && $wrong_install_name == true}
        • {l s='deleted the /install folder'}
        • {/if} + {if isset($wrong_folder_name) && $wrong_folder_name == true}
        • {l s='renamed the /admin folder (e.g. %s)' sprintf=$randomNb}
        • {/if} +
        +

        {l s='Please then access this page by the new URL (e.g. %s)' sprintf=$adminUrl}

        +
        +{/if} +
        +

        © 2005 - {$smarty.now|date_format:"%Y"} Copyright by PrestaShop. all rights reserved.

        +
        \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/login/index.php b/admin-dev/themes/default/template/controllers/login/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/login/index.php +++ b/admin-dev/themes/default/template/controllers/login/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/logs/helpers/index.php b/admin-dev/themes/default/template/controllers/logs/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/logs/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/logs/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/logs/helpers/list/index.php b/admin-dev/themes/default/template/controllers/logs/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/logs/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/logs/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/logs/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/logs/helpers/list/list_header.tpl index b380c5844..2886a900c 100644 --- a/admin-dev/themes/default/template/controllers/logs/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/logs/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -34,7 +34,7 @@
      • {l s='Informative only'}
      • {l s='Warning'}
      • {l s='Error'}
      • -
      • {l s='Major issue (crash)'}
      • +
      • {l s='Major issue (crash)!'}

      • diff --git a/admin-dev/themes/default/template/controllers/logs/index.php b/admin-dev/themes/default/template/controllers/logs/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/logs/index.php +++ b/admin-dev/themes/default/template/controllers/logs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/maintenance/helpers/index.php b/admin-dev/themes/default/template/controllers/maintenance/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/maintenance/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/maintenance/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/maintenance/helpers/options/index.php b/admin-dev/themes/default/template/controllers/maintenance/helpers/options/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/maintenance/helpers/options/index.php +++ b/admin-dev/themes/default/template/controllers/maintenance/helpers/options/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/maintenance/helpers/options/options.tpl b/admin-dev/themes/default/template/controllers/maintenance/helpers/options/options.tpl index 7ea689a25..2e1505738 100644 --- a/admin-dev/themes/default/template/controllers/maintenance/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/controllers/maintenance/helpers/options/options.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/maintenance/index.php b/admin-dev/themes/default/template/controllers/maintenance/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/maintenance/index.php +++ b/admin-dev/themes/default/template/controllers/maintenance/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/manufacturers/helpers/index.php b/admin-dev/themes/default/template/controllers/manufacturers/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/manufacturers/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/manufacturers/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/index.php b/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/index.php +++ b/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/view.tpl index 6fb27f342..5c57c58ad 100644 --- a/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/manufacturers/helpers/view/view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -29,16 +29,16 @@

        {$manufacturer->name}

        -

        {l s='Total addresses:'} {count($addresses)}

        +

        {l s='Total addresses'} {count($addresses)}


        {if !count($addresses)} - {l s='No address for this manufacturer'} + {l s='No address has been found for this manufacturer.'} {else} {foreach $addresses AS $addresse} - + + @@ -27,6 +26,7 @@ + @@ -40,6 +40,22 @@ + + + \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/modules/tab_modules_list.tpl b/admin-dev/themes/default/template/controllers/modules/tab_modules_list.tpl new file mode 100644 index 000000000..a4945a592 --- /dev/null +++ b/admin-dev/themes/default/template/controllers/modules/tab_modules_list.tpl @@ -0,0 +1,86 @@ +{* +* 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 +* @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 +*} + +{if isset($tab_modules_list) && !empty($tab_modules_list)} + + +
        + {if count($tab_modules_list.installed)} +
        {$addresse.firstname} {$addresse.lastname}{$addresse.firstname} {$addresse.lastname}
        @@ -60,7 +60,7 @@ {/foreach} {/if} -

        {l s='Total products:'} {count($products)}

        +

        {l s='Total products'} {count($products)}

        {foreach $products AS $product}
        {if !$product->hasAttributes()} diff --git a/admin-dev/themes/default/template/controllers/manufacturers/index.php b/admin-dev/themes/default/template/controllers/manufacturers/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/manufacturers/index.php +++ b/admin-dev/themes/default/template/controllers/manufacturers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/marketing/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/marketing/helpers/view/view.tpl new file mode 100644 index 000000000..b84d55b1e --- /dev/null +++ b/admin-dev/themes/default/template/controllers/marketing/helpers/view/view.tpl @@ -0,0 +1,5 @@ +{if $show_toolbar} + {include file="toolbar.tpl" toolbar_btn=$toolbar_btn toolbar_scroll=$toolbar_scroll title=$title} +{/if} + +{$modules_list} \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/meta/helpers/index.php b/admin-dev/themes/default/template/controllers/meta/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/meta/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/meta/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/meta/helpers/options/index.php b/admin-dev/themes/default/template/controllers/meta/helpers/options/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/meta/helpers/options/index.php +++ b/admin-dev/themes/default/template/controllers/meta/helpers/options/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/meta/helpers/options/options.tpl b/admin-dev/themes/default/template/controllers/meta/helpers/options/options.tpl index 07f87c6d1..1b5fa94e3 100644 --- a/admin-dev/themes/default/template/controllers/meta/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/controllers/meta/helpers/options/options.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -33,7 +33,7 @@ {if !$field['mod_rewrite']} - {l s='URL rewriting (mod_rewrite) is not active on your server or it is not possible to check your server configuration. If you want to use Friendly URLs you must activate this mod.'} + {l s='URL rewriting (mod_rewrite) is not active on your server, or it is not possible to check your server configuration. If you want to use Friendly URLs, you must activate this mod.'}
        {/if} {else} diff --git a/admin-dev/themes/default/template/controllers/meta/index.php b/admin-dev/themes/default/template/controllers/meta/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/meta/index.php +++ b/admin-dev/themes/default/template/controllers/meta/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/modules/content.tpl b/admin-dev/themes/default/template/controllers/modules/content.tpl index a60f596ae..58546be45 100644 --- a/admin-dev/themes/default/template/controllers/modules/content.tpl +++ b/admin-dev/themes/default/template/controllers/modules/content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,12 +18,11 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} - {if isset($module_content)} {$module_content} {else} diff --git a/admin-dev/themes/default/template/controllers/modules/favorites.tpl b/admin-dev/themes/default/template/controllers/modules/favorites.tpl index ae9eec7b9..13efe0e73 100755 --- a/admin-dev/themes/default/template/controllers/modules/favorites.tpl +++ b/admin-dev/themes/default/template/controllers/modules/favorites.tpl @@ -1,12 +1,10 @@
        - {include file='controllers/modules/header.tpl'} -
        @@ -16,6 +14,7 @@
        {l s='Module Name'} {l s='Description'} {l s='Status'}{l s='Tab'} {l s='Categories'} {l s='Interest'} {l s='Favorite'}{$module->displayName} {$module->description|truncate:80:'...'} {if isset($module->id) && $module->id gt 0}{l s='Installed'}{else}{l s='Not Installed'}{/if} + {assign var="module_name" value=$module->name} + + {$module->categoryName} +
        - - {/if} - {/if} +
         
        {/if} - - -
        -
        - - -
        + + +
        +
        + + +
        +
        +
        + - - -
        - - - -   - -   - -   - - -
        - -
        - - -
        - - - -
        - + +   + +   + +   + +
        +
        + + +
        + +
        + diff --git a/admin-dev/themes/default/template/controllers/modules/header.tpl b/admin-dev/themes/default/template/controllers/modules/header.tpl index 971cdb035..9d290bf06 100644 --- a/admin-dev/themes/default/template/controllers/modules/header.tpl +++ b/admin-dev/themes/default/template/controllers/modules/header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,38 +18,34 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} -
        -
        - - - - -
        -

        Module : {l s='List of modules'}

        -
        - +
        +
        + +
        +

        Module : {l s='List of modules'}

        +
        {if $add_permission eq '1'}
        {l s='Add a new module'} {l s='Add a new module'} -

        {l s='The module must be either a zip file or a tarball.'}

        +

        {l s='The module must either be a zip file or a tarball.'}

        diff --git a/admin-dev/themes/default/template/controllers/modules/index.php b/admin-dev/themes/default/template/controllers/modules/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/modules/index.php +++ b/admin-dev/themes/default/template/controllers/modules/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/modules/js.tpl b/admin-dev/themes/default/template/controllers/modules/js.tpl index 73e463c13..d920b668b 100644 --- a/admin-dev/themes/default/template/controllers/modules/js.tpl +++ b/admin-dev/themes/default/template/controllers/modules/js.tpl @@ -1,369 +1,367 @@ -{* -* 2007-2012 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 -* @copyright 2007-2012 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} - - - - - - + \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/modules/list.tpl b/admin-dev/themes/default/template/controllers/modules/list.tpl index 63e60a2b4..7dd84356f 100644 --- a/admin-dev/themes/default/template/controllers/modules/list.tpl +++ b/admin-dev/themes/default/template/controllers/modules/list.tpl @@ -1,116 +1,126 @@ -{* -* 2007-2012 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 -* @copyright 2007-2012 PrestaShop SA -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} - - {if count($modules)} - - - - - - - - - - - - - - - - {foreach from=$modules item=module} - - - - - - - {/foreach} - -
        -
        -
        {l s='Module name'}
        confirmUninstall) OR empty($module->confirmUninstall)}rel="false"{else}rel="{$module->confirmUninstall|addslashes}"{/if} class="noborder"> -
        -

        {$module->displayName} - {if isset($module->type) && $module->type == 'addonsMustHave'} - {l s='Must Have'} - {else} - {if isset($module->id) && $module->id gt 0} - {l s='Installed'} - {else} - {l s='Not installed'} - {/if} - {/if} -

        - -

        {if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else} {/if}

        - {if isset($module->message)}
        {$module->message}
        {/if} -
        - {if !isset($module->not_on_disk)}{$module->optionsHtml}{else} {/if} -
        -
        -
        - -
        - -
        - - -
        - {else} -

        {l s='No modules available in this section.'}

        - {/if} - +{* +* 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 +* @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 +*} + +{if count($modules)} + + + + + + + + + + {foreach from=$modules item=module} + + + + + + + {/foreach} + +
        +
        +
        {l s='Module name'}
        + {if (isset($module->id) && $module->id > 0) || !isset($module->type) || $module->type != 'addonsMustHave'} + confirmUninstall) OR empty($module->confirmUninstall)}rel="false"{else}rel="{$module->confirmUninstall|addslashes}"{/if} + class="noborder"> + {/if} + +
        +

        {$module->displayName} + {if isset($module->type) && $module->type == 'addonsMustHave'} + {l s='Must Have'} + {else} + {if isset($module->id) && $module->id gt 0} + {l s='Installed'} + {else} + {l s='Not installed'} + {/if} + {/if} +

        + +

        {if isset($module->description) && $module->description ne ''}{l s='Description'} : {$module->description}{else} {/if}

        + {if isset($module->message) && (!isset($module->type) || ($module->type != 'addonsMustHave' || $module->type !== 'addonsNative'))}
        {$module->message}
        {/if} +
        + {if !isset($module->not_on_disk)} + {$module->optionsHtml} + {if isset($module->preferences) && $module->preferences['favorite'] == 1} + {l s='Remove from Favorites'} + + {else} + + {l s='Mark as Favorite'} + {/if} + {else} +   + {/if} +
        +
        +
        + +
        + +
        + + +
        +{else} +

        {l s='No modules available in this section.'}

        +{/if} diff --git a/admin-dev/themes/default/template/controllers/modules/page.tpl b/admin-dev/themes/default/template/controllers/modules/page.tpl index 888ef4c26..00e197055 100644 --- a/admin-dev/themes/default/template/controllers/modules/page.tpl +++ b/admin-dev/themes/default/template/controllers/modules/page.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,20 +18,27 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *}
        - {include file='controllers/modules/header.tpl'} {include file='controllers/modules/filters.tpl'} - + {if $upgrade_available|@count} +
        + {l s='An upgrade is available for some of your modules!'} + +
        + {/if}
        @@ -51,17 +58,15 @@ {foreach from=$list_modules_categories item=module_category key=module_category_key} {/foreach}
        -
        {include file='controllers/modules/list.tpl'}
        -
        diff --git a/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl new file mode 100644 index 000000000..044183bf6 --- /dev/null +++ b/admin-dev/themes/default/template/controllers/modules/tab_module_line.tpl @@ -0,0 +1,77 @@ +{* +* 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 +* @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 +*} + +
        + + + + + + +
        + + +
        +

        + {$module->displayName|truncate:36:'…'} {$module->version} + {if isset($module->id) && $module->id gt 0 } + {if $module->active} + {l s='Enabled'} + {else} + {l s='Disabled'} + {/if} + {else} + {if isset($module->type) && $module->type == 'addonsMustHave'} + {l s='Must Have'} + {else} + {l s='Not installed'} + {/if} + + {/if} +

        +

        + {if isset($module->description) && $module->description ne ''} + {$module->description|truncate:86:'…'} + {else} +   + {/if} +

        +
        +
        + {if isset($module->type) && $module->type == 'addonsMustHave'} + +   {displayPrice price=$module->price currency=$module->id_currency} + {else if !isset($module->not_on_disk)} + {$module->optionsHtml} +
         
        + {l s='Submit'} + {else} + {l s='Install'} + {/if} +
        +
        + {foreach from=$tab_modules_list.installed item=module} + {include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}} + {/foreach} +
        + {/if} + {if count($tab_modules_list.not_installed)} + + {foreach from=$tab_modules_list.not_installed item=module} + {include file='controllers/modules/tab_module_line.tpl' class_row={cycle values=",rowalt"}} + {/foreach} + + {/if} +
        +{/if} +

        {l s='More options'}

        \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/modules_positions/form.tpl b/admin-dev/themes/default/template/controllers/modules_positions/form.tpl index d5b356883..ebd8d9dbc 100644 --- a/admin-dev/themes/default/template/controllers/modules_positions/form.tpl +++ b/admin-dev/themes/default/template/controllers/modules_positions/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -44,7 +44,7 @@
        *
        @@ -88,8 +88,8 @@ {$value} {/foreach} {/if} - {l s='Please specify the files for which you do not want the module to be displayed'}.
        - {l s='Please type each filename separated by a comma'}. + {l s='Please specify the files for which you do not want the module to be displayed.'}.
        + {l s='Please input each filename, separated by a comma.'}.

        diff --git a/admin-dev/themes/default/template/controllers/modules_positions/index.php b/admin-dev/themes/default/template/controllers/modules_positions/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/modules_positions/index.php +++ b/admin-dev/themes/default/template/controllers/modules_positions/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl b/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl index a23a751a8..623e83dde 100644 --- a/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl +++ b/admin-dev/themes/default/template/controllers/modules_positions/list_modules.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -65,7 +65,7 @@
        {if !$can_move} -
        {l s='If you want to order/move the following data, please select a shop from the shop list'}
        +
        {l s='If you want to order/move the following data, please select a shop from the shop list.'}
        {/if} {foreach $hooks as $hook} @@ -79,7 +79,7 @@ {if $hook['module_count'] && $can_move} - {/if}{$hook['title']} - {$hook['module_count']} {if $hook['module_count'] > 1}{l s='modules'}{else}{l s='module'}{/if} + {/if}{$hook['title']} - {$hook['module_count']} {if $hook['module_count'] > 1}{l s='Modules'}{else}{l s='Module'}{/if} {if !empty($hook['description'])}  [{$hook['description']}] @@ -121,7 +121,7 @@ {/if} {/foreach} {else} - {l s='No module for this hook'} + {l s='No module was found for this hook.'} {/if} {/foreach} diff --git a/admin-dev/themes/default/template/controllers/not_found/content.tpl b/admin-dev/themes/default/template/controllers/not_found/content.tpl index f2df6da4c..cd836c0ea 100644 --- a/admin-dev/themes/default/template/controllers/not_found/content.tpl +++ b/admin-dev/themes/default/template/controllers/not_found/content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,12 +18,14 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} +{if isset($controller) && !empty($controller) && $controller != 'adminnotfound'}

        {l s='The controller %s is missing or invalid.' sprintf=$controller}

        +{/if}
        diff --git a/admin-dev/themes/default/template/controllers/not_found/index.php b/admin-dev/themes/default/template/controllers/not_found/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/not_found/index.php +++ b/admin-dev/themes/default/template/controllers/not_found/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/order_preferences/helpers/index.php b/admin-dev/themes/default/template/controllers/order_preferences/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/order_preferences/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/order_preferences/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/order_preferences/helpers/options/index.php b/admin-dev/themes/default/template/controllers/order_preferences/helpers/options/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/order_preferences/helpers/options/index.php +++ b/admin-dev/themes/default/template/controllers/order_preferences/helpers/options/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/order_preferences/helpers/options/options.tpl b/admin-dev/themes/default/template/controllers/order_preferences/helpers/options/options.tpl index 04b7f7c69..e990347fb 100644 --- a/admin-dev/themes/default/template/controllers/order_preferences/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/controllers/order_preferences/helpers/options/options.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/order_preferences/index.php b/admin-dev/themes/default/template/controllers/order_preferences/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/order_preferences/index.php +++ b/admin-dev/themes/default/template/controllers/order_preferences/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl b/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl index 61cf4e531..7e5b10b7e 100755 --- a/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl +++ b/admin-dev/themes/default/template/controllers/orders/_customized_data.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,26 +18,27 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} -{if $product.customizedDatas} - - - {if isset($product.image) && $product.image->id}{$product.image_tag}{else}--{/if} +{if $product['customizedDatas']} + + + + {if isset($product['image']) && $product['image']->id|intval}{$product['image_tag']}{else}--{/if} - - {$product['product_name']} - {l s='customized'}
        +
        + {$product['product_name']} - {l s='Customized'}
        {if ($product['product_reference'])}{l s='Ref:'} {$product['product_reference']}
        {/if} {if ($product['product_supplier_reference'])}{l s='Ref Supplier:'} {$product['product_supplier_reference']}{/if}
        - {displayPrice price=$product['product_price_wt'] currency=$currency->id} + {displayPrice price=$product['product_price_wt'] currency=$currency->id|intval} {if $can_edit} @@ -45,36 +46,41 @@ {$product['customizationQuantityTotal']} {if ($order->hasBeenPaid())}{$product['customizationQuantityRefunded']}{/if} - {if ($order->hasBeenDelivered())}{$product['customizationQuantityReturned']}{/if} - - + {if ($order->hasBeenDelivered() || $order->hasProductReturned())}{$product['customizationQuantityReturned']}{/if} + {if $stock_management} - {/if} {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} - {displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id} + {displayPrice price=Tools::ps_round($product['product_price'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval} {else} - {displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id} + {displayPrice price=Tools::ps_round($product['product_price_wt'] * $product['customizationQuantityTotal'], 2) currency=$currency->id|intval} {/if} + +   +   - - {l s='Edit'} - - - {l s='Delete'} - + {if ($can_edit && !$order->hasBeenDelivered())} + + {l s='Edit'} + + + {l s='Delete'} + + {/if} - {foreach $product.customizedDatas as $customizationPerAddress} + {foreach $product['customizedDatas'] as $customizationPerAddress} {foreach $customizationPerAddress as $customizationId => $customization} - - + + {foreach $customization.datas as $type => $datas} {if ($type == Product::CUSTOMIZE_FILE)}
          {foreach from=$datas item=data}
        • {if $data['name']}{$data['name']}{else}{l s='Picture #'}{$data@iteration}{/if}{l s=':'}  - +
        • {/foreach}
        @@ -90,10 +96,10 @@ - - {$customization['quantity']} + {$customization['quantity']} {if $can_edit} {/if} @@ -104,36 +110,38 @@ {if ($order->getTaxCalculationMethod() == $smarty.const.PS_TAX_EXC)} - {displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id} + {displayPrice price=Tools::ps_round($product['product_price'] * $customization['quantity'], 2) currency=$currency->id|intval} {else} - {displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id} + {displayPrice price=Tools::ps_round($product['product_price_wt'] * $customization['quantity'], 2) currency=$currency->id|intval} {/if} - - + + {if ((!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN')) AND (int)($customization['quantity_returned']) < (int)($customization['quantity']))} - = $product['product_quantity'])}disabled="disabled" {/if}/> + = $product['product_quantity'])}disabled="disabled" {/if}/> {else} -- {/if} {if ($customization['quantity_returned'] + $customization['quantity_refunded'] >= $customization['quantity'])} - + {elseif (!$order->hasBeenDelivered() OR Configuration::get('PS_ORDER_RETURN'))} - 0/{$customization['quantity']-$customization['quantity_refunded']} + 0/{$customization['quantity']-$customization['quantity_refunded']} {/if} -
        {l s='Quantity:'}
        +
        {l s='Quantity:'}
        0/{$customization['quantity']-$customization['quantity_refunded']}
        -
        {l s='Amount:'}
        {$currency->prefix}{$currency->suffix}
        - - +
        {l s='Amount:'}
        {$currency->prefix}{$currency->suffix}
        + {if ($can_edit && !$order->hasBeenDelivered())} + + + {/if} {/foreach} {/foreach} diff --git a/admin-dev/themes/default/template/controllers/orders/_discount_form.tpl b/admin-dev/themes/default/template/controllers/orders/_discount_form.tpl index b68240298..dc71b2c44 100644 --- a/admin-dev/themes/default/template/controllers/orders/_discount_form.tpl +++ b/admin-dev/themes/default/template/controllers/orders/_discount_form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -49,7 +49,7 @@ {/if} %
        @@ -64,7 +64,7 @@

        - {l s='If you select to create this discount for all invoices, one discount will be created per order invoice.'} + {l s='If you chooses to create this discount for all invoices, only one discount will be created per order invoice.'}

        {/if} diff --git a/admin-dev/themes/default/template/controllers/orders/_documents.tpl b/admin-dev/themes/default/template/controllers/orders/_documents.tpl index b1ca81630..47671da59 100644 --- a/admin-dev/themes/default/template/controllers/orders/_documents.tpl +++ b/admin-dev/themes/default/template/controllers/orders/_documents.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -68,12 +68,12 @@ {/if} {if get_class($document) eq 'OrderInvoice'} {if isset($document->is_delivery)} - #{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->delivery_number} + #{Configuration::get('PS_DELIVERY_PREFIX', $current_id_lang, null, $order->id_shop)}{'%06d'|sprintf:$document->delivery_number} {else} - {$document->getInvoiceNumberFormatted($current_id_lang)} + {$document->getInvoiceNumberFormatted($current_id_lang, $order->id_shop)} {/if} {elseif get_class($document) eq 'OrderSlip'} - {l s='#%d' sprintf=$document->id} + #{Configuration::get('PS_CREDIT_SLIP_PREFIX', $current_id_lang)}{'%06d'|sprintf:$document->id} {/if} {l s='See the document'} {if get_class($document) eq 'OrderInvoice'} @@ -110,7 +110,7 @@ {if !isset($document->is_delivery)} - +

        @@ -128,9 +128,9 @@ {foreachelse} -

        {l s='No document is available'}

        +

        {l s='No documents are available'}

        {if isset($invoice_management_active) && $invoice_management_active} -

        {l s='Generate invoice'}

        +

        {l s='Generate invoice'}

        {/if} diff --git a/admin-dev/themes/default/template/controllers/orders/_new_product.tpl b/admin-dev/themes/default/template/controllers/orders/_new_product.tpl index 7da1b4d27..44027fb81 100644 --- a/admin-dev/themes/default/template/controllers/orders/_new_product.tpl +++ b/admin-dev/themes/default/template/controllers/orders/_new_product.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -27,10 +27,10 @@ {l s='Product:'} @@ -64,14 +64,14 @@

        {l s='New invoice information'}

        - +
        {$carrier->name}
        -

        {l s='If you don\'t select "Free shipping," the normal shipping cost will be applied'}

        +

        {l s='If you don\'t select "Free shipping," the normal shipping cost will be applied.'}

        diff --git a/admin-dev/themes/default/template/controllers/orders/_print_pdf_icon.tpl b/admin-dev/themes/default/template/controllers/orders/_print_pdf_icon.tpl index 42a7c6a60..f88070aa3 100644 --- a/admin-dev/themes/default/template/controllers/orders/_print_pdf_icon.tpl +++ b/admin-dev/themes/default/template/controllers/orders/_print_pdf_icon.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/orders/_product_line.tpl b/admin-dev/themes/default/template/controllers/orders/_product_line.tpl index c22b4b15f..f16827cc4 100755 --- a/admin-dev/themes/default/template/controllers/orders/_product_line.tpl +++ b/admin-dev/themes/default/template/controllers/orders/_product_line.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -49,7 +49,7 @@ {/if} - {$product['product_quantity']} + {$product['product_quantity']} {if $can_edit}
        - diff --git a/admin-dev/themes/default/template/controllers/shop/content.tpl b/admin-dev/themes/default/template/controllers/shop/content.tpl index 0ad7cb462..5027ddf26 100644 --- a/admin-dev/themes/default/template/controllers/shop/content.tpl +++ b/admin-dev/themes/default/template/controllers/shop/content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl index bfba5f161..abda912fd 100644 --- a/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/shop/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -119,10 +119,16 @@ {/foreach} $(document).ready(function() { $('input[name=useImportData]').click(function() { - if ($(this).attr('id') == 'useImportData_on') - $('#shop_list, #data_list').slideDown('slow'); - else - $('#shop_list, #data_list').slideUp('slow'); + if ($(this).attr('id') == 'useImportData_on') + { + $('input[name^="importData["]').prop('checked', true); + $('#shop_list, #data_list').slideDown('slow'); + } + else + { + $('input[name^="importData["]').prop('checked', false); + $('#shop_list, #data_list').slideUp('slow'); + } }); $('#id_category, #importFromShop').change(function(){ shop_id = $('#importFromShop').val(); diff --git a/admin-dev/themes/default/template/controllers/shop/helpers/form/index.php b/admin-dev/themes/default/template/controllers/shop/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/shop/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/shop/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop/helpers/index.php b/admin-dev/themes/default/template/controllers/shop/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/shop/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/shop/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop/helpers/list/index.php b/admin-dev/themes/default/template/controllers/shop/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/shop/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/shop/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop/helpers/list/list_action_delete.tpl b/admin-dev/themes/default/template/controllers/shop/helpers/list/list_action_delete.tpl index 9080542b2..649b9df26 100644 --- a/admin-dev/themes/default/template/controllers/shop/helpers/list/list_action_delete.tpl +++ b/admin-dev/themes/default/template/controllers/shop/helpers/list/list_action_delete.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,15 +18,15 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} {$action} \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/shop/helpers/list/list_content.tpl b/admin-dev/themes/default/template/controllers/shop/helpers/list/list_content.tpl index a2f32493f..36b3908a0 100644 --- a/admin-dev/themes/default/template/controllers/shop/helpers/list/list_content.tpl +++ b/admin-dev/themes/default/template/controllers/shop/helpers/list/list_content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -30,7 +30,7 @@ {if isset($tr.$key)} {$tr.$key} {else} - {l s='Click here to set an URL for this shop'} + {l s='Click here to set a URL for this shop.'} {/if} {else} {$smarty.block.parent} diff --git a/admin-dev/themes/default/template/controllers/shop/index.php b/admin-dev/themes/default/template/controllers/shop/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/shop/index.php +++ b/admin-dev/themes/default/template/controllers/shop/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop/tree.tpl b/admin-dev/themes/default/template/controllers/shop/tree.tpl index a778665f6..8019d0174 100644 --- a/admin-dev/themes/default/template/controllers/shop/tree.tpl +++ b/admin-dev/themes/default/template/controllers/shop/tree.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -69,7 +69,7 @@ function customMenu(node) "add_shop_group" : { "separator_before" : false, "separator_after" : false, - "label" : "{l s='Add new shop group'}", + "label" : "{l s='Add a new shop group'}", "icon" : "../img/admin/add.gif", "action" : function (obj){ location.href = '{$link->getAdminLink('AdminShopGroup')}&addshop_group'; @@ -154,7 +154,7 @@ function customMenu(node) "add_shop_group" : { "separator_before" : false, "separator_after" : false, - "label" : "{l s='Add new shop group'}", + "label" : "{l s='Add a new shop group'}", "icon" : "../img/admin/add.gif", "action" : function (obj){ location.href = '{$link->getAdminLink('AdminShopGroup')}&addshop_group'; @@ -186,7 +186,7 @@ $("#multishop-tree").jstree({ 'plugins': ["themes","json_data","cookies","contextmenu"], 'json_data': { 'ajax': { - 'url': "{$link->getAdminLink('AdminShop')}", + 'url': "{$link->getAdminLink('AdminShop')|addslashes}", 'data': function(n) { return { diff --git a/admin-dev/themes/default/template/controllers/shop_group/content.tpl b/admin-dev/themes/default/template/controllers/shop_group/content.tpl index 4cebfa51a..bbd3a59f2 100644 --- a/admin-dev/themes/default/template/controllers/shop_group/content.tpl +++ b/admin-dev/themes/default/template/controllers/shop_group/content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/shop_group/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/shop_group/helpers/form/form.tpl index 415b2f36c..35bb42ec6 100644 --- a/admin-dev/themes/default/template/controllers/shop_group/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/shop_group/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/shop_group/helpers/form/index.php b/admin-dev/themes/default/template/controllers/shop_group/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/shop_group/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/shop_group/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop_group/helpers/index.php b/admin-dev/themes/default/template/controllers/shop_group/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/shop_group/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/shop_group/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop_group/index.php b/admin-dev/themes/default/template/controllers/shop_group/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/shop_group/index.php +++ b/admin-dev/themes/default/template/controllers/shop_group/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop_url/content.tpl b/admin-dev/themes/default/template/controllers/shop_url/content.tpl index 4cebfa51a..bbd3a59f2 100644 --- a/admin-dev/themes/default/template/controllers/shop_url/content.tpl +++ b/admin-dev/themes/default/template/controllers/shop_url/content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/shop_url/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/shop_url/helpers/form/form.tpl index 1a7edeba8..9fd468887 100644 --- a/admin-dev/themes/default/template/controllers/shop_url/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/shop_url/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/shop_url/helpers/form/index.php b/admin-dev/themes/default/template/controllers/shop_url/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/shop_url/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/shop_url/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop_url/helpers/index.php b/admin-dev/themes/default/template/controllers/shop_url/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/shop_url/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/shop_url/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop_url/helpers/list/index.php b/admin-dev/themes/default/template/controllers/shop_url/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/shop_url/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/shop_url/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/shop_url/helpers/list/list_content.tpl b/admin-dev/themes/default/template/controllers/shop_url/helpers/list/list_content.tpl index 9eee1c3e6..4296f6a4e 100644 --- a/admin-dev/themes/default/template/controllers/shop_url/helpers/list/list_content.tpl +++ b/admin-dev/themes/default/template/controllers/shop_url/helpers/list/list_content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/shop_url/index.php b/admin-dev/themes/default/template/controllers/shop_url/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/shop_url/index.php +++ b/admin-dev/themes/default/template/controllers/shop_url/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/slip/_print_pdf_icon.tpl b/admin-dev/themes/default/template/controllers/slip/_print_pdf_icon.tpl index 3153667f8..8ae907309 100755 --- a/admin-dev/themes/default/template/controllers/slip/_print_pdf_icon.tpl +++ b/admin-dev/themes/default/template/controllers/slip/_print_pdf_icon.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/slip/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/slip/helpers/form/form.tpl index 126718103..d728b4cf7 100644 --- a/admin-dev/themes/default/template/controllers/slip/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/slip/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/slip/helpers/form/index.php b/admin-dev/themes/default/template/controllers/slip/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/slip/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/slip/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/slip/helpers/index.php b/admin-dev/themes/default/template/controllers/slip/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/slip/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/slip/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/slip/index.php b/admin-dev/themes/default/template/controllers/slip/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/slip/index.php +++ b/admin-dev/themes/default/template/controllers/slip/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/form.tpl index fd9d2f6fb..da734f23b 100755 --- a/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -37,7 +37,7 @@

        {l s='Conditions'}

        - +
        {foreach from=$manufacturers item='manufacturer'} @@ -67,7 +67,7 @@
        - +
        {foreach from=$attributes_group item='attribute_group'} @@ -105,7 +105,7 @@
        - +
        '; $('#conditions').append(html); }); + $('#id_feature').change(function() { $('.id_feature_value').hide(); $('#id_feature_'+$(this).val()).show(); }); + $('#id_attribute_group').change(function() { $('.id_attribute').hide(); $('#id_attribute_'+$(this).val()).show(); }); + $('#add_condition_category').click(function() { var id_condition = add_condition(current_id_condition_group, 'category', $('#id_category option:selected').val()); if (!id_condition) return false; + var html = '{l s='Category'}'+$('#id_category option:selected').html()+''; - $('#condition_group_'+current_id_condition_group+' table tbody').append(html); + appendConditionToGroup(html); + return false; }); + $('#add_condition_manufacturer').click(function() { var id_condition = add_condition(current_id_condition_group, 'manufacturer', $('#id_manufacturer option:selected').val()); if (!id_condition) return false; + var html = '{l s='Manufacturer'}'+$('#id_manufacturer option:selected').html()+''; - $('#condition_group_'+current_id_condition_group+' table tbody').append(html); + appendConditionToGroup(html); + return false; }); + $('#add_condition_supplier').click(function() { var id_condition = add_condition(current_id_condition_group, 'supplier', $('#id_supplier option:selected').val()); if (!id_condition) return false; + var html = '{l s='Supplier'}'+$('#id_supplier option:selected').html()+''; - $('#condition_group_'+current_id_condition_group+' table tbody').append(html); + appendConditionToGroup(html); + return false; }); + $('#add_condition_attribute').click(function() { var id_condition = add_condition(current_id_condition_group, 'attribute', $('#id_attribute_'+$('#id_attribute_group option:selected').val()+' option:selected').val()); if (!id_condition) return false; + var html = '{l s='Attribute'}'+$('#id_attribute_group option:selected').html()+': '+$('#id_attribute_'+$('#id_attribute_group option:selected').val()+' option:selected').html()+''; - $('#condition_group_'+current_id_condition_group+' table tbody').append(html); + appendConditionToGroup(html); + return false; }); + $('#add_condition_feature').click(function() { var id_condition = add_condition(current_id_condition_group, 'feature', $('#id_feature_'+$('#id_feature option:selected').val()+' option:selected').val()); if (!id_condition) return false; + var html = '{l s='Feature'}'+$('#id_feature option:selected').html()+': '+$('#id_feature_'+$('#id_feature option:selected').val()+' option:selected').html()+''; - $('#condition_group_'+current_id_condition_group+' table tbody').append(html); + appendConditionToGroup(html); + return false; }); + $('#add_condition_group').click(function() { new_condition_group(); return false; }); + $('.condition_group').live('click', function() { var id = this.id.split('_'); toggle_condition_group(id[2]); return false; }); + {if $conditions|@count == 0} new_condition_group(); {/if} + {foreach from=$conditions key='id_group_condition' item='condition_group'} new_condition_group(); {foreach from=$condition_group item='condition'} diff --git a/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/index.php b/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/index.php b/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/specific_price_rule/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/specific_price_rule/index.php b/admin-dev/themes/default/template/controllers/specific_price_rule/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/specific_price_rule/index.php +++ b/admin-dev/themes/default/template/controllers/specific_price_rule/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/states/list_footer.tpl b/admin-dev/themes/default/template/controllers/states/helpers/list/list_footer.tpl similarity index 97% rename from admin-dev/themes/default/template/controllers/states/list_footer.tpl rename to admin-dev/themes/default/template/controllers/states/helpers/list/list_footer.tpl index 6c3c0aef7..57a2e9369 100644 --- a/admin-dev/themes/default/template/controllers/states/list_footer.tpl +++ b/admin-dev/themes/default/template/controllers/states/helpers/list/list_footer.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/states/index.php b/admin-dev/themes/default/template/controllers/states/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/states/index.php +++ b/admin-dev/themes/default/template/controllers/states/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stats/calendar.tpl b/admin-dev/themes/default/template/controllers/stats/calendar.tpl index 4d71ef530..31e607224 100644 --- a/admin-dev/themes/default/template/controllers/stats/calendar.tpl +++ b/admin-dev/themes/default/template/controllers/stats/calendar.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,14 +18,14 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *}
        -
        + diff --git a/admin-dev/themes/default/template/controllers/stats/engines.tpl b/admin-dev/themes/default/template/controllers/stats/engines.tpl index 41710c7ed..64e13c434 100644 --- a/admin-dev/themes/default/template/controllers/stats/engines.tpl +++ b/admin-dev/themes/default/template/controllers/stats/engines.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,14 +18,14 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *}
        - +

        {l s='Settings'}

        @@ -38,7 +38,7 @@ {else} - {l s='No graph engine module installed'} + {l s='No graph engine module has been installed.'} {/if}
        @@ -51,7 +51,7 @@ {/foreach} {else} - {l s='No grid engine module installed'} + {l s='No grid engine module has been installed.'} {/if}
        diff --git a/admin-dev/themes/default/template/controllers/stats/helpers/index.php b/admin-dev/themes/default/template/controllers/stats/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/stats/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/stats/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stats/helpers/view/index.php b/admin-dev/themes/default/template/controllers/stats/helpers/view/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/stats/helpers/view/index.php +++ b/admin-dev/themes/default/template/controllers/stats/helpers/view/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stats/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/stats/helpers/view/view.tpl index 3f4ea41ff..26ca87b46 100644 --- a/admin-dev/themes/default/template/controllers/stats/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/stats/helpers/view/view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/stats/index.php b/admin-dev/themes/default/template/controllers/stats/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/stats/index.php +++ b/admin-dev/themes/default/template/controllers/stats/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stats/menu.tpl b/admin-dev/themes/default/template/controllers/stats/menu.tpl index b3fbe8bd3..477f7a842 100644 --- a/admin-dev/themes/default/template/controllers/stats/menu.tpl +++ b/admin-dev/themes/default/template/controllers/stats/menu.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -35,7 +35,7 @@ {/if} {/foreach} {else} - {l s='No module installed'} + {l s='No module has been installed.'} {/if} diff --git a/admin-dev/themes/default/template/controllers/stats/stats.tpl b/admin-dev/themes/default/template/controllers/stats/stats.tpl index 798fcd42d..584c416d0 100644 --- a/admin-dev/themes/default/template/controllers/stats/stats.tpl +++ b/admin-dev/themes/default/template/controllers/stats/stats.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -31,7 +31,7 @@ {l s='Module not found'} {/if} {else} -

        {l s='Please select a module in the left column.'}

        +

        {l s='Please select a module from the left column.'}

        {/if}
        diff --git a/admin-dev/themes/default/template/controllers/statuses/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/statuses/helpers/form/form.tpl index 0a352595c..c54a61c14 100644 --- a/admin-dev/themes/default/template/controllers/statuses/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/statuses/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/statuses/helpers/form/index.php b/admin-dev/themes/default/template/controllers/statuses/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/statuses/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/statuses/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/statuses/helpers/index.php b/admin-dev/themes/default/template/controllers/statuses/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/statuses/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/statuses/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/statuses/index.php b/admin-dev/themes/default/template/controllers/statuses/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/statuses/index.php +++ b/admin-dev/themes/default/template/controllers/statuses/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stock_cover/helpers/index.php b/admin-dev/themes/default/template/controllers/stock_cover/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/stock_cover/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/stock_cover/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stock_cover/helpers/list/index.php b/admin-dev/themes/default/template/controllers/stock_cover/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/stock_cover/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/stock_cover/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stock_cover/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/stock_cover/helpers/list/list_header.tpl index b9cd30848..a42fa8281 100644 --- a/admin-dev/themes/default/template/controllers/stock_cover/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/stock_cover/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/stock_cover/index.php b/admin-dev/themes/default/template/controllers/stock_cover/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/stock_cover/index.php +++ b/admin-dev/themes/default/template/controllers/stock_cover/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/index.php b/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/list/index.php b/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/list/list_header.tpl index 55f11b6f0..6cb2a34d4 100644 --- a/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/stock_instant_state/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/stock_instant_state/index.php b/admin-dev/themes/default/template/controllers/stock_instant_state/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/stock_instant_state/index.php +++ b/admin-dev/themes/default/template/controllers/stock_instant_state/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stock_mvt/helpers/index.php b/admin-dev/themes/default/template/controllers/stock_mvt/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/stock_mvt/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/stock_mvt/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stock_mvt/helpers/list/index.php b/admin-dev/themes/default/template/controllers/stock_mvt/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/stock_mvt/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/stock_mvt/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stock_mvt/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/stock_mvt/helpers/list/list_header.tpl index 3fdc0b389..9207df831 100644 --- a/admin-dev/themes/default/template/controllers/stock_mvt/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/stock_mvt/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/stock_mvt/index.php b/admin-dev/themes/default/template/controllers/stock_mvt/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/stock_mvt/index.php +++ b/admin-dev/themes/default/template/controllers/stock_mvt/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stores/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/stores/helpers/form/form.tpl index a33819d77..79b0fb9e1 100644 --- a/admin-dev/themes/default/template/controllers/stores/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/stores/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -39,13 +39,13 @@ {if isset($input.maxlength)}maxlength="{$input.maxlength}"{/if} name="latitude" id="latitude" - value="{$fields_value[$input.name]|htmlentities}" /> / + value="{$fields_value[$input.name]|escape:'htmlall'}" /> / + value="{$fields_value['longitude']|escape:'htmlall'}" /> {else} {$smarty.block.parent} {/if} @@ -82,7 +82,7 @@ {foreach $fields_value.days as $k => $value} {$value} -
        +
        {/foreach} diff --git a/admin-dev/themes/default/template/controllers/stores/helpers/form/index.php b/admin-dev/themes/default/template/controllers/stores/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/stores/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/stores/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stores/helpers/index.php b/admin-dev/themes/default/template/controllers/stores/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/stores/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/stores/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stores/helpers/options/index.php b/admin-dev/themes/default/template/controllers/stores/helpers/options/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/stores/helpers/options/index.php +++ b/admin-dev/themes/default/template/controllers/stores/helpers/options/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/stores/helpers/options/options.tpl b/admin-dev/themes/default/template/controllers/stores/helpers/options/options.tpl index 3c2d8dc28..5fc5f3b05 100644 --- a/admin-dev/themes/default/template/controllers/stores/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/controllers/stores/helpers/options/options.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -38,7 +38,7 @@ if (html == 'false') { $("#conf_id_PS_SHOP_STATE_ID").fadeOut(); - $('#id_state option[value=0]').attr("selected", "selected"); + $('#PS_SHOP_STATE_ID option[value=0]').attr("selected", "selected"); } else { diff --git a/admin-dev/themes/default/template/controllers/stores/index.php b/admin-dev/themes/default/template/controllers/stores/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/stores/index.php +++ b/admin-dev/themes/default/template/controllers/stores/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/suppliers/helpers/index.php b/admin-dev/themes/default/template/controllers/suppliers/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/suppliers/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/suppliers/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/suppliers/helpers/view/index.php b/admin-dev/themes/default/template/controllers/suppliers/helpers/view/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/suppliers/helpers/view/index.php +++ b/admin-dev/themes/default/template/controllers/suppliers/helpers/view/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl index 9f881fe57..fec2106d7 100644 --- a/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/suppliers/helpers/view/view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -30,55 +30,44 @@

        {$supplier->name}

        {l s='Number of products:'} {count($products)}

        + + + + + + + + + + {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{/if} + {foreach $products AS $product} -
        {if !$product->hasAttributes()} -
        {l s='Product name'}{l s='Attribute name'}{l s='Supplier Reference'}{l s='Wholesale price'}{l s='Reference'}{l s='EAN13'}{l s='UPC'}{l s='Available Quantity'}
        - - - {if !empty($product->product_supplier_reference)}{/if} - {if !empty($product->product_supplier_price_te)}{/if} - {if !empty($product->reference)}{/if} - {if !empty($product->ean13)}{/if} - {if !empty($product->upc)}{/if} - {if $stock_management}{/if} - -
        {l s='Name:'} {$product->name}{l s='Supplier Reference:'} {$product->product_supplier_reference}{l s='Wholesale price:'} {$product->product_supplier_price_te}{l s='Reference:'} {$product->reference}{l s='EAN13:'} {$product->ean13}{l s='UPC:'} {$product->upc}{l s='Available Quantity:'} {$product->quantity}
        + + {$product->name} + {l s='N/A'} + {if empty($product->product_supplier_reference)}{l s='N/A'}{else}{$product->product_supplier_reference}{/if} + {if empty($product->product_supplier_price_te)}0{else}{$product->product_supplier_price_te}{/if} + {if empty($product->reference)}{l s='N/A'}{else}{$product->reference}{/if} + {if empty($product->ean13)}{l s='N/A'}{else}{$product->ean13}{/if} + {if empty($product->upc)}{l s='N/A'}{else}{$product->upc}{/if} + {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{$product->quantity}{/if} + {else} -

        {$product->name}

        - - - - - - - - - - - - - - - - - - {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{/if} + {foreach $product->combination AS $id_product_attribute => $product_attribute} + + + + + + + + + {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{/if} - {foreach $product->combination AS $id_product_attribute => $product_attribute} - - - - - - - - {if $stock_management && $shopContext != Shop::CONTEXT_ALL}{/if} - - {/foreach} -
        {l s='Attribute name'}{l s='Supplier Reference'}{l s='Wholesale price'}{l s='Reference'}{l s='EAN13'}{l s='UPC'}{l s='Available Quantity'}
        {$product->name}{if empty($product_attribute.attributes)}{l s='N/A'}{else}{$product_attribute.attributes}{/if}{if empty($product_attribute.product_supplier_reference)}{l s='N/A'}{else}{$product_attribute.product_supplier_reference}{/if}{if empty($product_attribute.product_supplier_price_te)}0{else}{$product_attribute.product_supplier_price_te}{/if}{if empty($product_attribute.reference)}{l s='N/A'}{else}{$product_attribute.reference}{/if}{if empty($product_attribute.ean13)}{l s='N/A'}{else}{$product_attribute.ean13}{/if}{if empty($product_attribute.upc)}{l s='N/A'}{else}{$product_attribute.upc}{/if}{$product_attribute.quantity}
        {$product_attribute.attributes}{$product_attribute.product_supplier_reference}{$product_attribute.product_supplier_price_te}{$product_attribute.reference}{$product_attribute.ean13}{$product_attribute.upc}{$product_attribute.quantity}
        + {/foreach} {/if} {/foreach} - + {/block} diff --git a/admin-dev/themes/default/template/controllers/suppliers/index.php b/admin-dev/themes/default/template/controllers/suppliers/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/suppliers/index.php +++ b/admin-dev/themes/default/template/controllers/suppliers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/form.tpl index b2b7d6147..06d43e078 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -35,10 +35,10 @@
        Supply Order Management - {l s='Manage the products you want to order from your supplier'} + {l s='Manage the products you want to order from the supplier.'} -

        {l s='To add a product to the order, type the first letters of the product name, then select it from the drop-down list:'}

        +

        {l s='To add a product to the order, type the first letters of the product name, then select it from the drop-down list.'}

        {l s='Add a product to the supply order'} @@ -106,7 +106,7 @@ - {l s='Remove this product from the order'} + {l s='Remove this product from the order.'} @@ -138,7 +138,7 @@ // check if it's possible to add the product if (product_infos == null || $('#cur_product_name').val() == '') { - jAlert('{l s='Please select at least one product.'}'); + jAlert('{l s='Please select at least one product.' js=1}'); return false; } @@ -158,7 +158,7 @@ '%'+ '%'+ ''+ - '{l s='Remove this product from the order'}'+ + '{l s='Remove this product from the order.'}'+ '' ); diff --git a/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/index.php b/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders/helpers/index.php b/admin-dev/themes/default/template/controllers/supply_orders/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders/helpers/list/index.php b/admin-dev/themes/default/template/controllers/supply_orders/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/supply_orders/helpers/list/list_header.tpl index 7ac56c93d..33dfc9b8e 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/supply_orders/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/supply_orders/helpers/view/index.php b/admin-dev/themes/default/template/controllers/supply_orders/helpers/view/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders/helpers/view/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders/helpers/view/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/supply_orders/helpers/view/view.tpl index 274f8cfbc..74acd19c7 100755 --- a/admin-dev/themes/default/template/controllers/supply_orders/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/supply_orders/helpers/view/view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -63,7 +63,7 @@
        - {if isset($is_template) && $is_template == 1} {l s='Template'} {/if}{l s='Products'} + {if isset($is_template) && $is_template == 1} {l s='Template'} {/if}{l s='Products:'} {$supply_order_detail_content}
        @@ -109,7 +109,7 @@ - {l s='TOTAL TO PAY'} + {l s='Total to pay.'} {$supply_order_total_ti} diff --git a/admin-dev/themes/default/template/controllers/supply_orders/index.php b/admin-dev/themes/default/template/controllers/supply_orders/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/form/form.tpl index b80aac9be..98bc9ef4b 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -67,7 +67,7 @@ $(document).ready(function() { {l s='Supply Order State'} {l s='Print the supply order form'} -{l s='Click here to download the supply order form'}. +{l s='Click here to download the supply order form.'}.
        {/if} diff --git a/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/form/index.php b/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/index.php b/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders_change_state/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders_change_state/index.php b/admin-dev/themes/default/template/controllers/supply_orders_change_state/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders_change_state/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders_change_state/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/index.php b/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/list/index.php b/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/list/list_header.tpl index 977e21468..1a34d8c7e 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/index.php b/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/index.php +++ b/admin-dev/themes/default/template/controllers/supply_orders_receipt_history/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tags/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/tags/helpers/form/form.tpl index 1116f35e2..bec6083fb 100644 --- a/admin-dev/themes/default/template/controllers/tags/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/tags/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -27,7 +27,7 @@ {block name="other_input"} {if $key eq 'selects'}
        -

        {l s='Products'}

        +

        {l s='Products:'}

        - + - + - + - +
        @@ -36,7 +36,7 @@ {/foreach} - {l s='Double-click to move to other column'}  + {l s='Double click to move the item to another column'} 

        {l s='Add'} >> @@ -49,7 +49,7 @@ {/foreach} - {l s='Double-click to move to other column'}  + {l s='Double click to move the item to another column'} 

        << {l s='Remove'} diff --git a/admin-dev/themes/default/template/controllers/tags/helpers/form/index.php b/admin-dev/themes/default/template/controllers/tags/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/tags/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/tags/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tags/helpers/index.php b/admin-dev/themes/default/template/controllers/tags/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/tags/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/tags/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tags/index.php b/admin-dev/themes/default/template/controllers/tags/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/tags/index.php +++ b/admin-dev/themes/default/template/controllers/tags/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/form.tpl index 7225bc0fa..2d5db9490 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/index.php b/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/tax_rules/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tax_rules/helpers/index.php b/admin-dev/themes/default/template/controllers/tax_rules/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/tax_rules/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/index.php b/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_action_edit.tpl b/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_action_edit.tpl index 42083c32f..fb8803e5a 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_action_edit.tpl +++ b/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_action_edit.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_content.tpl b/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_content.tpl index 7e7a524d0..69d61175d 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_content.tpl +++ b/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_header.tpl index 88074cd3b..d6ab3b6d8 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/tax_rules/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -32,11 +32,36 @@ {hook h=$hookName} {/if} - - - - + + + + + - + - + - + @@ -46,7 +46,7 @@ - +
        + + {if $page > 1} +   + + {/if} + {l s='Page'} {$page} / {$total_pages} + {if $page < $total_pages} +   + + {/if} + | {l s='Display'} + + / {$list_total} {l s='result(s)'} + + + + + +
        -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/form/form.tpl index 0420ccb08..5b16474bb 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/form/index.php b/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/index.php b/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/tax_rules_group/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tax_rules_group/index.php b/admin-dev/themes/default/template/controllers/tax_rules_group/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/tax_rules_group/index.php +++ b/admin-dev/themes/default/template/controllers/tax_rules_group/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/themes/helpers/index.php b/admin-dev/themes/default/template/controllers/themes/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/themes/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/themes/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/themes/helpers/options/index.php b/admin-dev/themes/default/template/controllers/themes/helpers/options/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/themes/helpers/options/index.php +++ b/admin-dev/themes/default/template/controllers/themes/helpers/options/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/themes/helpers/options/options.tpl b/admin-dev/themes/default/template/controllers/themes/helpers/options/options.tpl index 02fb828a2..df2023d29 100644 --- a/admin-dev/themes/default/template/controllers/themes/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/controllers/themes/helpers/options/options.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/themes/index.php b/admin-dev/themes/default/template/controllers/themes/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/themes/index.php +++ b/admin-dev/themes/default/template/controllers/themes/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tracking/helpers/index.php b/admin-dev/themes/default/template/controllers/tracking/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/tracking/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/tracking/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tracking/helpers/list/index.php b/admin-dev/themes/default/template/controllers/tracking/helpers/list/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/tracking/helpers/list/index.php +++ b/admin-dev/themes/default/template/controllers/tracking/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/tracking/helpers/list/list_header.tpl b/admin-dev/themes/default/template/controllers/tracking/helpers/list/list_header.tpl index 3fc3a49d4..3b7270701 100644 --- a/admin-dev/themes/default/template/controllers/tracking/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/controllers/tracking/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/controllers/tracking/index.php b/admin-dev/themes/default/template/controllers/tracking/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/tracking/index.php +++ b/admin-dev/themes/default/template/controllers/tracking/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/translations/auto_translate.tpl b/admin-dev/themes/default/template/controllers/translations/auto_translate.tpl index f4d8b4788..cfb7c8fbe 100644 --- a/admin-dev/themes/default/template/controllers/translations/auto_translate.tpl +++ b/admin-dev/themes/default/template/controllers/translations/auto_translate.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,12 +18,12 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} - +
        {l s='Modify translations'} - {l s='Here you can modify translations for all text input in PrestaShop.'}
        - {l s='First, select a section (such as Back Office or Modules), then click the flag representing the language you want to edit.'}

        + {l s='Here you can modify translations for every line of code inside PrestaShop.'}
        + {l s='First, select a section (such as Back Office or Installed modules), and then click the flag representing the language you want to edit.'}

        - {foreach $translations_type as $type => $array} - + {/foreach} - + {foreach $themes as $theme} - - + {/foreach} {foreach $languages as $language} @@ -87,12 +94,12 @@ {l s='Add / Update a language'}
        -

        {l s='You can add or update a language directly from prestashop.com here'}

        +

        {l s='You can add or update a language directly from the PrestaShop website here:'}

        - {l s='If you choose to update an existing language pack, all your previous customization in the theme named "Default" will be lost. This includes Front Office expressions and default e-mail templates.'} + {l s='If you choose to update an existing language pack, all of your previous customization\'s in the theme named "Default" will be lost. This includes Front Office expressions and default email templates.'}
        {if $packs_to_update || $packs_to_install} -
        {l s='Language you want to add or update:'} +
        {l s='Please select the language you want to add or update:'}
        {else} -

        {l s='Cannot connect to prestashop.com to get language list.'}

        +

        {l s='Cannot connect to the PrestaShop website to get the language list.'}

        {/if}
        @@ -121,8 +128,8 @@

        - {l s='If the name format is: isocode.gzip (e.g. us.gzip) and the language corresponding to this package does not exist, it will automatically be created.'} - {l s='Be careful, as this will replace all existing data for the destination language!'} + {l s='If the language file format is: isocode.gzip (e.g. us.gzip), and the language corresponding to this package does not exist, it will automatically be created.'} + {l s='Warning: This will replace all of the existing data inside the destination language.'}

         

        @@ -133,7 +140,7 @@ {/foreach}

        -

        +

        @@ -143,7 +150,7 @@
        {l s='Export a language'}

        {l s='Export data from one language to a file (language pack).'}
        - {l s='Choose the theme from which you want to export translations.'}
        + {l s='Choose which theme you\'d like to export your translations to. '}
        -

        * {l s='Language files must be complete to allow copying of translations'}

        +

        * {l s='Language files must be complete to allow copying of translations.'}

        {/block} \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_errors.tpl b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_errors.tpl index 56267f0dd..0d304466c 100644 --- a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_errors.tpl +++ b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_errors.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -30,13 +30,13 @@ {if !empty($limit_warning)}
        {if $limit_warning['error_type'] == 'suhosin'} - {l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'} + {l s='Warning: Your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields allowed in a form:'} {$limit_warning['post.max_vars']} {l s='for suhosin.post.max_vars.'}
        {$limit_warning['request.max_vars']} {l s='for suhosin.request.max_vars.'}
        - {l s='Please ask your hosting provider to increase the suhosin post and request a limit of'} + {l s='Please ask your hosting provider to increase the suhosin limit to'} {else} - {l s='Warning, your PHP configuration limits the maximum number of fields to post in a form:'}
        + {l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}
        {$limit_warning['max_input_vars']} {l s='for max_input_vars.'}
        {l s='Please ask your hosting provider to increase the this limit to'} {/if} diff --git a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_form.tpl b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_form.tpl index fea1a67e1..ae8fd140d 100644 --- a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_form.tpl +++ b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -30,13 +30,13 @@ {if !empty($limit_warning)}
        {if $limit_warning['error_type'] == 'suhosin'} - {l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'} + {l s='Warning: Your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields allowed in a form:'} {$limit_warning['post.max_vars']} {l s='for suhosin.post.max_vars.'}
        {$limit_warning['request.max_vars']} {l s='for suhosin.request.max_vars.'}
        - {l s='Please ask your hosting provider to increase the suhosin post and request a limit of'} + {l s='Please ask your hosting provider to increase the suhosin limit to'} {else} - {l s='Warning, your PHP configuration limits the maximum number of fields to post in a form:'} + {l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'} {$limit_warning['max_input_vars']} {l s='for max_input_vars.'}
        {l s='Please ask your hosting provider to increase the this limit to'} {/if} @@ -46,7 +46,7 @@
          -
        • {l s='Click on the titles to open fieldsets'}.
        • +
        • {l s='Click on titles to open fieldsets'}.
        • {l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}


        diff --git a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_mails.tpl b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_mails.tpl index c5c28d953..8124e714f 100644 --- a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_mails.tpl +++ b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_mails.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -32,13 +32,13 @@ {if !empty($limit_warning)}
        {if $limit_warning['error_type'] == 'suhosin'} - {l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'} + {l s='Warning: Your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields allowed in a form:'} {$limit_warning['post.max_vars']} {l s='for suhosin.post.max_vars.'}
        {$limit_warning['request.max_vars']} {l s='for suhosin.request.max_vars.'}
        - {l s='Please ask your hosting provider to increase the suhosin post and request a limit of'} + {l s='Please ask your hosting provider to increase the suhosin limit to'} {else} - {l s='Warning, your PHP configuration limits the maximum number of fields to post in a form:'}
        + {l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}
        {$limit_warning['max_input_vars']} {l s='for max_input_vars.'}
        {l s='Please ask your hosting provider to increase the this limit to'} {/if} @@ -48,7 +48,7 @@
          -
        • {l s='Click on the titles to open fieldsets'}.
        • +
        • {l s='Click on titles to open fieldsets'}.
        • {l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}


        @@ -87,12 +87,12 @@
        -

        {l s='Core e-mails:'}

        -

        {l s='List of emails which are in the folder'} "mails/{$lang|strtolower}/"

        +

        {l s='Core emails:'}

        +

        {l s='List of emails in the folder'} "mails/{$lang|strtolower}/"

        {$mail_content} -

        {l s='Module e-mails:'}

        -

        {l s='List of emails which are in the folder'} "modules/name_of_module/mails/{$lang|strtolower}/"

        +

        {l s='Module emails:'}

        +

        {l s='List of emails in the folder'} "modules/name_of_module/mails/{$lang|strtolower}/"

        {foreach $module_mails as $module_name => $mails} {$mails['display']} {/foreach} diff --git a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_modules.tpl b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_modules.tpl index ba6075252..4455c007a 100644 --- a/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_modules.tpl +++ b/admin-dev/themes/default/template/controllers/translations/helpers/view/translation_modules.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -30,13 +30,13 @@ {if !empty($limit_warning)}
        {if $limit_warning['error_type'] == 'suhosin'} - {l s='Warning, your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields to post in a form:'} + {l s='Warning: Your hosting provider is using the suhosin patch for PHP, which limits the maximum number of fields allowed in a form:'} {$limit_warning['post.max_vars']} {l s='for suhosin.post.max_vars.'}
        {$limit_warning['request.max_vars']} {l s='for suhosin.request.max_vars.'}
        - {l s='Please ask your hosting provider to increase the suhosin post and request a limit of'} + {l s='Please ask your hosting provider to increase the suhosin limit to'} {else} - {l s='Warning, your PHP configuration limits the maximum number of fields to post in a form:'}
        + {l s='Warning! Your PHP configuration limits the maximum number of fields allowed in a form:'}
        {$limit_warning['max_input_vars']} {l s='for max_input_vars.'}
        {l s='Please ask your hosting provider to increase the this limit to'} {/if} @@ -46,7 +46,7 @@
          -
        • {l s='Click on the titles to open fieldsets'}.
        • +
        • {l s='Click on titles to open fieldsets'}.
        • {l s='Some sentences to translate use this syntax: %s... These are variables, and PrestaShop take care of replacing them before displaying your translation. You must leave these in your translations, and place them appropriately in your sentence.' sprintf='%d, %s, %1$s, %2$d'}


        @@ -92,7 +92,7 @@
        {foreach $modules_translations as $theme_name => $theme} -

        >{l s='Theme:'} {if $theme_name === $default_theme_name}{l s='default'}{else}{$theme_name}{/if}

        + {if $theme_name}

        >{l s='Theme:'} {$theme_name}

        {/if} {foreach $theme as $module_name => $module}

        {l s='Module:'} {$module_name}

        {foreach $module as $template_name => $newLang} @@ -107,7 +107,7 @@ {$missing_translations_module = 0} {/if}
        - {if $theme_name === 'default'}{l s='default'}{else}{$theme_name}{/if} - {$template_name} + {if $theme_name}{$theme_name} - {/if}{$template_name} {$newLang|count} {l s='expressions'} ({$missing_translations_module})
        @@ -117,7 +117,7 @@
        '); + //add new rand inf input + $('tr.range_inf td:last').after(''); + + $('tr.fees_all td:last').after(''); + }); + $('tr.delete_range td:last').after('",e.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(n)}):"img"===s&&n.attr("src",e.currentItem.attr("src")),i||n.css("visibility","hidden"),n},update:function(t,n){(!i||s.forcePlaceholderSize)&&(n.height()||n.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),n.width()||n.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(s.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),s.placeholder.update(e,e.placeholder)},_contactContainers:function(s){var n,a,o,r,h,l,c,u,d,p,f=null,m=null;for(n=this.containers.length-1;n>=0;n--)if(!t.contains(this.currentItem[0],this.containers[n].element[0]))if(this._intersectsWith(this.containers[n].containerCache)){if(f&&t.contains(this.containers[n].element[0],f.element[0]))continue;f=this.containers[n],m=n}else this.containers[n].containerCache.over&&(this.containers[n]._trigger("out",s,this._uiHash(this)),this.containers[n].containerCache.over=0);if(f)if(1===this.containers.length)this.containers[m].containerCache.over||(this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1);else{for(o=1e4,r=null,p=f.floating||i(this.currentItem),h=p?"left":"top",l=p?"width":"height",c=this.positionAbs[h]+this.offset.click[h],a=this.items.length-1;a>=0;a--)t.contains(this.containers[m].element[0],this.items[a].item[0])&&this.items[a].item[0]!==this.currentItem[0]&&(!p||e(this.positionAbs.top+this.offset.click.top,this.items[a].top,this.items[a].height))&&(u=this.items[a].item.offset()[h],d=!1,Math.abs(u-c)>Math.abs(u+this.items[a][l]-c)&&(d=!0,u+=this.items[a][l]),o>Math.abs(u-c)&&(o=Math.abs(u-c),r=this.items[a],this.direction=d?"up":"down"));if(!r&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[m])return;r?this._rearrange(s,r,null,!0):this._rearrange(s,null,this.containers[m].element,!0),this._trigger("change",s,this._uiHash()),this.containers[m]._trigger("change",s,this._uiHash(this)),this.currentContainer=this.containers[m],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[m]._trigger("over",s,this._uiHash(this)),this.containers[m].containerCache.over=1}},_createHelper:function(e){var i=this.options,s=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return s.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(s[0]),s[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")}),(!s[0].style.width||i.forceHelperSize)&&s.width(this.currentItem.width()),(!s[0].style.height||i.forceHelperSize)&&s.height(this.currentItem.height()),s},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var e,i,s,n=this.options;"parent"===n.containment&&(n.containment=this.helper[0].parentNode),("document"===n.containment||"window"===n.containment)&&(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,t("document"===n.containment?document:window).width()-this.helperProportions.width-this.margins.left,(t("document"===n.containment?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(n.containment)||(e=t(n.containment)[0],i=t(n.containment).offset(),s="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(s?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(s?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var s="absolute"===e?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(n[0].tagName);return{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():a?0:n.scrollTop())*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():a?0:n.scrollLeft())*s}},_generatePosition:function(e){var i,s,n=this.options,a=e.pageX,o=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==document&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.leftthis.containment[2]&&(a=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),n.grid&&(i=this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1],o=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-n.grid[1]:i+n.grid[1]:i,s=this.originalPageX+Math.round((a-this.originalPageX)/n.grid[0])*n.grid[0],a=this.containment?s-this.offset.click.left>=this.containment[0]&&s-this.offset.click.left<=this.containment[2]?s:s-this.offset.click.left>=this.containment[0]?s-n.grid[0]:s+n.grid[0]:s)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():h?0:r.scrollTop()),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():h?0:r.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)("auto"===this._storedCSS[i]||"static"===this._storedCSS[i])&&(this._storedCSS[i]="");this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;i>=0;i--)e||s.push(function(t){return function(e){t._trigger("deactivate",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(function(t){return function(e){t._trigger("out",e,this._uiHash(this))}}.call(this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,this.cancelHelperRemoval){if(!e){for(this._trigger("beforeStop",t,this._uiHash()),i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!1}if(e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null,!e){for(i=0;s.length>i;i++)s[i].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!0},_trigger:function(){t.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.spinner.min.js b/js/jquery/ui/jquery.ui.spinner.min.js new file mode 100644 index 000000000..62cd8de6a --- /dev/null +++ b/js/jquery/ui/jquery.ui.spinner.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){function e(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.widget("ui.spinner",{version:"1.10.3",defaultElement:"",widgetEventPrefix:"spin",options:{culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e={},i=this.element;return t.each(["min","max","step"],function(t,s){var n=i.attr(s);void 0!==n&&n.length&&(e[s]=n)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,void 0):(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t),void 0)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){var t=this.element[0]===this.document[0].activeElement;t||(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s}))}var s;s=this.element[0]===this.document[0].activeElement?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),this._start(e)!==!1&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){return t(e.currentTarget).hasClass("ui-state-active")?this._start(e)===!1?!1:(this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e),void 0):void 0},"mouseleave .ui-spinner-button":"_stop"},_draw:function(){var t=this.uiSpinner=this.element.addClass("ui-spinner-input").attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml());this.element.attr("role","spinbutton"),this.buttons=t.find(".ui-spinner-button").attr("tabIndex",-1).button().removeClass("ui-corner-all"),this.buttons.height()>Math.ceil(.5*t.height())&&t.height()>0&&t.height(t.height()),this.options.disabled&&this.disable()},_keydown:function(e){var i=this.options,s=t.ui.keyCode;switch(e.keyCode){case s.UP:return this._repeat(null,1,e),!0;case s.DOWN:return this._repeat(null,-1,e),!0;case s.PAGE_UP:return this._repeat(null,i.page,e),!0;case s.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_uiSpinnerHtml:function(){return""},_buttonHtml:function(){return""+""+""+""+""},_start:function(t){return this.spinning||this._trigger("start",t)!==!1?(this.counter||(this.counter=1),this.spinning=!0,!0):!1},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&this._trigger("spin",e,{value:i})===!1||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=""+t,i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,s=this.options;return e=null!==s.min?s.min:0,i=t-e,i=Math.round(i/s.step)*s.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==s.max&&t>s.max?s.max:null!==s.min&&s.min>t?s.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){if("culture"===t||"numberFormat"===t){var i=this._parse(this.element.val());return this.options[t]=e,this.element.val(this._format(i)),void 0}("max"===t||"min"===t||"step"===t)&&"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(this.buttons.first().find(".ui-icon").removeClass(this.options.icons.up).addClass(e.up),this.buttons.last().find(".ui-icon").removeClass(this.options.icons.down).addClass(e.down)),this._super(t,e),"disabled"===t&&(e?(this.element.prop("disabled",!0),this.buttons.button("disable")):(this.element.prop("disabled",!1),this.buttons.button("enable")))},_setOptions:e(function(t){this._super(t),this._value(this.element.val())}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},_value:function(t,e){var i;""!==t&&(i=this._parse(t),null!==i&&(e||(i=this._adjustValue(i)),t=this._format(i))),this.element.val(t),this._refresh()},_destroy:function(){this.element.removeClass("ui-spinner-input").prop("disabled",!1).removeAttr("autocomplete").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:e(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:e(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:e(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:e(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){return arguments.length?(e(this._value).call(this,t),void 0):this._parse(this.element.val())},widget:function(){return this.uiSpinner}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.tabs.min.js b/js/jquery/ui/jquery.ui.tabs.min.js old mode 100755 new mode 100644 index 3697f421c..e2f2ecb16 --- a/js/jquery/ui/jquery.ui.tabs.min.js +++ b/js/jquery/ui/jquery.ui.tabs.min.js @@ -1,35 +1,4 @@ -/* - * jQuery UI Tabs 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
        ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
      • #{label}
      • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& -e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= -d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| -(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); -this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= -this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); -if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))[0]))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); -this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ -g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", -function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; -this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= --1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; -d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= -d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, -e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); -j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); -if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, -this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, -load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, -"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, -url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.16"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k1&&decodeURIComponent(t.href.replace(a,""))===decodeURIComponent(location.href.replace(a,""))}var n=0,a=/#.*$/;t.widget("ui.tabs",{version:"1.10.3",delay:300,options:{active:null,collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_create:function(){var e=this,i=this.options;this.running=!1,this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all").toggleClass("ui-tabs-collapsible",i.collapsible).delegate(".ui-tabs-nav > li","mousedown"+this.eventNamespace,function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).delegate(".ui-tabs-anchor","focus"+this.eventNamespace,function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),this.active=this.options.active!==!1&&this.anchors.length?this._findActive(i.active):t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var i=this.options.active,s=this.options.collapsible,n=location.hash.substring(1);return null===i&&(n&&this.tabs.each(function(s,a){return t(a).attr("aria-controls")===n?(i=s,!1):e}),null===i&&(i=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),(null===i||-1===i)&&(i=this.tabs.length?0:!1)),i!==!1&&(i=this.tabs.index(this.tabs.eq(i)),-1===i&&(i=s?!1:0)),!s&&i===!1&&this.anchors.length&&(i=0),i},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(i){var s=t(this.document[0].activeElement).closest("li"),n=this.tabs.index(s),a=!0;if(!this._handlePageNav(i)){switch(i.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:a=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return i.preventDefault(),clearTimeout(this.activating),this._activate(n),e;case t.ui.keyCode.ENTER:return i.preventDefault(),clearTimeout(this.activating),this._activate(n===this.options.active?!1:n),e;default:return}i.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,a),i.ctrlKey||(s.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.focus())},_handlePageNav:function(i){return i.altKey&&i.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):i.altKey&&i.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):e},_findNextTab:function(e,i){function s(){return e>n&&(e=0),0>e&&(e=n),e}for(var n=this.tabs.length-1;-1!==t.inArray(s(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).focus(),t},_setOption:function(t,i){return"active"===t?(this._activate(i),e):"disabled"===t?(this._setupDisabled(i),e):(this._super(t,i),"collapsible"===t&&(this.element.toggleClass("ui-tabs-collapsible",i),i||this.options.active!==!1||this._activate(0)),"event"===t&&this._setupEvents(i),"heightStyle"===t&&this._setupHeightStyle(i),e)},_tabId:function(t){return t.attr("aria-controls")||"ui-tabs-"+i()},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),e.active!==!1&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setupDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-expanded":"false","aria-hidden":"true"}),this.active.length?(this.active.addClass("ui-tabs-active ui-state-active").attr({"aria-selected":"true",tabIndex:0}),this._getPanelForTab(this.active).show().attr({"aria-expanded":"true","aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this;this.tablist=this._getList().addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").attr("role","tablist"),this.tabs=this.tablist.find("> li:has(a[href])").addClass("ui-state-default ui-corner-top").attr({role:"tab",tabIndex:-1}),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).addClass("ui-tabs-anchor").attr({role:"presentation",tabIndex:-1}),this.panels=t(),this.anchors.each(function(i,n){var a,o,r,h=t(n).uniqueId().attr("id"),l=t(n).closest("li"),u=l.attr("aria-controls");s(n)?(a=n.hash,o=e.element.find(e._sanitizeSelector(a))):(r=e._tabId(l),a="#"+r,o=e.element.find(a),o.length||(o=e._createPanel(r),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),u&&l.data("ui-tabs-aria-controls",u),l.attr({"aria-controls":a.substring(1),"aria-labelledby":h}),o.attr("aria-labelledby",h)}),this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").attr("role","tabpanel")},_getList:function(){return this.element.find("ol,ul").eq(0)},_createPanel:function(e){return t("
        ").attr("id",e).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").data("ui-tabs-destroy",!0)},_setupDisabled:function(e){t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1);for(var i,s=0;i=this.tabs[s];s++)e===!0||-1!==t.inArray(s,e)?t(i).addClass("ui-state-disabled").attr("aria-disabled","true"):t(i).removeClass("ui-state-disabled").removeAttr("aria-disabled");this.options.disabled=e},_setupEvents:function(e){var i={click:function(t){t.preventDefault()}};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,s=this.element.parent();"fill"===e?(i=s.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),s=e.css("position");"absolute"!==s&&"fixed"!==s&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,s=this.active,n=t(e.currentTarget),a=n.closest("li"),o=a[0]===s[0],r=o&&i.collapsible,h=r?t():this._getPanelForTab(a),l=s.length?this._getPanelForTab(s):t(),u={oldTab:s,oldPanel:l,newTab:r?t():a,newPanel:h};e.preventDefault(),a.hasClass("ui-state-disabled")||a.hasClass("ui-tabs-loading")||this.running||o&&!i.collapsible||this._trigger("beforeActivate",e,u)===!1||(i.active=r?!1:this.tabs.index(a),this.active=o?t():a,this.xhr&&this.xhr.abort(),l.length||h.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),h.length&&this.load(this.tabs.index(a),e),this._toggle(e,u))},_toggle:function(e,i){function s(){a.running=!1,a._trigger("activate",e,i)}function n(){i.newTab.closest("li").addClass("ui-tabs-active ui-state-active"),o.length&&a.options.show?a._show(o,a.options.show,s):(o.show(),s())}var a=this,o=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),n()}):(i.oldTab.closest("li").removeClass("ui-tabs-active ui-state-active"),r.hide(),n()),r.attr({"aria-expanded":"false","aria-hidden":"true"}),i.oldTab.attr("aria-selected","false"),o.length&&r.length?i.oldTab.attr("tabIndex",-1):o.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),o.attr({"aria-expanded":"true","aria-hidden":"false"}),i.newTab.attr({"aria-selected":"true",tabIndex:0})},_activate:function(e){var i,s=this._findActive(e);s[0]!==this.active[0]&&(s.length||(s=this.active),i=s.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return e===!1?t():this.tabs.eq(e)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+t+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.element.removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible"),this.tablist.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all").removeAttr("role"),this.anchors.removeClass("ui-tabs-anchor").removeAttr("role").removeAttr("tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeClass("ui-state-default ui-state-active ui-state-disabled ui-corner-top ui-corner-bottom ui-widget-content ui-tabs-active ui-tabs-panel").removeAttr("tabIndex").removeAttr("aria-live").removeAttr("aria-busy").removeAttr("aria-selected").removeAttr("aria-labelledby").removeAttr("aria-hidden").removeAttr("aria-expanded").removeAttr("role")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var s=this.options.disabled;s!==!1&&(i===e?s=!1:(i=this._getIndex(i),s=t.isArray(s)?t.map(s,function(t){return t!==i?t:null}):t.map(this.tabs,function(t,e){return e!==i?e:null})),this._setupDisabled(s))},disable:function(i){var s=this.options.disabled;if(s!==!0){if(i===e)s=!0;else{if(i=this._getIndex(i),-1!==t.inArray(i,s))return;s=t.isArray(s)?t.merge([i],s).sort():[i]}this._setupDisabled(s)}},load:function(e,i){e=this._getIndex(e);var n=this,a=this.tabs.eq(e),o=a.find(".ui-tabs-anchor"),r=this._getPanelForTab(a),h={tab:a,panel:r};s(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,h)),this.xhr&&"canceled"!==this.xhr.statusText&&(a.addClass("ui-tabs-loading"),r.attr("aria-busy","true"),this.xhr.success(function(t){setTimeout(function(){r.html(t),n._trigger("load",i,h)},1)}).complete(function(t,e){setTimeout(function(){"abort"===e&&n.panels.stop(!1,!0),a.removeClass("ui-tabs-loading"),r.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr},1)})))},_ajaxSettings:function(e,i,s){var n=this;return{url:e.attr("href"),beforeSend:function(e,a){return n._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:a},s))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.tooltip.min.js b/js/jquery/ui/jquery.ui.tooltip.min.js new file mode 100644 index 000000000..48e52d930 --- /dev/null +++ b/js/jquery/ui/jquery.ui.tooltip.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){function e(e,i){var s=(e.attr("aria-describedby")||"").split(/\s+/);s.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(s.join(" ")))}function i(e){var i=e.data("ui-tooltip-id"),s=(e.attr("aria-describedby")||"").split(/\s+/),n=t.inArray(i,s);-1!==n&&s.splice(n,1),e.removeData("ui-tooltip-id"),s=t.trim(s.join(" ")),s?e.attr("aria-describedby",s):e.removeAttr("aria-describedby")}var s=0;t.widget("ui.tooltip",{version:"1.10.3",options:{content:function(){var e=t(this).attr("title")||"";return t("").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,tooltipClass:null,track:!1,close:null,open:null},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.options.disabled&&this._disable()},_setOption:function(e,i){var s=this;return"disabled"===e?(this[i?"_disable":"_enable"](),this.options[e]=i,void 0):(this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){s._updateContent(e)}),void 0)},_disable:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0)}),this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.is("[title]")&&e.data("ui-tooltip-title",e.attr("title")).attr("title","")})},_enable:function(){this.element.find(this.options.items).addBack().each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))})},open:function(e){var i=this,s=t(e?e.target:this.element).closest(this.options.items);s.length&&!s.data("ui-tooltip-id")&&(s.attr("title")&&s.data("ui-tooltip-title",s.attr("title")),s.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&s.parents().each(function(){var e,s=t(this);s.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),s.attr("title")&&(s.uniqueId(),i.parents[this.id]={element:this,title:s.attr("title")},s.attr("title",""))}),this._updateContent(s,e))},_updateContent:function(t,e){var i,s=this.options.content,n=this,a=e?e.type:null;return"string"==typeof s?this._open(e,t,s):(i=s.call(t[0],function(i){t.data("ui-tooltip-open")&&n._delay(function(){e&&(e.type=a),this._open(e,t,i)})}),i&&this._open(e,t,i),void 0)},_open:function(i,s,n){function a(t){l.of=t,o.is(":hidden")||o.position(l)}var o,r,h,l=t.extend({},this.options.position);if(n){if(o=this._find(s),o.length)return o.find(".ui-tooltip-content").html(n),void 0;s.is("[title]")&&(i&&"mouseover"===i.type?s.attr("title",""):s.removeAttr("title")),o=this._tooltip(s),e(s,o.attr("id")),o.find(".ui-tooltip-content").html(n),this.options.track&&i&&/^mouse/.test(i.type)?(this._on(this.document,{mousemove:a}),a(i)):o.position(t.extend({of:s},this.options.position)),o.hide(),this._show(o,this.options.show),this.options.show&&this.options.show.delay&&(h=this.delayedShow=setInterval(function(){o.is(":visible")&&(a(l.of),clearInterval(h))},t.fx.interval)),this._trigger("open",i,{tooltip:o}),r={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var i=t.Event(e);i.currentTarget=s[0],this.close(i,!0)}},remove:function(){this._removeTooltip(o)}},i&&"mouseover"!==i.type||(r.mouseleave="close"),i&&"focusin"!==i.type||(r.focusout="close"),this._on(!0,s,r)}},close:function(e){var s=this,n=t(e?e.currentTarget:this.element),a=this._find(n);this.closing||(clearInterval(this.delayedShow),n.data("ui-tooltip-title")&&n.attr("title",n.data("ui-tooltip-title")),i(n),a.stop(!0),this._hide(a,this.options.hide,function(){s._removeTooltip(t(this))}),n.removeData("ui-tooltip-open"),this._off(n,"mouseleave focusout keyup"),n[0]!==this.element[0]&&this._off(n,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete s.parents[e]}),this.closing=!0,this._trigger("close",e,{tooltip:a}),this.closing=!1)},_tooltip:function(e){var i="ui-tooltip-"+s++,n=t("
        ").attr({id:i,role:"tooltip"}).addClass("ui-tooltip ui-widget ui-corner-all ui-widget-content "+(this.options.tooltipClass||""));return t("
        ").addClass("ui-tooltip-content").appendTo(n),n.appendTo(this.document[0].body),this.tooltips[i]=e,n},_find:function(e){var i=e.data("ui-tooltip-id");return i?t("#"+i):t()},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_destroy:function(){var e=this;t.each(this.tooltips,function(i,s){var n=t.Event("blur");n.target=n.currentTarget=s[0],e.close(n,!0),t("#"+i).remove(),s.data("ui-tooltip-title")&&(s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))})}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.widget.min.js b/js/jquery/ui/jquery.ui.widget.min.js old mode 100755 new mode 100644 index 64893bb99..d2358d39d --- a/js/jquery/ui/jquery.ui.widget.min.js +++ b/js/jquery/ui/jquery.ui.widget.min.js @@ -1,15 +1,4 @@ -/*! - * jQuery UI Widget 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Widget - */ -(function(b,j){if(b.cleanData){var k=b.cleanData;b.cleanData=function(a){for(var c=0,d;(d=a[c])!=null;c++)try{b(d).triggerHandler("remove")}catch(e){}k(a)}}else{var l=b.fn.remove;b.fn.remove=function(a,c){return this.each(function(){if(!c)if(!a||b.filter(a,[this]).length)b("*",this).add([this]).each(function(){try{b(this).triggerHandler("remove")}catch(d){}});return l.call(b(this),a,c)})}}b.widget=function(a,c,d){var e=a.split(".")[0],f;a=a.split(".")[1];f=e+"-"+a;if(!d){d=c;c=b.Widget}b.expr[":"][f]= -function(h){return!!b.data(h,a)};b[e]=b[e]||{};b[e][a]=function(h,g){arguments.length&&this._createWidget(h,g)};c=new c;c.options=b.extend(true,{},c.options);b[e][a].prototype=b.extend(true,c,{namespace:e,widgetName:a,widgetEventPrefix:b[e][a].prototype.widgetEventPrefix||a,widgetBaseClass:f},d);b.widget.bridge(a,b[e][a])};b.widget.bridge=function(a,c){b.fn[a]=function(d){var e=typeof d==="string",f=Array.prototype.slice.call(arguments,1),h=this;d=!e&&f.length?b.extend.apply(null,[true,d].concat(f)): -d;if(e&&d.charAt(0)==="_")return h;e?this.each(function(){var g=b.data(this,a),i=g&&b.isFunction(g[d])?g[d].apply(g,f):g;if(i!==g&&i!==j){h=i;return false}}):this.each(function(){var g=b.data(this,a);g?g.option(d||{})._init():b.data(this,a,new c(d,this))});return h}};b.Widget=function(a,c){arguments.length&&this._createWidget(a,c)};b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(a,c){b.data(c,this.widgetName,this);this.element=b(c);this.options= -b.extend(true,{},this.options,this._getCreateOptions(),a);var d=this;this.element.bind("remove."+this.widgetName,function(){d.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return b.metadata&&b.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+ -"-disabled ui-state-disabled")},widget:function(){return this.element},option:function(a,c){var d=a;if(arguments.length===0)return b.extend({},this.options);if(typeof a==="string"){if(c===j)return this.options[a];d={};d[a]=c}this._setOptions(d);return this},_setOptions:function(a){var c=this;b.each(a,function(d,e){c._setOption(d,e)});return this},_setOption:function(a,c){this.options[a]=c;if(a==="disabled")this.widget()[c?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled", -c);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(a,c,d){var e=this.options[a];c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d=d||{};if(c.originalEvent){a=b.event.props.length;for(var f;a;){f=b.event.props[--a];c[f]=c.originalEvent[f]}}this.element.trigger(c,d);return!(b.isFunction(e)&&e.call(this.element[0],c,d)===false||c.isDefaultPrevented())}}})(jQuery); +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"
        ",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/themes/base/images/animated-overlay.gif b/js/jquery/ui/themes/base/images/animated-overlay.gif new file mode 100755 index 000000000..d441f75eb Binary files /dev/null and b/js/jquery/ui/themes/base/images/animated-overlay.gif differ diff --git a/js/jquery/ui/themes/base/images/index.php b/js/jquery/ui/themes/base/images/index.php index 88e934d59..195fab225 100644 --- a/js/jquery/ui/themes/base/images/index.php +++ b/js/jquery/ui/themes/base/images/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/jquery/ui/themes/base/index.php b/js/jquery/ui/themes/base/index.php index 88e934d59..195fab225 100644 --- a/js/jquery/ui/themes/base/index.php +++ b/js/jquery/ui/themes/base/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/jquery/ui/themes/base/jquery-ui.css b/js/jquery/ui/themes/base/jquery-ui.css new file mode 100755 index 000000000..03fb49350 --- /dev/null +++ b/js/jquery/ui/themes/base/jquery-ui.css @@ -0,0 +1,1176 @@ +/*! jQuery UI - v1.10.3 - 2013-06-25 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; +} + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width: 100%; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; + /* support: IE10, see #8844 */ + list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to overide default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertical centre icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, +.ui-tabs .ui-tabs-nav li.ui-state-disabled a, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading a { + cursor: text; +} +.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; + font-size: 1.1em/*{fsDefault}*/; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #aaaaaa/*{borderColorContent}*/; + background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; + color: #222222/*{fcContent}*/; +} +.ui-widget-content a { + color: #222222/*{fcContent}*/; +} +.ui-widget-header { + border: 1px solid #aaaaaa/*{borderColorHeader}*/; + background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; + color: #222222/*{fcHeader}*/; + font-weight: bold; +} +.ui-widget-header a { + color: #222222/*{fcHeader}*/; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #d3d3d3/*{borderColorDefault}*/; + background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; + font-weight: normal/*{fwDefault}*/; + color: #555555/*{fcDefault}*/; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #555555/*{fcDefault}*/; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #999999/*{borderColorHover}*/; + background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; + font-weight: normal/*{fwDefault}*/; + color: #212121/*{fcHover}*/; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited { + color: #212121/*{fcHover}*/; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #aaaaaa/*{borderColorActive}*/; + background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; + font-weight: normal/*{fwDefault}*/; + color: #212121/*{fcActive}*/; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121/*{fcActive}*/; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1/*{borderColorHighlight}*/; + background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; + color: #363636/*{fcHighlight}*/; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636/*{fcHighlight}*/; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a/*{borderColorError}*/; + background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; + color: #cd0a0a/*{fcError}*/; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a/*{fcError}*/; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a/*{fcError}*/; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; +} +.ui-widget-header .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; +} +.ui-state-default .ui-icon { + background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; +} +.ui-state-active .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; +} +.ui-state-highlight .ui-icon { + background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px/*{cornerRadius}*/; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px/*{cornerRadius}*/; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px/*{cornerRadius}*/; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px/*{cornerRadius}*/; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; + opacity: .3/*{opacityOverlay}*/; + filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/; +} +.ui-widget-shadow { + margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; + padding: 8px/*{thicknessShadow}*/; + background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; + opacity: .3/*{opacityShadow}*/; + filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/; + border-radius: 8px/*{cornerRadiusShadow}*/; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.accordion.css b/js/jquery/ui/themes/base/jquery.ui.accordion.css index 327beb50e..d36f9109b 100755 --- a/js/jquery/ui/themes/base/jquery.ui.accordion.css +++ b/js/jquery/ui/themes/base/jquery.ui.accordion.css @@ -1,19 +1,38 @@ -/* - * jQuery UI Accordion 1.8.16 +/*! + * jQuery UI Accordion 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Accordion#theming */ -/* IE/Win - Fix animation bug - #4615 */ -.ui-accordion { width: 100%; } -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; } +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.all.css b/js/jquery/ui/themes/base/jquery.ui.all.css index bf68bc41e..a0df16932 100755 --- a/js/jquery/ui/themes/base/jquery.ui.all.css +++ b/js/jquery/ui/themes/base/jquery.ui.all.css @@ -1,8 +1,9 @@ -/* - * jQuery UI CSS Framework 1.8.16 +/*! + * jQuery UI CSS Framework 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming diff --git a/js/jquery/ui/themes/base/jquery.ui.autocomplete.css b/js/jquery/ui/themes/base/jquery.ui.autocomplete.css index 6de686736..5e2c75030 100755 --- a/js/jquery/ui/themes/base/jquery.ui.autocomplete.css +++ b/js/jquery/ui/themes/base/jquery.ui.autocomplete.css @@ -1,53 +1,16 @@ -/* - * jQuery UI Autocomplete 1.8.16 +/*! + * jQuery UI Autocomplete 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Autocomplete#theming */ -.ui-autocomplete { position: absolute; cursor: default; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* - * jQuery UI Menu 1.8.16 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu#theming - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; } diff --git a/js/jquery/ui/themes/base/jquery.ui.base.css b/js/jquery/ui/themes/base/jquery.ui.base.css index f52ee39b9..84c950763 100755 --- a/js/jquery/ui/themes/base/jquery.ui.base.css +++ b/js/jquery/ui/themes/base/jquery.ui.base.css @@ -1,11 +1,25 @@ +/*! + * jQuery UI CSS Framework 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming + */ @import url("jquery.ui.core.css"); -@import url("jquery.ui.resizable.css"); -@import url("jquery.ui.selectable.css"); + @import url("jquery.ui.accordion.css"); @import url("jquery.ui.autocomplete.css"); @import url("jquery.ui.button.css"); -@import url("jquery.ui.dialog.css"); -@import url("jquery.ui.slider.css"); -@import url("jquery.ui.tabs.css"); @import url("jquery.ui.datepicker.css"); -@import url("jquery.ui.progressbar.css"); \ No newline at end of file +@import url("jquery.ui.dialog.css"); +@import url("jquery.ui.menu.css"); +@import url("jquery.ui.progressbar.css"); +@import url("jquery.ui.resizable.css"); +@import url("jquery.ui.selectable.css"); +@import url("jquery.ui.slider.css"); +@import url("jquery.ui.spinner.css"); +@import url("jquery.ui.tabs.css"); +@import url("jquery.ui.tooltip.css"); diff --git a/js/jquery/ui/themes/base/jquery.ui.button.css b/js/jquery/ui/themes/base/jquery.ui.button.css index 31c79f9c4..52d6c13da 100755 --- a/js/jquery/ui/themes/base/jquery.ui.button.css +++ b/js/jquery/ui/themes/base/jquery.ui.button.css @@ -1,38 +1,114 @@ -/* - * jQuery UI Button 1.8.16 +/*! + * jQuery UI Button 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Button#theming */ -.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} /* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; } +input.ui-button { + padding: .4em 1em; +} -/*button icon element(s) */ -.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } -.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} /* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.core.css b/js/jquery/ui/themes/base/jquery.ui.core.css index 375d4ad92..04d605221 100755 --- a/js/jquery/ui/themes/base/jquery.ui.core.css +++ b/js/jquery/ui/themes/base/jquery.ui.core.css @@ -1,8 +1,9 @@ -/* - * jQuery UI CSS Framework 1.8.16 +/*! + * jQuery UI CSS Framework 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API @@ -10,32 +11,83 @@ /* Layout helpers ----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} /* Interaction Cues ----------------------------------*/ -.ui-state-disabled { cursor: default !important; } +.ui-state-disabled { + cursor: default !important; +} /* Icons ----------------------------------*/ /* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} /* Misc visuals ----------------------------------*/ /* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.datepicker.css b/js/jquery/ui/themes/base/jquery.ui.datepicker.css index 28efc9469..58bc5d6cf 100755 --- a/js/jquery/ui/themes/base/jquery.ui.datepicker.css +++ b/js/jquery/ui/themes/base/jquery.ui.datepicker.css @@ -1,68 +1,178 @@ -/* - * jQuery UI Datepicker 1.8.16 +/*! + * jQuery UI Datepicker 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker#theming */ -.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width: 100%; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} /* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} /* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -} \ No newline at end of file +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.dialog.css b/js/jquery/ui/themes/base/jquery.ui.dialog.css index 1b95d7f4d..533d606c5 100755 --- a/js/jquery/ui/themes/base/jquery.ui.dialog.css +++ b/js/jquery/ui/themes/base/jquery.ui.dialog.css @@ -1,21 +1,69 @@ -/* - * jQuery UI Dialog 1.8.16 +/*! + * jQuery UI Dialog 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog#theming */ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } -.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.menu.css b/js/jquery/ui/themes/base/jquery.ui.menu.css new file mode 100755 index 000000000..c48ab33fe --- /dev/null +++ b/js/jquery/ui/themes/base/jquery.ui.menu.css @@ -0,0 +1,79 @@ +/*! + * jQuery UI Menu 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; + /* support: IE10, see #8844 */ + list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.progressbar.css b/js/jquery/ui/themes/base/jquery.ui.progressbar.css index e885ced6c..958e231cd 100755 --- a/js/jquery/ui/themes/base/jquery.ui.progressbar.css +++ b/js/jquery/ui/themes/base/jquery.ui.progressbar.css @@ -1,11 +1,28 @@ -/* - * jQuery UI Progressbar 1.8.16 +/*! + * jQuery UI Progressbar 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Progressbar#theming */ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.resizable.css b/js/jquery/ui/themes/base/jquery.ui.resizable.css index dc706797f..c46e9354e 100755 --- a/js/jquery/ui/themes/base/jquery.ui.resizable.css +++ b/js/jquery/ui/themes/base/jquery.ui.resizable.css @@ -1,20 +1,78 @@ -/* - * jQuery UI Resizable 1.8.16 +/*! + * jQuery UI Resizable 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Resizable#theming */ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.selectable.css b/js/jquery/ui/themes/base/jquery.ui.selectable.css index 2d505fbfe..274cd4427 100755 --- a/js/jquery/ui/themes/base/jquery.ui.selectable.css +++ b/js/jquery/ui/themes/base/jquery.ui.selectable.css @@ -1,10 +1,15 @@ -/* - * jQuery UI Selectable 1.8.16 +/*! + * jQuery UI Selectable 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Selectable#theming */ -.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.slider.css b/js/jquery/ui/themes/base/jquery.ui.slider.css index 982f42c58..f2d49524d 100755 --- a/js/jquery/ui/themes/base/jquery.ui.slider.css +++ b/js/jquery/ui/themes/base/jquery.ui.slider.css @@ -1,24 +1,73 @@ -/* - * jQuery UI Slider 1.8.16 +/*! + * jQuery UI Slider 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Slider#theming */ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; } \ No newline at end of file +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.spinner.css b/js/jquery/ui/themes/base/jquery.ui.spinner.css new file mode 100755 index 000000000..9a92c9f5b --- /dev/null +++ b/js/jquery/ui/themes/base/jquery.ui.spinner.css @@ -0,0 +1,65 @@ +/*! + * jQuery UI Spinner 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Spinner#theming + */ +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to overide default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertical centre icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.tabs.css b/js/jquery/ui/themes/base/jquery.ui.tabs.css index 84d27b82c..26f9c27e4 100755 --- a/js/jquery/ui/themes/base/jquery.ui.tabs.css +++ b/js/jquery/ui/themes/base/jquery.ui.tabs.css @@ -1,18 +1,52 @@ -/* - * jQuery UI Tabs 1.8.16 +/*! + * jQuery UI Tabs 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Tabs#theming */ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, +.ui-tabs .ui-tabs-nav li.ui-state-disabled a, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading a { + cursor: text; +} +.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.theme.css b/js/jquery/ui/themes/base/jquery.ui.theme.css index b251cb7b0..eef80c886 100755 --- a/js/jquery/ui/themes/base/jquery.ui.theme.css +++ b/js/jquery/ui/themes/base/jquery.ui.theme.css @@ -1,8 +1,9 @@ -/* - * jQuery UI CSS Framework 1.8.16 +/*! + * jQuery UI CSS Framework 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API @@ -13,50 +14,176 @@ /* Component containers ----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; } -.ui-widget-content a { color: #222222/*{fcContent}*/; } -.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; } -.ui-widget-header a { color: #222222/*{fcHeader}*/; } +.ui-widget { + font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; + font-size: 1.1em/*{fsDefault}*/; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #aaaaaa/*{borderColorContent}*/; + background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; + color: #222222/*{fcContent}*/; +} +.ui-widget-content a { + color: #222222/*{fcContent}*/; +} +.ui-widget-header { + border: 1px solid #aaaaaa/*{borderColorHeader}*/; + background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; + color: #222222/*{fcHeader}*/; + font-weight: bold; +} +.ui-widget-header a { + color: #222222/*{fcHeader}*/; +} /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; } -.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { background-image: -moz-linear-gradient(center top , #F9F9F9, #ECECEC); - background: -webkit-gradient(linear, center top ,center bottom, from(#F9F9F9), to(#ECECEC)) repeat scroll 0 0 transparent; color: #212121/*{fcActive}*/; text-decoration: none; } -.ui-widget :active { outline: none; } +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #d3d3d3/*{borderColorDefault}*/; + background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; + font-weight: normal/*{fwDefault}*/; + color: #555555/*{fcDefault}*/; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #555555/*{fcDefault}*/; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #999999/*{borderColorHover}*/; + background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; + font-weight: normal/*{fwDefault}*/; + color: #212121/*{fcHover}*/; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited { + color: #212121/*{fcHover}*/; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #aaaaaa/*{borderColorActive}*/; + background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; + font-weight: normal/*{fwDefault}*/; + color: #212121/*{fcActive}*/; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121/*{fcActive}*/; + text-decoration: none; +} /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1/*{borderColorHighlight}*/; + background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; + color: #363636/*{fcHighlight}*/; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636/*{fcHighlight}*/; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a/*{borderColorError}*/; + background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; + color: #cd0a0a/*{fcError}*/; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a/*{fcError}*/; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a/*{fcError}*/; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} /* Icons ----------------------------------*/ /* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; } +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; +} +.ui-widget-header .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; +} +.ui-state-default .ui-icon { + background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; +} +.ui-state-active .ui-icon { + background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; +} +.ui-state-highlight .ui-icon { + background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; +} /* positioning */ +.ui-icon-blank { background-position: 16px 16px; } .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } @@ -183,8 +310,8 @@ .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-play { background-position: 0 -160px; } @@ -238,11 +365,42 @@ ----------------------------------*/ /* Corner radius */ -.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; } -.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px/*{cornerRadius}*/; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px/*{cornerRadius}*/; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px/*{cornerRadius}*/; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px/*{cornerRadius}*/; +} /* Overlays */ -.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; } -.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file +.ui-widget-overlay { + background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; + opacity: .3/*{opacityOverlay}*/; + filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/; +} +.ui-widget-shadow { + margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; + padding: 8px/*{thicknessShadow}*/; + background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; + opacity: .3/*{opacityShadow}*/; + filter: Alpha(Opacity=30)/*{opacityFilterShadow}*/; + border-radius: 8px/*{cornerRadiusShadow}*/; +} diff --git a/js/jquery/ui/themes/base/jquery.ui.tooltip.css b/js/jquery/ui/themes/base/jquery.ui.tooltip.css new file mode 100755 index 000000000..d7632a428 --- /dev/null +++ b/js/jquery/ui/themes/base/jquery.ui.tooltip.css @@ -0,0 +1,19 @@ +/*! + * jQuery UI Tooltip 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} diff --git a/js/jquery/ui/themes/base/minified/images/animated-overlay.gif b/js/jquery/ui/themes/base/minified/images/animated-overlay.gif new file mode 100755 index 000000000..d441f75eb Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/animated-overlay.gif differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png b/js/jquery/ui/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100755 index 000000000..5b5dab2ab Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png b/js/jquery/ui/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100755 index 000000000..ac8b229af Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100755 index 000000000..ad3d6346e Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100755 index 000000000..42ccba269 Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png new file mode 100755 index 000000000..5a46b47cb Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100755 index 000000000..86c2baa65 Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100755 index 000000000..4443fdc1a Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/js/jquery/ui/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100755 index 000000000..7c9fa6c6e Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-icons_222222_256x240.png b/js/jquery/ui/themes/base/minified/images/ui-icons_222222_256x240.png new file mode 100755 index 000000000..ee039dc09 Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-icons_222222_256x240.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-icons_2e83ff_256x240.png b/js/jquery/ui/themes/base/minified/images/ui-icons_2e83ff_256x240.png new file mode 100755 index 000000000..45e8928e5 Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-icons_2e83ff_256x240.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-icons_454545_256x240.png b/js/jquery/ui/themes/base/minified/images/ui-icons_454545_256x240.png new file mode 100755 index 000000000..7ec70d11b Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-icons_454545_256x240.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-icons_888888_256x240.png b/js/jquery/ui/themes/base/minified/images/ui-icons_888888_256x240.png new file mode 100755 index 000000000..5ba708c39 Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-icons_888888_256x240.png differ diff --git a/js/jquery/ui/themes/base/minified/images/ui-icons_cd0a0a_256x240.png b/js/jquery/ui/themes/base/minified/images/ui-icons_cd0a0a_256x240.png new file mode 100755 index 000000000..7930a5580 Binary files /dev/null and b/js/jquery/ui/themes/base/minified/images/ui-icons_cd0a0a_256x240.png differ diff --git a/js/jquery/ui/themes/base/minified/jquery-ui.min.css b/js/jquery/ui/themes/base/minified/jquery-ui.min.css new file mode 100755 index 000000000..fde15dd78 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery-ui.min.css @@ -0,0 +1,10 @@ +/*! jQuery UI - v1.10.3 - 2013-06-25 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ + +.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-menu .ui-state-disabled{font-weight:400;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(images/animated-overlay.gif);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.accordion.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.accordion.min.css new file mode 100755 index 000000000..558df17f8 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.accordion.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.autocomplete.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.autocomplete.min.css new file mode 100755 index 000000000..8905772fe --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.autocomplete.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-autocomplete{position:absolute;top:0;left:0;cursor:default} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.button.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.button.min.css new file mode 100755 index 000000000..828674984 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.button.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.core.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.core.min.css new file mode 100755 index 000000000..006708eb2 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.core.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.datepicker.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.datepicker.min.css new file mode 100755 index 000000000..fb6102c1c --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.datepicker.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.dialog.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.dialog.min.css new file mode 100755 index 000000000..3aa3f4a81 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.dialog.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.menu.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.menu.min.css new file mode 100755 index 000000000..dea8be9b0 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.menu.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-menu .ui-state-disabled{font-weight:400;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.progressbar.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.progressbar.min.css new file mode 100755 index 000000000..bd3bdc115 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.progressbar.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(images/animated-overlay.gif);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.resizable.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.resizable.min.css new file mode 100755 index 000000000..598d23636 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.resizable.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.selectable.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.selectable.min.css new file mode 100755 index 000000000..fe5970c69 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.selectable.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.slider.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.slider.min.css new file mode 100755 index 000000000..a552fde6f --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.slider.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.spinner.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.spinner.min.css new file mode 100755 index 000000000..d1bf66eba --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.spinner.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.tabs.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.tabs.min.css new file mode 100755 index 000000000..032a32a00 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.tabs.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.theme.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.theme.min.css new file mode 100755 index 000000000..9ecb2f187 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.theme.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-widget{font-family:Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #aaa;background:#fff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x;color:#222}.ui-widget-content a{color:#222}.ui-widget-header{border:1px solid #aaa;background:#ccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x;color:#222;font-weight:700}.ui-widget-header a{color:#222}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #d3d3d3;background:#e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x;font-weight:400;color:#555}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#555;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #999;background:#dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#212121;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #aaa;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:400;color:#212121}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#212121;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fcefa1;background:#fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x;color:#cd0a0a}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#cd0a0a}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#cd0a0a}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:700}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:400}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_888888_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_454545_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_2e83ff_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_cd0a0a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30)}.ui-widget-shadow{margin:-8px 0 0 -8px;padding:8px;background:#aaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x;opacity:.3;filter:Alpha(Opacity=30);border-radius:8px} \ No newline at end of file diff --git a/js/jquery/ui/themes/base/minified/jquery.ui.tooltip.min.css b/js/jquery/ui/themes/base/minified/jquery.ui.tooltip.min.css new file mode 100755 index 000000000..dc7789323 --- /dev/null +++ b/js/jquery/ui/themes/base/minified/jquery.ui.tooltip.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px} \ No newline at end of file diff --git a/js/jquery/ui/themes/index.php b/js/jquery/ui/themes/index.php index 88e934d59..195fab225 100644 --- a/js/jquery/ui/themes/index.php +++ b/js/jquery/ui/themes/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/jquery/ui/themes/ui-lightness/images/animated-overlay.gif b/js/jquery/ui/themes/ui-lightness/images/animated-overlay.gif new file mode 100755 index 000000000..d441f75eb Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/images/animated-overlay.gif differ diff --git a/js/jquery/ui/themes/ui-lightness/images/index.php b/js/jquery/ui/themes/ui-lightness/images/index.php index 88e934d59..195fab225 100644 --- a/js/jquery/ui/themes/ui-lightness/images/index.php +++ b/js/jquery/ui/themes/ui-lightness/images/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/js/jquery/ui/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png index 954e22dbd..3062186b0 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png and b/js/jquery/ui/themes/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png b/js/jquery/ui/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png index 64ece5707..208e40e6a 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png and b/js/jquery/ui/themes/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png b/js/jquery/ui/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png index abdc01082..eae5ff212 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png and b/js/jquery/ui/themes/ui-lightness/images/ui-bg_flat_10_000000_40x100.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png b/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png index 9b383f4d2..de47ca7f2 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png and b/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png b/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png index a23baad25..6905a9a8c 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png and b/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png b/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png index 42ccba269..a5f4f7458 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png and b/js/jquery/ui/themes/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/js/jquery/ui/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png index 39d5824d6..ed19bc550 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png and b/js/jquery/ui/themes/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/js/jquery/ui/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png index f1273672d..0198dfd14 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png and b/js/jquery/ui/themes/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/js/jquery/ui/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png index 359397acf..7d5ed20d6 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png and b/js/jquery/ui/themes/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-icons_222222_256x240.png b/js/jquery/ui/themes/ui-lightness/images/ui-icons_222222_256x240.png index b273ff111..c1cb1170c 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-icons_222222_256x240.png and b/js/jquery/ui/themes/ui-lightness/images/ui-icons_222222_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-icons_228ef1_256x240.png b/js/jquery/ui/themes/ui-lightness/images/ui-icons_228ef1_256x240.png index a641a371a..3a0140cff 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-icons_228ef1_256x240.png and b/js/jquery/ui/themes/ui-lightness/images/ui-icons_228ef1_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png b/js/jquery/ui/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png index 85e63e9f6..036ee072d 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png and b/js/jquery/ui/themes/ui-lightness/images/ui-icons_ef8c08_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png b/js/jquery/ui/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png index e117effa3..8b6c05868 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png and b/js/jquery/ui/themes/ui-lightness/images/ui-icons_ffd27a_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/images/ui-icons_ffffff_256x240.png b/js/jquery/ui/themes/ui-lightness/images/ui-icons_ffffff_256x240.png index 42f8f992c..4f624bb2b 100755 Binary files a/js/jquery/ui/themes/ui-lightness/images/ui-icons_ffffff_256x240.png and b/js/jquery/ui/themes/ui-lightness/images/ui-icons_ffffff_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/index.php b/js/jquery/ui/themes/ui-lightness/index.php index 88e934d59..195fab225 100644 --- a/js/jquery/ui/themes/ui-lightness/index.php +++ b/js/jquery/ui/themes/ui-lightness/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/jquery/ui/themes/ui-lightness/jquery-ui.css b/js/jquery/ui/themes/ui-lightness/jquery-ui.css new file mode 100755 index 000000000..7b0853a9f --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/jquery-ui.css @@ -0,0 +1,1177 @@ +/*! jQuery UI - v1.10.3 - 2013-06-25 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px +* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; +} + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} + +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} +/* no icon support for input elements, provide padding by default */ +input.ui-button { + padding: .4em 1em; +} + +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} + +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} + +/* workarounds */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width: 100%; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} + +/* RTL support */ +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; + /* support: IE10, see #8844 */ + list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} + +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} + +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to overide default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertical centre icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, +.ui-tabs .ui-tabs-nav li.ui-state-disabled a, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading a { + cursor: text; +} +.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #dddddd; + background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; + color: #333333; +} +.ui-widget-content a { + color: #333333; +} +.ui-widget-header { + border: 1px solid #e78f08; + background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; + color: #ffffff; + font-weight: bold; +} +.ui-widget-header a { + color: #ffffff; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #cccccc; + background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; + font-weight: bold; + color: #1c94c4; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #1c94c4; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #fbcb09; + background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; + font-weight: bold; + color: #c77405; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited { + color: #c77405; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #fbd850; + background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; + font-weight: bold; + color: #eb8f00; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #eb8f00; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fed22f; + background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; + color: #363636; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; + color: #ffffff; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #ffffff; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #ffffff; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-widget-header .ui-icon { + background-image: url(images/ui-icons_ffffff_256x240.png); +} +.ui-state-default .ui-icon { + background-image: url(images/ui-icons_ef8c08_256x240.png); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url(images/ui-icons_ef8c08_256x240.png); +} +.ui-state-active .ui-icon { + background-image: url(images/ui-icons_ef8c08_256x240.png); +} +.ui-state-highlight .ui-icon { + background-image: url(images/ui-icons_228ef1_256x240.png); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url(images/ui-icons_ffd27a_256x240.png); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; + opacity: .5; + filter: Alpha(Opacity=50); +} +.ui-widget-shadow { + margin: -5px 0 0 -5px; + padding: 5px; + background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; + opacity: .2; + filter: Alpha(Opacity=20); + border-radius: 5px; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.accordion.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.accordion.css index 327beb50e..d36f9109b 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.accordion.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.accordion.css @@ -1,19 +1,38 @@ -/* - * jQuery UI Accordion 1.8.16 +/*! + * jQuery UI Accordion 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Accordion#theming */ -/* IE/Win - Fix animation bug - #4615 */ -.ui-accordion { width: 100%; } -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; } +.ui-accordion .ui-accordion-header { + display: block; + cursor: pointer; + position: relative; + margin-top: 2px; + padding: .5em .5em .5em .7em; + min-height: 0; /* support: IE7 */ +} +.ui-accordion .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-noicons { + padding-left: .7em; +} +.ui-accordion .ui-accordion-icons .ui-accordion-icons { + padding-left: 2.2em; +} +.ui-accordion .ui-accordion-header .ui-accordion-header-icon { + position: absolute; + left: .5em; + top: 50%; + margin-top: -8px; +} +.ui-accordion .ui-accordion-content { + padding: 1em 2.2em; + border-top: 0; + overflow: auto; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.all.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.all.css index bf68bc41e..a0df16932 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.all.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.all.css @@ -1,8 +1,9 @@ -/* - * jQuery UI CSS Framework 1.8.16 +/*! + * jQuery UI CSS Framework 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.autocomplete.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.autocomplete.css index 6de686736..5e2c75030 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.autocomplete.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.autocomplete.css @@ -1,53 +1,16 @@ -/* - * jQuery UI Autocomplete 1.8.16 +/*! + * jQuery UI Autocomplete 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Autocomplete#theming */ -.ui-autocomplete { position: absolute; cursor: default; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* - * jQuery UI Menu 1.8.16 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu#theming - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; } diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.base.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.base.css index f52ee39b9..84c950763 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.base.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.base.css @@ -1,11 +1,25 @@ +/*! + * jQuery UI CSS Framework 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming + */ @import url("jquery.ui.core.css"); -@import url("jquery.ui.resizable.css"); -@import url("jquery.ui.selectable.css"); + @import url("jquery.ui.accordion.css"); @import url("jquery.ui.autocomplete.css"); @import url("jquery.ui.button.css"); -@import url("jquery.ui.dialog.css"); -@import url("jquery.ui.slider.css"); -@import url("jquery.ui.tabs.css"); @import url("jquery.ui.datepicker.css"); -@import url("jquery.ui.progressbar.css"); \ No newline at end of file +@import url("jquery.ui.dialog.css"); +@import url("jquery.ui.menu.css"); +@import url("jquery.ui.progressbar.css"); +@import url("jquery.ui.resizable.css"); +@import url("jquery.ui.selectable.css"); +@import url("jquery.ui.slider.css"); +@import url("jquery.ui.spinner.css"); +@import url("jquery.ui.tabs.css"); +@import url("jquery.ui.tooltip.css"); diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.button.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.button.css index 31c79f9c4..52d6c13da 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.button.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.button.css @@ -1,38 +1,114 @@ -/* - * jQuery UI Button 1.8.16 +/*! + * jQuery UI Button 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Button#theming */ -.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } +.ui-button { + display: inline-block; + position: relative; + padding: 0; + line-height: normal; + margin-right: .1em; + cursor: pointer; + vertical-align: middle; + text-align: center; + overflow: visible; /* removes extra width in IE */ +} +.ui-button, +.ui-button:link, +.ui-button:visited, +.ui-button:hover, +.ui-button:active { + text-decoration: none; +} +/* to make room for the icon, a width needs to be set here */ +.ui-button-icon-only { + width: 2.2em; +} +/* button elements seem to need a little more width */ +button.ui-button-icon-only { + width: 2.4em; +} +.ui-button-icons-only { + width: 3.4em; +} +button.ui-button-icons-only { + width: 3.7em; +} -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* button text element */ +.ui-button .ui-button-text { + display: block; + line-height: normal; +} +.ui-button-text-only .ui-button-text { + padding: .4em 1em; +} +.ui-button-icon-only .ui-button-text, +.ui-button-icons-only .ui-button-text { + padding: .4em; + text-indent: -9999999px; +} +.ui-button-text-icon-primary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 1em .4em 2.1em; +} +.ui-button-text-icon-secondary .ui-button-text, +.ui-button-text-icons .ui-button-text { + padding: .4em 2.1em .4em 1em; +} +.ui-button-text-icons .ui-button-text { + padding-left: 2.1em; + padding-right: 2.1em; +} /* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; } +input.ui-button { + padding: .4em 1em; +} -/*button icon element(s) */ -.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } -.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +/* button icon element(s) */ +.ui-button-icon-only .ui-icon, +.ui-button-text-icon-primary .ui-icon, +.ui-button-text-icon-secondary .ui-icon, +.ui-button-text-icons .ui-icon, +.ui-button-icons-only .ui-icon { + position: absolute; + top: 50%; + margin-top: -8px; +} +.ui-button-icon-only .ui-icon { + left: 50%; + margin-left: -8px; +} +.ui-button-text-icon-primary .ui-button-icon-primary, +.ui-button-text-icons .ui-button-icon-primary, +.ui-button-icons-only .ui-button-icon-primary { + left: .5em; +} +.ui-button-text-icon-secondary .ui-button-icon-secondary, +.ui-button-text-icons .ui-button-icon-secondary, +.ui-button-icons-only .ui-button-icon-secondary { + right: .5em; +} -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } +/* button sets */ +.ui-buttonset { + margin-right: 7px; +} +.ui-buttonset .ui-button { + margin-left: 0; + margin-right: -.3em; +} /* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* reset extra padding in Firefox, see h5bp.com/l */ +input.ui-button::-moz-focus-inner, +button.ui-button::-moz-focus-inner { + border: 0; + padding: 0; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.core.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.core.css index 375d4ad92..04d605221 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.core.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.core.css @@ -1,8 +1,9 @@ -/* - * jQuery UI CSS Framework 1.8.16 +/*! + * jQuery UI CSS Framework 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API @@ -10,32 +11,83 @@ /* Layout helpers ----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-clearfix { + min-height: 0; /* support: IE7 */ +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); +} + +.ui-front { + z-index: 100; +} /* Interaction Cues ----------------------------------*/ -.ui-state-disabled { cursor: default !important; } +.ui-state-disabled { + cursor: default !important; +} /* Icons ----------------------------------*/ /* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } +.ui-icon { + display: block; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} /* Misc visuals ----------------------------------*/ /* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.datepicker.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.datepicker.css index 28efc9469..58bc5d6cf 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.datepicker.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.datepicker.css @@ -1,68 +1,178 @@ -/* - * jQuery UI Datepicker 1.8.16 +/*! + * jQuery UI Datepicker 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Datepicker#theming */ -.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } +.ui-datepicker { + width: 17em; + padding: .2em .2em 0; + display: none; +} +.ui-datepicker .ui-datepicker-header { + position: relative; + padding: .2em 0; +} +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + position: absolute; + top: 2px; + width: 1.8em; + height: 1.8em; +} +.ui-datepicker .ui-datepicker-prev-hover, +.ui-datepicker .ui-datepicker-next-hover { + top: 1px; +} +.ui-datepicker .ui-datepicker-prev { + left: 2px; +} +.ui-datepicker .ui-datepicker-next { + right: 2px; +} +.ui-datepicker .ui-datepicker-prev-hover { + left: 1px; +} +.ui-datepicker .ui-datepicker-next-hover { + right: 1px; +} +.ui-datepicker .ui-datepicker-prev span, +.ui-datepicker .ui-datepicker-next span { + display: block; + position: absolute; + left: 50%; + margin-left: -8px; + top: 50%; + margin-top: -8px; +} +.ui-datepicker .ui-datepicker-title { + margin: 0 2.3em; + line-height: 1.8em; + text-align: center; +} +.ui-datepicker .ui-datepicker-title select { + font-size: 1em; + margin: 1px 0; +} +.ui-datepicker select.ui-datepicker-month-year { + width: 100%; +} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + width: 49%; +} +.ui-datepicker table { + width: 100%; + font-size: .9em; + border-collapse: collapse; + margin: 0 0 .4em; +} +.ui-datepicker th { + padding: .7em .3em; + text-align: center; + font-weight: bold; + border: 0; +} +.ui-datepicker td { + border: 0; + padding: 1px; +} +.ui-datepicker td span, +.ui-datepicker td a { + display: block; + padding: .2em; + text-align: right; + text-decoration: none; +} +.ui-datepicker .ui-datepicker-buttonpane { + background-image: none; + margin: .7em 0 0 0; + padding: 0 .2em; + border-left: 0; + border-right: 0; + border-bottom: 0; +} +.ui-datepicker .ui-datepicker-buttonpane button { + float: right; + margin: .5em .2em .4em; + cursor: pointer; + padding: .2em .6em .3em .6em; + width: auto; + overflow: visible; +} +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { + float: left; +} /* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } +.ui-datepicker.ui-datepicker-multi { + width: auto; +} +.ui-datepicker-multi .ui-datepicker-group { + float: left; +} +.ui-datepicker-multi .ui-datepicker-group table { + width: 95%; + margin: 0 auto .4em; +} +.ui-datepicker-multi-2 .ui-datepicker-group { + width: 50%; +} +.ui-datepicker-multi-3 .ui-datepicker-group { + width: 33.3%; +} +.ui-datepicker-multi-4 .ui-datepicker-group { + width: 25%; +} +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { + border-left-width: 0; +} +.ui-datepicker-multi .ui-datepicker-buttonpane { + clear: left; +} +.ui-datepicker-row-break { + clear: both; + width: 100%; + font-size: 0; +} /* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -} \ No newline at end of file +.ui-datepicker-rtl { + direction: rtl; +} +.ui-datepicker-rtl .ui-datepicker-prev { + right: 2px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next { + left: 2px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-prev:hover { + right: 1px; + left: auto; +} +.ui-datepicker-rtl .ui-datepicker-next:hover { + left: 1px; + right: auto; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane { + clear: right; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button { + float: left; +} +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current, +.ui-datepicker-rtl .ui-datepicker-group { + float: right; +} +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header, +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { + border-right-width: 0; + border-left-width: 1px; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.dialog.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.dialog.css index 1b95d7f4d..533d606c5 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.dialog.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.dialog.css @@ -1,21 +1,69 @@ -/* - * jQuery UI Dialog 1.8.16 +/*! + * jQuery UI Dialog 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Dialog#theming */ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } -.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } +.ui-dialog { + position: absolute; + top: 0; + left: 0; + padding: .2em; + outline: 0; +} +.ui-dialog .ui-dialog-titlebar { + padding: .4em 1em; + position: relative; +} +.ui-dialog .ui-dialog-title { + float: left; + margin: .1em 0; + white-space: nowrap; + width: 90%; + overflow: hidden; + text-overflow: ellipsis; +} +.ui-dialog .ui-dialog-titlebar-close { + position: absolute; + right: .3em; + top: 50%; + width: 21px; + margin: -10px 0 0 0; + padding: 1px; + height: 20px; +} +.ui-dialog .ui-dialog-content { + position: relative; + border: 0; + padding: .5em 1em; + background: none; + overflow: auto; +} +.ui-dialog .ui-dialog-buttonpane { + text-align: left; + border-width: 1px 0 0 0; + background-image: none; + margin-top: .5em; + padding: .3em 1em .5em .4em; +} +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: right; +} +.ui-dialog .ui-dialog-buttonpane button { + margin: .5em .4em .5em 0; + cursor: pointer; +} +.ui-dialog .ui-resizable-se { + width: 12px; + height: 12px; + right: -5px; + bottom: -5px; + background-position: 16px 16px; +} +.ui-draggable .ui-dialog-titlebar { + cursor: move; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.menu.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.menu.css new file mode 100755 index 000000000..c48ab33fe --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.menu.css @@ -0,0 +1,79 @@ +/*! + * jQuery UI Menu 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style: none; + padding: 2px; + margin: 0; + display: block; + outline: none; +} +.ui-menu .ui-menu { + margin-top: -3px; + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + padding: 0; + width: 100%; + /* support: IE10, see #8844 */ + list-style-image: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); +} +.ui-menu .ui-menu-divider { + margin: 5px -2px 5px -2px; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-menu-item a { + text-decoration: none; + display: block; + padding: 2px .4em; + line-height: 1.5; + min-height: 0; /* support: IE7 */ + font-weight: normal; +} +.ui-menu .ui-menu-item a.ui-state-focus, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} + +.ui-menu .ui-state-disabled { + font-weight: normal; + margin: .4em 0 .2em; + line-height: 1.5; +} +.ui-menu .ui-state-disabled a { + cursor: default; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item a { + position: relative; + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: .2em; + left: .2em; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + position: static; + float: right; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.progressbar.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.progressbar.css index e885ced6c..958e231cd 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.progressbar.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.progressbar.css @@ -1,11 +1,28 @@ -/* - * jQuery UI Progressbar 1.8.16 +/*! + * jQuery UI Progressbar 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Progressbar#theming */ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file +.ui-progressbar { + height: 2em; + text-align: left; + overflow: hidden; +} +.ui-progressbar .ui-progressbar-value { + margin: -1px; + height: 100%; +} +.ui-progressbar .ui-progressbar-overlay { + background: url("images/animated-overlay.gif"); + height: 100%; + filter: alpha(opacity=25); + opacity: 0.25; +} +.ui-progressbar-indeterminate .ui-progressbar-value { + background-image: none; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.resizable.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.resizable.css index dc706797f..c46e9354e 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.resizable.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.resizable.css @@ -1,20 +1,78 @@ -/* - * jQuery UI Resizable 1.8.16 +/*! + * jQuery UI Resizable 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Resizable#theming */ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file +.ui-resizable { + position: relative; +} +.ui-resizable-handle { + position: absolute; + font-size: 0.1px; + display: block; +} +.ui-resizable-disabled .ui-resizable-handle, +.ui-resizable-autohide .ui-resizable-handle { + display: none; +} +.ui-resizable-n { + cursor: n-resize; + height: 7px; + width: 100%; + top: -5px; + left: 0; +} +.ui-resizable-s { + cursor: s-resize; + height: 7px; + width: 100%; + bottom: -5px; + left: 0; +} +.ui-resizable-e { + cursor: e-resize; + width: 7px; + right: -5px; + top: 0; + height: 100%; +} +.ui-resizable-w { + cursor: w-resize; + width: 7px; + left: -5px; + top: 0; + height: 100%; +} +.ui-resizable-se { + cursor: se-resize; + width: 12px; + height: 12px; + right: 1px; + bottom: 1px; +} +.ui-resizable-sw { + cursor: sw-resize; + width: 9px; + height: 9px; + left: -5px; + bottom: -5px; +} +.ui-resizable-nw { + cursor: nw-resize; + width: 9px; + height: 9px; + left: -5px; + top: -5px; +} +.ui-resizable-ne { + cursor: ne-resize; + width: 9px; + height: 9px; + right: -5px; + top: -5px; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.selectable.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.selectable.css index 2d505fbfe..274cd4427 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.selectable.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.selectable.css @@ -1,10 +1,15 @@ -/* - * jQuery UI Selectable 1.8.16 +/*! + * jQuery UI Selectable 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Selectable#theming */ -.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +.ui-selectable-helper { + position: absolute; + z-index: 100; + border: 1px dotted black; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.slider.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.slider.css index 982f42c58..f2d49524d 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.slider.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.slider.css @@ -1,24 +1,73 @@ -/* - * jQuery UI Slider 1.8.16 +/*! + * jQuery UI Slider 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Slider#theming */ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } +.ui-slider { + position: relative; + text-align: left; +} +.ui-slider .ui-slider-handle { + position: absolute; + z-index: 2; + width: 1.2em; + height: 1.2em; + cursor: default; +} +.ui-slider .ui-slider-range { + position: absolute; + z-index: 1; + font-size: .7em; + display: block; + border: 0; + background-position: 0 0; +} -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } +/* For IE8 - See #6727 */ +.ui-slider.ui-state-disabled .ui-slider-handle, +.ui-slider.ui-state-disabled .ui-slider-range { + filter: inherit; +} -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; } \ No newline at end of file +.ui-slider-horizontal { + height: .8em; +} +.ui-slider-horizontal .ui-slider-handle { + top: -.3em; + margin-left: -.6em; +} +.ui-slider-horizontal .ui-slider-range { + top: 0; + height: 100%; +} +.ui-slider-horizontal .ui-slider-range-min { + left: 0; +} +.ui-slider-horizontal .ui-slider-range-max { + right: 0; +} + +.ui-slider-vertical { + width: .8em; + height: 100px; +} +.ui-slider-vertical .ui-slider-handle { + left: -.3em; + margin-left: 0; + margin-bottom: -.6em; +} +.ui-slider-vertical .ui-slider-range { + left: 0; + width: 100%; +} +.ui-slider-vertical .ui-slider-range-min { + bottom: 0; +} +.ui-slider-vertical .ui-slider-range-max { + top: 0; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.spinner.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.spinner.css new file mode 100755 index 000000000..9a92c9f5b --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.spinner.css @@ -0,0 +1,65 @@ +/*! + * jQuery UI Spinner 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Spinner#theming + */ +.ui-spinner { + position: relative; + display: inline-block; + overflow: hidden; + padding: 0; + vertical-align: middle; +} +.ui-spinner-input { + border: none; + background: none; + color: inherit; + padding: 0; + margin: .2em 0; + vertical-align: middle; + margin-left: .4em; + margin-right: 22px; +} +.ui-spinner-button { + width: 16px; + height: 50%; + font-size: .5em; + padding: 0; + margin: 0; + text-align: center; + position: absolute; + cursor: default; + display: block; + overflow: hidden; + right: 0; +} +/* more specificity required here to overide default borders */ +.ui-spinner a.ui-spinner-button { + border-top: none; + border-bottom: none; + border-right: none; +} +/* vertical centre icon */ +.ui-spinner .ui-icon { + position: absolute; + margin-top: -8px; + top: 50%; + left: 0; +} +.ui-spinner-up { + top: 0; +} +.ui-spinner-down { + bottom: 0; +} + +/* TR overrides */ +.ui-spinner .ui-icon-triangle-1-s { + /* need to fix icons sprite */ + background-position: -65px -16px; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.tabs.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.tabs.css index 84d27b82c..26f9c27e4 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.tabs.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.tabs.css @@ -1,18 +1,52 @@ -/* - * jQuery UI Tabs 1.8.16 +/*! + * jQuery UI Tabs 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Tabs#theming */ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } +.ui-tabs { + position: relative;/* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ + padding: .2em; +} +.ui-tabs .ui-tabs-nav { + margin: 0; + padding: .2em .2em 0; +} +.ui-tabs .ui-tabs-nav li { + list-style: none; + float: left; + position: relative; + top: 0; + margin: 1px .2em 0 0; + border-bottom-width: 0; + padding: 0; + white-space: nowrap; +} +.ui-tabs .ui-tabs-nav li a { + float: left; + padding: .5em 1em; + text-decoration: none; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active { + margin-bottom: -1px; + padding-bottom: 1px; +} +.ui-tabs .ui-tabs-nav li.ui-tabs-active a, +.ui-tabs .ui-tabs-nav li.ui-state-disabled a, +.ui-tabs .ui-tabs-nav li.ui-tabs-loading a { + cursor: text; +} +.ui-tabs .ui-tabs-nav li a, /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a { + cursor: pointer; +} +.ui-tabs .ui-tabs-panel { + display: block; + border-width: 0; + padding: 1em 1.4em; + background: none; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.theme.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.theme.css index 545b28353..a28a6626a 100755 --- a/js/jquery/ui/themes/ui-lightness/jquery.ui.theme.css +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.theme.css @@ -1,63 +1,189 @@ - - -/* - * jQuery UI CSS Framework 1.8.16 +/*! + * jQuery UI CSS Framework 1.10.3 + * http://jqueryui.com * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. * http://jquery.org/license * * http://docs.jquery.com/UI/Theming/API * - * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS,%20Tahoma,%20Verdana,%20Arial,%20sans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=12_gloss_wave.png&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=03_highlight_soft.png&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=02_glass.png&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=03_highlight_soft.png&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=08_diagonals_thick.png&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=01_flat.png&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px */ /* Component containers ----------------------------------*/ -.ui-widget { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Trebuchet MS, Tahoma, Verdana, Arial, sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #dddddd; background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; color: #333333; } -.ui-widget-content a { color: #333333; } -.ui-widget-header { border: 1px solid #e78f08; background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; color: #ffffff; font-weight: bold; } -.ui-widget-header a { color: #ffffff; } +.ui-widget { + font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Trebuchet MS,Tahoma,Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget-content { + border: 1px solid #dddddd; + background: #eeeeee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x; + color: #333333; +} +.ui-widget-content a { + color: #333333; +} +.ui-widget-header { + border: 1px solid #e78f08; + background: #f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; + color: #ffffff; + font-weight: bold; +} +.ui-widget-header a { + color: #ffffff; +} /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #cccccc; background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #1c94c4; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #1c94c4; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #fbcb09; background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #c77405; } -.ui-state-hover a, .ui-state-hover a:hover { color: #c77405; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #fbd850; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: bold; color: #eb8f00; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #eb8f00; text-decoration: none; } -.ui-widget :active { outline: none; } +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default { + border: 1px solid #cccccc; + background: #f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x; + font-weight: bold; + color: #1c94c4; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited { + color: #1c94c4; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus { + border: 1px solid #fbcb09; + background: #fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x; + font-weight: bold; + color: #c77405; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited { + color: #c77405; + text-decoration: none; +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active { + border: 1px solid #fbd850; + background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; + font-weight: bold; + color: #eb8f00; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #eb8f00; + text-decoration: none; +} /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fed22f; background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; color: #ffffff; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fed22f; + background: #ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x; + color: #363636; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat; + color: #ffffff; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #ffffff; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #ffffff; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* For IE8 - See #6059 */ +} /* Icons ----------------------------------*/ /* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_ef8c08_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_228ef1_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffd27a_256x240.png); } +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url(images/ui-icons_222222_256x240.png); +} +.ui-widget-header .ui-icon { + background-image: url(images/ui-icons_ffffff_256x240.png); +} +.ui-state-default .ui-icon { + background-image: url(images/ui-icons_ef8c08_256x240.png); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon { + background-image: url(images/ui-icons_ef8c08_256x240.png); +} +.ui-state-active .ui-icon { + background-image: url(images/ui-icons_ef8c08_256x240.png); +} +.ui-state-highlight .ui-icon { + background-image: url(images/ui-icons_228ef1_256x240.png); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url(images/ui-icons_ffd27a_256x240.png); +} /* positioning */ +.ui-icon-blank { background-position: 16px 16px; } .ui-icon-carat-1-n { background-position: 0 0; } .ui-icon-carat-1-ne { background-position: -16px 0; } .ui-icon-carat-1-e { background-position: -32px 0; } @@ -184,8 +310,8 @@ .ui-icon-help { background-position: -48px -144px; } .ui-icon-check { background-position: -64px -144px; } .ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } .ui-icon-pin-w { background-position: -128px -144px; } .ui-icon-pin-s { background-position: -144px -144px; } .ui-icon-play { background-position: 0 -160px; } @@ -239,11 +365,42 @@ ----------------------------------*/ /* Corner radius */ -.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} /* Overlays */ -.ui-widget-overlay { background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; opacity: .50;filter:Alpha(Opacity=50); } -.ui-widget-shadow { margin: -5px 0 0 -5px; padding: 5px; background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; opacity: .20;filter:Alpha(Opacity=20); -moz-border-radius: 5px; -khtml-border-radius: 5px; -webkit-border-radius: 5px; border-radius: 5px; } \ No newline at end of file +.ui-widget-overlay { + background: #666666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat; + opacity: .5; + filter: Alpha(Opacity=50); +} +.ui-widget-shadow { + margin: -5px 0 0 -5px; + padding: 5px; + background: #000000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x; + opacity: .2; + filter: Alpha(Opacity=20); + border-radius: 5px; +} diff --git a/js/jquery/ui/themes/ui-lightness/jquery.ui.tooltip.css b/js/jquery/ui/themes/ui-lightness/jquery.ui.tooltip.css new file mode 100755 index 000000000..d7632a428 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/jquery.ui.tooltip.css @@ -0,0 +1,19 @@ +/*! + * jQuery UI Tooltip 1.10.3 + * http://jqueryui.com + * + * Copyright 2013 jQuery Foundation and other contributors + * Released under the MIT license. + * http://jquery.org/license + */ +.ui-tooltip { + padding: 8px; + position: absolute; + z-index: 9999; + max-width: 300px; + -webkit-box-shadow: 0 0 5px #aaa; + box-shadow: 0 0 5px #aaa; +} +body .ui-tooltip { + border-width: 2px; +} diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/animated-overlay.gif b/js/jquery/ui/themes/ui-lightness/minified/images/animated-overlay.gif new file mode 100755 index 000000000..d441f75eb Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/animated-overlay.gif differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_diagonals-thick_18_b81900_40x40.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_diagonals-thick_18_b81900_40x40.png new file mode 100755 index 000000000..3062186b0 Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_diagonals-thick_18_b81900_40x40.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_diagonals-thick_20_666666_40x40.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_diagonals-thick_20_666666_40x40.png new file mode 100755 index 000000000..208e40e6a Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_diagonals-thick_20_666666_40x40.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_flat_10_000000_40x100.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_flat_10_000000_40x100.png new file mode 100755 index 000000000..eae5ff212 Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_flat_10_000000_40x100.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_glass_100_f6f6f6_1x400.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_glass_100_f6f6f6_1x400.png new file mode 100755 index 000000000..de47ca7f2 Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_glass_100_f6f6f6_1x400.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_glass_100_fdf5ce_1x400.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_glass_100_fdf5ce_1x400.png new file mode 100755 index 000000000..6905a9a8c Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_glass_100_fdf5ce_1x400.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_glass_65_ffffff_1x400.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100755 index 000000000..a5f4f7458 Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_gloss-wave_35_f6a828_500x100.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_gloss-wave_35_f6a828_500x100.png new file mode 100755 index 000000000..ed19bc550 Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_gloss-wave_35_f6a828_500x100.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_highlight-soft_100_eeeeee_1x100.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_highlight-soft_100_eeeeee_1x100.png new file mode 100755 index 000000000..0198dfd14 Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_highlight-soft_100_eeeeee_1x100.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_highlight-soft_75_ffe45c_1x100.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_highlight-soft_75_ffe45c_1x100.png new file mode 100755 index 000000000..7d5ed20d6 Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-bg_highlight-soft_75_ffe45c_1x100.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_222222_256x240.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_222222_256x240.png new file mode 100755 index 000000000..c1cb1170c Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_222222_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_228ef1_256x240.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_228ef1_256x240.png new file mode 100755 index 000000000..3a0140cff Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_228ef1_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_ef8c08_256x240.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_ef8c08_256x240.png new file mode 100755 index 000000000..036ee072d Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_ef8c08_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_ffd27a_256x240.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_ffd27a_256x240.png new file mode 100755 index 000000000..8b6c05868 Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_ffd27a_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_ffffff_256x240.png b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_ffffff_256x240.png new file mode 100755 index 000000000..4f624bb2b Binary files /dev/null and b/js/jquery/ui/themes/ui-lightness/minified/images/ui-icons_ffffff_256x240.png differ diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery-ui.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery-ui.min.css new file mode 100755 index 000000000..5b454d4f2 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery-ui.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-25 +* http://jqueryui.com +* Includes: jquery.ui.core.css, jquery.ui.resizable.css, jquery.ui.selectable.css, jquery.ui.accordion.css, jquery.ui.autocomplete.css, jquery.ui.button.css, jquery.ui.datepicker.css, jquery.ui.dialog.css, jquery.ui.menu.css, jquery.ui.progressbar.css, jquery.ui.slider.css, jquery.ui.spinner.css, jquery.ui.tabs.css, jquery.ui.tooltip.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Trebuchet%20MS%2CTahoma%2CVerdana%2CArial%2Csans-serif&fwDefault=bold&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=f6a828&bgTextureHeader=gloss_wave&bgImgOpacityHeader=35&borderColorHeader=e78f08&fcHeader=ffffff&iconColorHeader=ffffff&bgColorContent=eeeeee&bgTextureContent=highlight_soft&bgImgOpacityContent=100&borderColorContent=dddddd&fcContent=333333&iconColorContent=222222&bgColorDefault=f6f6f6&bgTextureDefault=glass&bgImgOpacityDefault=100&borderColorDefault=cccccc&fcDefault=1c94c4&iconColorDefault=ef8c08&bgColorHover=fdf5ce&bgTextureHover=glass&bgImgOpacityHover=100&borderColorHover=fbcb09&fcHover=c77405&iconColorHover=ef8c08&bgColorActive=ffffff&bgTextureActive=glass&bgImgOpacityActive=65&borderColorActive=fbd850&fcActive=eb8f00&iconColorActive=ef8c08&bgColorHighlight=ffe45c&bgTextureHighlight=highlight_soft&bgImgOpacityHighlight=75&borderColorHighlight=fed22f&fcHighlight=363636&iconColorHighlight=228ef1&bgColorError=b81900&bgTextureError=diagonals_thick&bgImgOpacityError=18&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffd27a&bgColorOverlay=666666&bgTextureOverlay=diagonals_thick&bgImgOpacityOverlay=20&opacityOverlay=50&bgColorShadow=000000&bgTextureShadow=flat&bgImgOpacityShadow=10&opacityShadow=20&thicknessShadow=5px&offsetTopShadow=-5px&offsetLeftShadow=-5px&cornerRadiusShadow=5px +* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px}.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000}.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0}.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move}.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-menu .ui-state-disabled{font-weight:400;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right}.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(images/animated-overlay.gif);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none}.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0}.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px}.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0}.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px}.ui-widget{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #ddd;background:#eee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #e78f08;background:#f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #ccc;background:#f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#1c94c4}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#1c94c4;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #fbcb09;background:#fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#c77405}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#c77405;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #fbd850;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#eb8f00}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#eb8f00;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fed22f;background:#ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat;color:#fff}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#fff}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#fff}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_ffffff_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_228ef1_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_ffd27a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat;opacity:.5;filter:Alpha(Opacity=50)}.ui-widget-shadow{margin:-5px 0 0 -5px;padding:5px;background:#000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x;opacity:.2;filter:Alpha(Opacity=20);border-radius:5px} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.accordion.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.accordion.min.css new file mode 100755 index 000000000..558df17f8 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.accordion.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-accordion .ui-accordion-header{display:block;cursor:pointer;position:relative;margin-top:2px;padding:.5em .5em .5em .7em;min-height:0}.ui-accordion .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-noicons{padding-left:.7em}.ui-accordion .ui-accordion-icons .ui-accordion-icons{padding-left:2.2em}.ui-accordion .ui-accordion-header .ui-accordion-header-icon{position:absolute;left:.5em;top:50%;margin-top:-8px}.ui-accordion .ui-accordion-content{padding:1em 2.2em;border-top:0;overflow:auto} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.autocomplete.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.autocomplete.min.css new file mode 100755 index 000000000..8905772fe --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.autocomplete.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-autocomplete{position:absolute;top:0;left:0;cursor:default} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.button.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.button.min.css new file mode 100755 index 000000000..828674984 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.button.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-button{display:inline-block;position:relative;padding:0;line-height:normal;margin-right:.1em;cursor:pointer;vertical-align:middle;text-align:center;overflow:visible}.ui-button,.ui-button:link,.ui-button:visited,.ui-button:hover,.ui-button:active{text-decoration:none}.ui-button-icon-only{width:2.2em}button.ui-button-icon-only{width:2.4em}.ui-button-icons-only{width:3.4em}button.ui-button-icons-only{width:3.7em}.ui-button .ui-button-text{display:block;line-height:normal}.ui-button-text-only .ui-button-text{padding:.4em 1em}.ui-button-icon-only .ui-button-text,.ui-button-icons-only .ui-button-text{padding:.4em;text-indent:-9999999px}.ui-button-text-icon-primary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 1em .4em 2.1em}.ui-button-text-icon-secondary .ui-button-text,.ui-button-text-icons .ui-button-text{padding:.4em 2.1em .4em 1em}.ui-button-text-icons .ui-button-text{padding-left:2.1em;padding-right:2.1em}input.ui-button{padding:.4em 1em}.ui-button-icon-only .ui-icon,.ui-button-text-icon-primary .ui-icon,.ui-button-text-icon-secondary .ui-icon,.ui-button-text-icons .ui-icon,.ui-button-icons-only .ui-icon{position:absolute;top:50%;margin-top:-8px}.ui-button-icon-only .ui-icon{left:50%;margin-left:-8px}.ui-button-text-icon-primary .ui-button-icon-primary,.ui-button-text-icons .ui-button-icon-primary,.ui-button-icons-only .ui-button-icon-primary{left:.5em}.ui-button-text-icon-secondary .ui-button-icon-secondary,.ui-button-text-icons .ui-button-icon-secondary,.ui-button-icons-only .ui-button-icon-secondary{right:.5em}.ui-buttonset{margin-right:7px}.ui-buttonset .ui-button{margin-left:0;margin-right:-.3em}input.ui-button::-moz-focus-inner,button.ui-button::-moz-focus-inner{border:0;padding:0} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.core.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.core.min.css new file mode 100755 index 000000000..006708eb2 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.core.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.datepicker.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.datepicker.min.css new file mode 100755 index 000000000..fb6102c1c --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.datepicker.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.dialog.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.dialog.min.css new file mode 100755 index 000000000..3aa3f4a81 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.dialog.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-dialog{position:absolute;top:0;left:0;padding:.2em;outline:0}.ui-dialog .ui-dialog-titlebar{padding:.4em 1em;position:relative}.ui-dialog .ui-dialog-title{float:left;margin:.1em 0;white-space:nowrap;width:90%;overflow:hidden;text-overflow:ellipsis}.ui-dialog .ui-dialog-titlebar-close{position:absolute;right:.3em;top:50%;width:21px;margin:-10px 0 0 0;padding:1px;height:20px}.ui-dialog .ui-dialog-content{position:relative;border:0;padding:.5em 1em;background:0;overflow:auto}.ui-dialog .ui-dialog-buttonpane{text-align:left;border-width:1px 0 0;background-image:none;margin-top:.5em;padding:.3em 1em .5em .4em}.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset{float:right}.ui-dialog .ui-dialog-buttonpane button{margin:.5em .4em .5em 0;cursor:pointer}.ui-dialog .ui-resizable-se{width:12px;height:12px;right:-5px;bottom:-5px;background-position:16px 16px}.ui-draggable .ui-dialog-titlebar{cursor:move} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.menu.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.menu.min.css new file mode 100755 index 000000000..dea8be9b0 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.menu.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-menu{list-style:none;padding:2px;margin:0;display:block;outline:0}.ui-menu .ui-menu{margin-top:-3px;position:absolute}.ui-menu .ui-menu-item{margin:0;padding:0;width:100%;list-style-image:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}.ui-menu .ui-menu-divider{margin:5px -2px 5px -2px;height:0;font-size:0;line-height:0;border-width:1px 0 0}.ui-menu .ui-menu-item a{text-decoration:none;display:block;padding:2px .4em;line-height:1.5;min-height:0;font-weight:400}.ui-menu .ui-menu-item a.ui-state-focus,.ui-menu .ui-menu-item a.ui-state-active{font-weight:400;margin:-1px}.ui-menu .ui-state-disabled{font-weight:400;margin:.4em 0 .2em;line-height:1.5}.ui-menu .ui-state-disabled a{cursor:default}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item a{position:relative;padding-left:2em}.ui-menu .ui-icon{position:absolute;top:.2em;left:.2em}.ui-menu .ui-menu-icon{position:static;float:right} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.progressbar.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.progressbar.min.css new file mode 100755 index 000000000..bd3bdc115 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.progressbar.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-progressbar{height:2em;text-align:left;overflow:hidden}.ui-progressbar .ui-progressbar-value{margin:-1px;height:100%}.ui-progressbar .ui-progressbar-overlay{background:url(images/animated-overlay.gif);height:100%;filter:alpha(opacity=25);opacity:.25}.ui-progressbar-indeterminate .ui-progressbar-value{background-image:none} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.resizable.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.resizable.min.css new file mode 100755 index 000000000..598d23636 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.resizable.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-resizable{position:relative}.ui-resizable-handle{position:absolute;font-size:.1px;display:block}.ui-resizable-disabled .ui-resizable-handle,.ui-resizable-autohide .ui-resizable-handle{display:none}.ui-resizable-n{cursor:n-resize;height:7px;width:100%;top:-5px;left:0}.ui-resizable-s{cursor:s-resize;height:7px;width:100%;bottom:-5px;left:0}.ui-resizable-e{cursor:e-resize;width:7px;right:-5px;top:0;height:100%}.ui-resizable-w{cursor:w-resize;width:7px;left:-5px;top:0;height:100%}.ui-resizable-se{cursor:se-resize;width:12px;height:12px;right:1px;bottom:1px}.ui-resizable-sw{cursor:sw-resize;width:9px;height:9px;left:-5px;bottom:-5px}.ui-resizable-nw{cursor:nw-resize;width:9px;height:9px;left:-5px;top:-5px}.ui-resizable-ne{cursor:ne-resize;width:9px;height:9px;right:-5px;top:-5px} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.selectable.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.selectable.min.css new file mode 100755 index 000000000..fe5970c69 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.selectable.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-selectable-helper{position:absolute;z-index:100;border:1px dotted #000} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.slider.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.slider.min.css new file mode 100755 index 000000000..a552fde6f --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.slider.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-slider{position:relative;text-align:left}.ui-slider .ui-slider-handle{position:absolute;z-index:2;width:1.2em;height:1.2em;cursor:default}.ui-slider .ui-slider-range{position:absolute;z-index:1;font-size:.7em;display:block;border:0;background-position:0 0}.ui-slider.ui-state-disabled .ui-slider-handle,.ui-slider.ui-state-disabled .ui-slider-range{filter:inherit}.ui-slider-horizontal{height:.8em}.ui-slider-horizontal .ui-slider-handle{top:-.3em;margin-left:-.6em}.ui-slider-horizontal .ui-slider-range{top:0;height:100%}.ui-slider-horizontal .ui-slider-range-min{left:0}.ui-slider-horizontal .ui-slider-range-max{right:0}.ui-slider-vertical{width:.8em;height:100px}.ui-slider-vertical .ui-slider-handle{left:-.3em;margin-left:0;margin-bottom:-.6em}.ui-slider-vertical .ui-slider-range{left:0;width:100%}.ui-slider-vertical .ui-slider-range-min{bottom:0}.ui-slider-vertical .ui-slider-range-max{top:0} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.spinner.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.spinner.min.css new file mode 100755 index 000000000..d1bf66eba --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.spinner.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-spinner{position:relative;display:inline-block;overflow:hidden;padding:0;vertical-align:middle}.ui-spinner-input{border:0;background:0;color:inherit;padding:0;margin:.2em 0;vertical-align:middle;margin-left:.4em;margin-right:22px}.ui-spinner-button{width:16px;height:50%;font-size:.5em;padding:0;margin:0;text-align:center;position:absolute;cursor:default;display:block;overflow:hidden;right:0}.ui-spinner a.ui-spinner-button{border-top:0;border-bottom:0;border-right:0}.ui-spinner .ui-icon{position:absolute;margin-top:-8px;top:50%;left:0}.ui-spinner-up{top:0}.ui-spinner-down{bottom:0}.ui-spinner .ui-icon-triangle-1-s{background-position:-65px -16px} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.tabs.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.tabs.min.css new file mode 100755 index 000000000..032a32a00 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.tabs.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-tabs{position:relative;padding:.2em}.ui-tabs .ui-tabs-nav{margin:0;padding:.2em .2em 0}.ui-tabs .ui-tabs-nav li{list-style:none;float:left;position:relative;top:0;margin:1px .2em 0 0;border-bottom-width:0;padding:0;white-space:nowrap}.ui-tabs .ui-tabs-nav li a{float:left;padding:.5em 1em;text-decoration:none}.ui-tabs .ui-tabs-nav li.ui-tabs-active{margin-bottom:-1px;padding-bottom:1px}.ui-tabs .ui-tabs-nav li.ui-tabs-active a,.ui-tabs .ui-tabs-nav li.ui-state-disabled a,.ui-tabs .ui-tabs-nav li.ui-tabs-loading a{cursor:text}.ui-tabs .ui-tabs-nav li a,.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-active a{cursor:pointer}.ui-tabs .ui-tabs-panel{display:block;border-width:0;padding:1em 1.4em;background:0} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.theme.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.theme.min.css new file mode 100755 index 000000000..15e0b02cb --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.theme.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-25 +* http://jqueryui.com +* Includes: jquery.ui.theme.css +* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */ +.ui-widget{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1.1em}.ui-widget .ui-widget{font-size:1em}.ui-widget input,.ui-widget select,.ui-widget textarea,.ui-widget button{font-family:Trebuchet MS,Tahoma,Verdana,Arial,sans-serif;font-size:1em}.ui-widget-content{border:1px solid #ddd;background:#eee url(images/ui-bg_highlight-soft_100_eeeeee_1x100.png) 50% top repeat-x;color:#333}.ui-widget-content a{color:#333}.ui-widget-header{border:1px solid #e78f08;background:#f6a828 url(images/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x;color:#fff;font-weight:bold}.ui-widget-header a{color:#fff}.ui-state-default,.ui-widget-content .ui-state-default,.ui-widget-header .ui-state-default{border:1px solid #ccc;background:#f6f6f6 url(images/ui-bg_glass_100_f6f6f6_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#1c94c4}.ui-state-default a,.ui-state-default a:link,.ui-state-default a:visited{color:#1c94c4;text-decoration:none}.ui-state-hover,.ui-widget-content .ui-state-hover,.ui-widget-header .ui-state-hover,.ui-state-focus,.ui-widget-content .ui-state-focus,.ui-widget-header .ui-state-focus{border:1px solid #fbcb09;background:#fdf5ce url(images/ui-bg_glass_100_fdf5ce_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#c77405}.ui-state-hover a,.ui-state-hover a:hover,.ui-state-hover a:link,.ui-state-hover a:visited{color:#c77405;text-decoration:none}.ui-state-active,.ui-widget-content .ui-state-active,.ui-widget-header .ui-state-active{border:1px solid #fbd850;background:#fff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x;font-weight:bold;color:#eb8f00}.ui-state-active a,.ui-state-active a:link,.ui-state-active a:visited{color:#eb8f00;text-decoration:none}.ui-state-highlight,.ui-widget-content .ui-state-highlight,.ui-widget-header .ui-state-highlight{border:1px solid #fed22f;background:#ffe45c url(images/ui-bg_highlight-soft_75_ffe45c_1x100.png) 50% top repeat-x;color:#363636}.ui-state-highlight a,.ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a{color:#363636}.ui-state-error,.ui-widget-content .ui-state-error,.ui-widget-header .ui-state-error{border:1px solid #cd0a0a;background:#b81900 url(images/ui-bg_diagonals-thick_18_b81900_40x40.png) 50% 50% repeat;color:#fff}.ui-state-error a,.ui-widget-content .ui-state-error a,.ui-widget-header .ui-state-error a{color:#fff}.ui-state-error-text,.ui-widget-content .ui-state-error-text,.ui-widget-header .ui-state-error-text{color:#fff}.ui-priority-primary,.ui-widget-content .ui-priority-primary,.ui-widget-header .ui-priority-primary{font-weight:bold}.ui-priority-secondary,.ui-widget-content .ui-priority-secondary,.ui-widget-header .ui-priority-secondary{opacity:.7;filter:Alpha(Opacity=70);font-weight:normal}.ui-state-disabled,.ui-widget-content .ui-state-disabled,.ui-widget-header .ui-state-disabled{opacity:.35;filter:Alpha(Opacity=35);background-image:none}.ui-state-disabled .ui-icon{filter:Alpha(Opacity=35)}.ui-icon{width:16px;height:16px}.ui-icon,.ui-widget-content .ui-icon{background-image:url(images/ui-icons_222222_256x240.png)}.ui-widget-header .ui-icon{background-image:url(images/ui-icons_ffffff_256x240.png)}.ui-state-default .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-hover .ui-icon,.ui-state-focus .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-active .ui-icon{background-image:url(images/ui-icons_ef8c08_256x240.png)}.ui-state-highlight .ui-icon{background-image:url(images/ui-icons_228ef1_256x240.png)}.ui-state-error .ui-icon,.ui-state-error-text .ui-icon{background-image:url(images/ui-icons_ffd27a_256x240.png)}.ui-icon-blank{background-position:16px 16px}.ui-icon-carat-1-n{background-position:0 0}.ui-icon-carat-1-ne{background-position:-16px 0}.ui-icon-carat-1-e{background-position:-32px 0}.ui-icon-carat-1-se{background-position:-48px 0}.ui-icon-carat-1-s{background-position:-64px 0}.ui-icon-carat-1-sw{background-position:-80px 0}.ui-icon-carat-1-w{background-position:-96px 0}.ui-icon-carat-1-nw{background-position:-112px 0}.ui-icon-carat-2-n-s{background-position:-128px 0}.ui-icon-carat-2-e-w{background-position:-144px 0}.ui-icon-triangle-1-n{background-position:0 -16px}.ui-icon-triangle-1-ne{background-position:-16px -16px}.ui-icon-triangle-1-e{background-position:-32px -16px}.ui-icon-triangle-1-se{background-position:-48px -16px}.ui-icon-triangle-1-s{background-position:-64px -16px}.ui-icon-triangle-1-sw{background-position:-80px -16px}.ui-icon-triangle-1-w{background-position:-96px -16px}.ui-icon-triangle-1-nw{background-position:-112px -16px}.ui-icon-triangle-2-n-s{background-position:-128px -16px}.ui-icon-triangle-2-e-w{background-position:-144px -16px}.ui-icon-arrow-1-n{background-position:0 -32px}.ui-icon-arrow-1-ne{background-position:-16px -32px}.ui-icon-arrow-1-e{background-position:-32px -32px}.ui-icon-arrow-1-se{background-position:-48px -32px}.ui-icon-arrow-1-s{background-position:-64px -32px}.ui-icon-arrow-1-sw{background-position:-80px -32px}.ui-icon-arrow-1-w{background-position:-96px -32px}.ui-icon-arrow-1-nw{background-position:-112px -32px}.ui-icon-arrow-2-n-s{background-position:-128px -32px}.ui-icon-arrow-2-ne-sw{background-position:-144px -32px}.ui-icon-arrow-2-e-w{background-position:-160px -32px}.ui-icon-arrow-2-se-nw{background-position:-176px -32px}.ui-icon-arrowstop-1-n{background-position:-192px -32px}.ui-icon-arrowstop-1-e{background-position:-208px -32px}.ui-icon-arrowstop-1-s{background-position:-224px -32px}.ui-icon-arrowstop-1-w{background-position:-240px -32px}.ui-icon-arrowthick-1-n{background-position:0 -48px}.ui-icon-arrowthick-1-ne{background-position:-16px -48px}.ui-icon-arrowthick-1-e{background-position:-32px -48px}.ui-icon-arrowthick-1-se{background-position:-48px -48px}.ui-icon-arrowthick-1-s{background-position:-64px -48px}.ui-icon-arrowthick-1-sw{background-position:-80px -48px}.ui-icon-arrowthick-1-w{background-position:-96px -48px}.ui-icon-arrowthick-1-nw{background-position:-112px -48px}.ui-icon-arrowthick-2-n-s{background-position:-128px -48px}.ui-icon-arrowthick-2-ne-sw{background-position:-144px -48px}.ui-icon-arrowthick-2-e-w{background-position:-160px -48px}.ui-icon-arrowthick-2-se-nw{background-position:-176px -48px}.ui-icon-arrowthickstop-1-n{background-position:-192px -48px}.ui-icon-arrowthickstop-1-e{background-position:-208px -48px}.ui-icon-arrowthickstop-1-s{background-position:-224px -48px}.ui-icon-arrowthickstop-1-w{background-position:-240px -48px}.ui-icon-arrowreturnthick-1-w{background-position:0 -64px}.ui-icon-arrowreturnthick-1-n{background-position:-16px -64px}.ui-icon-arrowreturnthick-1-e{background-position:-32px -64px}.ui-icon-arrowreturnthick-1-s{background-position:-48px -64px}.ui-icon-arrowreturn-1-w{background-position:-64px -64px}.ui-icon-arrowreturn-1-n{background-position:-80px -64px}.ui-icon-arrowreturn-1-e{background-position:-96px -64px}.ui-icon-arrowreturn-1-s{background-position:-112px -64px}.ui-icon-arrowrefresh-1-w{background-position:-128px -64px}.ui-icon-arrowrefresh-1-n{background-position:-144px -64px}.ui-icon-arrowrefresh-1-e{background-position:-160px -64px}.ui-icon-arrowrefresh-1-s{background-position:-176px -64px}.ui-icon-arrow-4{background-position:0 -80px}.ui-icon-arrow-4-diag{background-position:-16px -80px}.ui-icon-extlink{background-position:-32px -80px}.ui-icon-newwin{background-position:-48px -80px}.ui-icon-refresh{background-position:-64px -80px}.ui-icon-shuffle{background-position:-80px -80px}.ui-icon-transfer-e-w{background-position:-96px -80px}.ui-icon-transferthick-e-w{background-position:-112px -80px}.ui-icon-folder-collapsed{background-position:0 -96px}.ui-icon-folder-open{background-position:-16px -96px}.ui-icon-document{background-position:-32px -96px}.ui-icon-document-b{background-position:-48px -96px}.ui-icon-note{background-position:-64px -96px}.ui-icon-mail-closed{background-position:-80px -96px}.ui-icon-mail-open{background-position:-96px -96px}.ui-icon-suitcase{background-position:-112px -96px}.ui-icon-comment{background-position:-128px -96px}.ui-icon-person{background-position:-144px -96px}.ui-icon-print{background-position:-160px -96px}.ui-icon-trash{background-position:-176px -96px}.ui-icon-locked{background-position:-192px -96px}.ui-icon-unlocked{background-position:-208px -96px}.ui-icon-bookmark{background-position:-224px -96px}.ui-icon-tag{background-position:-240px -96px}.ui-icon-home{background-position:0 -112px}.ui-icon-flag{background-position:-16px -112px}.ui-icon-calendar{background-position:-32px -112px}.ui-icon-cart{background-position:-48px -112px}.ui-icon-pencil{background-position:-64px -112px}.ui-icon-clock{background-position:-80px -112px}.ui-icon-disk{background-position:-96px -112px}.ui-icon-calculator{background-position:-112px -112px}.ui-icon-zoomin{background-position:-128px -112px}.ui-icon-zoomout{background-position:-144px -112px}.ui-icon-search{background-position:-160px -112px}.ui-icon-wrench{background-position:-176px -112px}.ui-icon-gear{background-position:-192px -112px}.ui-icon-heart{background-position:-208px -112px}.ui-icon-star{background-position:-224px -112px}.ui-icon-link{background-position:-240px -112px}.ui-icon-cancel{background-position:0 -128px}.ui-icon-plus{background-position:-16px -128px}.ui-icon-plusthick{background-position:-32px -128px}.ui-icon-minus{background-position:-48px -128px}.ui-icon-minusthick{background-position:-64px -128px}.ui-icon-close{background-position:-80px -128px}.ui-icon-closethick{background-position:-96px -128px}.ui-icon-key{background-position:-112px -128px}.ui-icon-lightbulb{background-position:-128px -128px}.ui-icon-scissors{background-position:-144px -128px}.ui-icon-clipboard{background-position:-160px -128px}.ui-icon-copy{background-position:-176px -128px}.ui-icon-contact{background-position:-192px -128px}.ui-icon-image{background-position:-208px -128px}.ui-icon-video{background-position:-224px -128px}.ui-icon-script{background-position:-240px -128px}.ui-icon-alert{background-position:0 -144px}.ui-icon-info{background-position:-16px -144px}.ui-icon-notice{background-position:-32px -144px}.ui-icon-help{background-position:-48px -144px}.ui-icon-check{background-position:-64px -144px}.ui-icon-bullet{background-position:-80px -144px}.ui-icon-radio-on{background-position:-96px -144px}.ui-icon-radio-off{background-position:-112px -144px}.ui-icon-pin-w{background-position:-128px -144px}.ui-icon-pin-s{background-position:-144px -144px}.ui-icon-play{background-position:0 -160px}.ui-icon-pause{background-position:-16px -160px}.ui-icon-seek-next{background-position:-32px -160px}.ui-icon-seek-prev{background-position:-48px -160px}.ui-icon-seek-end{background-position:-64px -160px}.ui-icon-seek-start{background-position:-80px -160px}.ui-icon-seek-first{background-position:-80px -160px}.ui-icon-stop{background-position:-96px -160px}.ui-icon-eject{background-position:-112px -160px}.ui-icon-volume-off{background-position:-128px -160px}.ui-icon-volume-on{background-position:-144px -160px}.ui-icon-power{background-position:0 -176px}.ui-icon-signal-diag{background-position:-16px -176px}.ui-icon-signal{background-position:-32px -176px}.ui-icon-battery-0{background-position:-48px -176px}.ui-icon-battery-1{background-position:-64px -176px}.ui-icon-battery-2{background-position:-80px -176px}.ui-icon-battery-3{background-position:-96px -176px}.ui-icon-circle-plus{background-position:0 -192px}.ui-icon-circle-minus{background-position:-16px -192px}.ui-icon-circle-close{background-position:-32px -192px}.ui-icon-circle-triangle-e{background-position:-48px -192px}.ui-icon-circle-triangle-s{background-position:-64px -192px}.ui-icon-circle-triangle-w{background-position:-80px -192px}.ui-icon-circle-triangle-n{background-position:-96px -192px}.ui-icon-circle-arrow-e{background-position:-112px -192px}.ui-icon-circle-arrow-s{background-position:-128px -192px}.ui-icon-circle-arrow-w{background-position:-144px -192px}.ui-icon-circle-arrow-n{background-position:-160px -192px}.ui-icon-circle-zoomin{background-position:-176px -192px}.ui-icon-circle-zoomout{background-position:-192px -192px}.ui-icon-circle-check{background-position:-208px -192px}.ui-icon-circlesmall-plus{background-position:0 -208px}.ui-icon-circlesmall-minus{background-position:-16px -208px}.ui-icon-circlesmall-close{background-position:-32px -208px}.ui-icon-squaresmall-plus{background-position:-48px -208px}.ui-icon-squaresmall-minus{background-position:-64px -208px}.ui-icon-squaresmall-close{background-position:-80px -208px}.ui-icon-grip-dotted-vertical{background-position:0 -224px}.ui-icon-grip-dotted-horizontal{background-position:-16px -224px}.ui-icon-grip-solid-vertical{background-position:-32px -224px}.ui-icon-grip-solid-horizontal{background-position:-48px -224px}.ui-icon-gripsmall-diagonal-se{background-position:-64px -224px}.ui-icon-grip-diagonal-se{background-position:-80px -224px}.ui-corner-all,.ui-corner-top,.ui-corner-left,.ui-corner-tl{border-top-left-radius:4px}.ui-corner-all,.ui-corner-top,.ui-corner-right,.ui-corner-tr{border-top-right-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-left,.ui-corner-bl{border-bottom-left-radius:4px}.ui-corner-all,.ui-corner-bottom,.ui-corner-right,.ui-corner-br{border-bottom-right-radius:4px}.ui-widget-overlay{background:#666 url(images/ui-bg_diagonals-thick_20_666666_40x40.png) 50% 50% repeat;opacity:.5;filter:Alpha(Opacity=50)}.ui-widget-shadow{margin:-5px 0 0 -5px;padding:5px;background:#000 url(images/ui-bg_flat_10_000000_40x100.png) 50% 50% repeat-x;opacity:.2;filter:Alpha(Opacity=20);border-radius:5px} \ No newline at end of file diff --git a/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.tooltip.min.css b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.tooltip.min.css new file mode 100755 index 000000000..dc7789323 --- /dev/null +++ b/js/jquery/ui/themes/ui-lightness/minified/jquery.ui.tooltip.min.css @@ -0,0 +1,5 @@ +/*! jQuery UI - v1.10.3 - 2013-06-12 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ + +.ui-tooltip{padding:8px;position:absolute;z-index:9999;max-width:300px;-webkit-box-shadow:0 0 5px #aaa;box-shadow:0 0 5px #aaa}body .ui-tooltip{border-width:2px} \ No newline at end of file diff --git a/js/login.js b/js/login.js index 4b81280ed..75fc36cef 100644 --- a/js/login.js +++ b/js/login.js @@ -1,6 +1,6 @@ $(document).ready(function() { // Focus on email address field - $('#email').select(); + $('#email').focus(); // Initialize events $('#login_form').submit(function(e) { @@ -61,7 +61,8 @@ function doAjaxLogin(redirect) { $('#login_form .ajax-loader').fadeIn('slow', function() { $.ajax({ type: "POST", - url: "ajax-tab.php", + headers: { "cache-control": "no-cache" }, + url: "ajax-tab.php" + '?rand=' + new Date().getTime(), async: true, dataType: "json", data: { @@ -74,11 +75,10 @@ function doAjaxLogin(redirect) { redirect: redirect }, success: function(jsonData) { - if (jsonData.hasErrors) { + if (jsonData.hasErrors) displayErrors(jsonData.errors); - } else { - window.location.href = jsonData.redirect; - } + else + window.location.assign(jsonData.redirect); }, error: function(XMLHttpRequest, textStatus, errorThrown) { $('#error').html('

        TECHNICAL ERROR:

        Details: Error thrown: ' + XMLHttpRequest + '

        Text status: ' + textStatus + '

        ').show(); @@ -92,7 +92,8 @@ function doAjaxForgot() { $('#forgot_password_form .ajax-loader').fadeIn('slow', function() { $.ajax({ type: "POST", - url: "ajax-tab.php", + headers: { "cache-control": "no-cache" }, + url: "ajax-tab.php" + '?rand=' + new Date().getTime(), async: true, dataType: "json", data: { diff --git a/js/price.js b/js/price.js index 6729dd17e..b35c98e16 100644 --- a/js/price.js +++ b/js/price.js @@ -1,5 +1,5 @@ /* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/productTabsManager.js b/js/productTabsManager.js index d12cea907..cb3ac4e13 100644 --- a/js/productTabsManager.js +++ b/js/productTabsManager.js @@ -17,7 +17,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -117,10 +117,11 @@ function ProductTabsManager(){ } return $.ajax({ - url : $('#link-'+tab_name).attr("href")+"&ajax=1", + url : $('#link-'+tab_name).attr("href")+"&ajax=1" + '&rand=' + new Date().getTime(), async : true, cache: false, // cache needs to be set to false or IE will cache the page with outdated product values type: 'POST', + headers: { "cache-control": "no-cache" }, data: data, success : function(data) { diff --git a/js/sendMailTest.js b/js/sendMailTest.js index d56fc542d..f46a6542d 100644 --- a/js/sendMailTest.js +++ b/js/sendMailTest.js @@ -1,5 +1,5 @@ /* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,13 +18,13 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ //constant -verifMailREGEX = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/; +verifMailREGEX = /^([\w+-]+(?:\.[\w+-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/; function verifyMail(testMsg, testSubject) { diff --git a/js/tiny_mce/index.php b/js/tiny_mce/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/index.php +++ b/js/tiny_mce/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/langs/index.php b/js/tiny_mce/langs/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/langs/index.php +++ b/js/tiny_mce/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advhr/css/index.php b/js/tiny_mce/plugins/advhr/css/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advhr/css/index.php +++ b/js/tiny_mce/plugins/advhr/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advhr/index.php b/js/tiny_mce/plugins/advhr/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advhr/index.php +++ b/js/tiny_mce/plugins/advhr/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advhr/js/index.php b/js/tiny_mce/plugins/advhr/js/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advhr/js/index.php +++ b/js/tiny_mce/plugins/advhr/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advhr/langs/index.php b/js/tiny_mce/plugins/advhr/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advhr/langs/index.php +++ b/js/tiny_mce/plugins/advhr/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advimage/css/index.php b/js/tiny_mce/plugins/advimage/css/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advimage/css/index.php +++ b/js/tiny_mce/plugins/advimage/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advimage/img/index.php b/js/tiny_mce/plugins/advimage/img/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advimage/img/index.php +++ b/js/tiny_mce/plugins/advimage/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advimage/index.php b/js/tiny_mce/plugins/advimage/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advimage/index.php +++ b/js/tiny_mce/plugins/advimage/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advimage/js/index.php b/js/tiny_mce/plugins/advimage/js/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advimage/js/index.php +++ b/js/tiny_mce/plugins/advimage/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advimage/langs/index.php b/js/tiny_mce/plugins/advimage/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advimage/langs/index.php +++ b/js/tiny_mce/plugins/advimage/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advlink/css/index.php b/js/tiny_mce/plugins/advlink/css/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advlink/css/index.php +++ b/js/tiny_mce/plugins/advlink/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advlink/index.php b/js/tiny_mce/plugins/advlink/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advlink/index.php +++ b/js/tiny_mce/plugins/advlink/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advlink/js/index.php b/js/tiny_mce/plugins/advlink/js/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advlink/js/index.php +++ b/js/tiny_mce/plugins/advlink/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advlink/langs/index.php b/js/tiny_mce/plugins/advlink/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advlink/langs/index.php +++ b/js/tiny_mce/plugins/advlink/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/advlist/index.php b/js/tiny_mce/plugins/advlist/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/advlist/index.php +++ b/js/tiny_mce/plugins/advlist/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/autolink/index.php b/js/tiny_mce/plugins/autolink/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/autolink/index.php +++ b/js/tiny_mce/plugins/autolink/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/autoresize/index.php b/js/tiny_mce/plugins/autoresize/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/autoresize/index.php +++ b/js/tiny_mce/plugins/autoresize/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/autosave/index.php b/js/tiny_mce/plugins/autosave/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/autosave/index.php +++ b/js/tiny_mce/plugins/autosave/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/autosave/langs/index.php b/js/tiny_mce/plugins/autosave/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/autosave/langs/index.php +++ b/js/tiny_mce/plugins/autosave/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/bbcode/index.php b/js/tiny_mce/plugins/bbcode/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/bbcode/index.php +++ b/js/tiny_mce/plugins/bbcode/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/contextmenu/index.php b/js/tiny_mce/plugins/contextmenu/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/contextmenu/index.php +++ b/js/tiny_mce/plugins/contextmenu/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/directionality/index.php b/js/tiny_mce/plugins/directionality/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/directionality/index.php +++ b/js/tiny_mce/plugins/directionality/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/emotions/img/index.php b/js/tiny_mce/plugins/emotions/img/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/emotions/img/index.php +++ b/js/tiny_mce/plugins/emotions/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/emotions/index.php b/js/tiny_mce/plugins/emotions/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/emotions/index.php +++ b/js/tiny_mce/plugins/emotions/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/emotions/js/index.php b/js/tiny_mce/plugins/emotions/js/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/emotions/js/index.php +++ b/js/tiny_mce/plugins/emotions/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/emotions/langs/index.php b/js/tiny_mce/plugins/emotions/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/emotions/langs/index.php +++ b/js/tiny_mce/plugins/emotions/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/fullpage/css/index.php b/js/tiny_mce/plugins/fullpage/css/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/fullpage/css/index.php +++ b/js/tiny_mce/plugins/fullpage/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/fullpage/index.php b/js/tiny_mce/plugins/fullpage/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/fullpage/index.php +++ b/js/tiny_mce/plugins/fullpage/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/fullpage/js/index.php b/js/tiny_mce/plugins/fullpage/js/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/fullpage/js/index.php +++ b/js/tiny_mce/plugins/fullpage/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/fullpage/langs/index.php b/js/tiny_mce/plugins/fullpage/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/fullpage/langs/index.php +++ b/js/tiny_mce/plugins/fullpage/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/fullscreen/index.php b/js/tiny_mce/plugins/fullscreen/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/fullscreen/index.php +++ b/js/tiny_mce/plugins/fullscreen/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/iespell/index.php b/js/tiny_mce/plugins/iespell/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/iespell/index.php +++ b/js/tiny_mce/plugins/iespell/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/index.php b/js/tiny_mce/plugins/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/index.php +++ b/js/tiny_mce/plugins/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/inlinepopups/index.php b/js/tiny_mce/plugins/inlinepopups/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/inlinepopups/index.php +++ b/js/tiny_mce/plugins/inlinepopups/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/index.php b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/index.php +++ b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/index.php b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/index.php +++ b/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/inlinepopups/skins/index.php b/js/tiny_mce/plugins/inlinepopups/skins/index.php index 7a626751d..319128b59 100755 --- a/js/tiny_mce/plugins/inlinepopups/skins/index.php +++ b/js/tiny_mce/plugins/inlinepopups/skins/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/insertdatetime/index.php b/js/tiny_mce/plugins/insertdatetime/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/insertdatetime/index.php +++ b/js/tiny_mce/plugins/insertdatetime/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/layer/index.php b/js/tiny_mce/plugins/layer/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/layer/index.php +++ b/js/tiny_mce/plugins/layer/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/legacyoutput/index.php b/js/tiny_mce/plugins/legacyoutput/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/legacyoutput/index.php +++ b/js/tiny_mce/plugins/legacyoutput/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/lists/index.php b/js/tiny_mce/plugins/lists/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/lists/index.php +++ b/js/tiny_mce/plugins/lists/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/media/css/index.php b/js/tiny_mce/plugins/media/css/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/media/css/index.php +++ b/js/tiny_mce/plugins/media/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/media/index.php b/js/tiny_mce/plugins/media/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/media/index.php +++ b/js/tiny_mce/plugins/media/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/media/js/index.php b/js/tiny_mce/plugins/media/js/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/media/js/index.php +++ b/js/tiny_mce/plugins/media/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/media/langs/index.php b/js/tiny_mce/plugins/media/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/media/langs/index.php +++ b/js/tiny_mce/plugins/media/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/nonbreaking/index.php b/js/tiny_mce/plugins/nonbreaking/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/nonbreaking/index.php +++ b/js/tiny_mce/plugins/nonbreaking/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/noneditable/index.php b/js/tiny_mce/plugins/noneditable/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/noneditable/index.php +++ b/js/tiny_mce/plugins/noneditable/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/pagebreak/index.php b/js/tiny_mce/plugins/pagebreak/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/pagebreak/index.php +++ b/js/tiny_mce/plugins/pagebreak/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/paste/index.php b/js/tiny_mce/plugins/paste/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/paste/index.php +++ b/js/tiny_mce/plugins/paste/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/paste/js/index.php b/js/tiny_mce/plugins/paste/js/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/paste/js/index.php +++ b/js/tiny_mce/plugins/paste/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/paste/langs/index.php b/js/tiny_mce/plugins/paste/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/paste/langs/index.php +++ b/js/tiny_mce/plugins/paste/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/preview/index.php b/js/tiny_mce/plugins/preview/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/preview/index.php +++ b/js/tiny_mce/plugins/preview/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/preview/jscripts/index.php b/js/tiny_mce/plugins/preview/jscripts/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/preview/jscripts/index.php +++ b/js/tiny_mce/plugins/preview/jscripts/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/print/index.php b/js/tiny_mce/plugins/print/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/print/index.php +++ b/js/tiny_mce/plugins/print/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/save/index.php b/js/tiny_mce/plugins/save/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/save/index.php +++ b/js/tiny_mce/plugins/save/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/searchreplace/css/index.php b/js/tiny_mce/plugins/searchreplace/css/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/searchreplace/css/index.php +++ b/js/tiny_mce/plugins/searchreplace/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/searchreplace/index.php b/js/tiny_mce/plugins/searchreplace/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/searchreplace/index.php +++ b/js/tiny_mce/plugins/searchreplace/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/searchreplace/js/index.php b/js/tiny_mce/plugins/searchreplace/js/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/searchreplace/js/index.php +++ b/js/tiny_mce/plugins/searchreplace/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/searchreplace/langs/index.php b/js/tiny_mce/plugins/searchreplace/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/searchreplace/langs/index.php +++ b/js/tiny_mce/plugins/searchreplace/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/spellchecker/css/index.php b/js/tiny_mce/plugins/spellchecker/css/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/spellchecker/css/index.php +++ b/js/tiny_mce/plugins/spellchecker/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/spellchecker/img/index.php b/js/tiny_mce/plugins/spellchecker/img/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/spellchecker/img/index.php +++ b/js/tiny_mce/plugins/spellchecker/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/spellchecker/index.php b/js/tiny_mce/plugins/spellchecker/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/spellchecker/index.php +++ b/js/tiny_mce/plugins/spellchecker/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/style/css/index.php b/js/tiny_mce/plugins/style/css/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/style/css/index.php +++ b/js/tiny_mce/plugins/style/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/style/index.php b/js/tiny_mce/plugins/style/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/style/index.php +++ b/js/tiny_mce/plugins/style/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/style/js/index.php b/js/tiny_mce/plugins/style/js/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/style/js/index.php +++ b/js/tiny_mce/plugins/style/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/style/langs/index.php b/js/tiny_mce/plugins/style/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/style/langs/index.php +++ b/js/tiny_mce/plugins/style/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/tabfocus/index.php b/js/tiny_mce/plugins/tabfocus/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/tabfocus/index.php +++ b/js/tiny_mce/plugins/tabfocus/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/table/css/index.php b/js/tiny_mce/plugins/table/css/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/table/css/index.php +++ b/js/tiny_mce/plugins/table/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/table/index.php b/js/tiny_mce/plugins/table/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/table/index.php +++ b/js/tiny_mce/plugins/table/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/table/js/index.php b/js/tiny_mce/plugins/table/js/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/table/js/index.php +++ b/js/tiny_mce/plugins/table/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/table/langs/index.php b/js/tiny_mce/plugins/table/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/table/langs/index.php +++ b/js/tiny_mce/plugins/table/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/template/css/index.php b/js/tiny_mce/plugins/template/css/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/template/css/index.php +++ b/js/tiny_mce/plugins/template/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/template/index.php b/js/tiny_mce/plugins/template/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/template/index.php +++ b/js/tiny_mce/plugins/template/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/template/js/index.php b/js/tiny_mce/plugins/template/js/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/template/js/index.php +++ b/js/tiny_mce/plugins/template/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/template/langs/index.php b/js/tiny_mce/plugins/template/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/template/langs/index.php +++ b/js/tiny_mce/plugins/template/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/visualchars/index.php b/js/tiny_mce/plugins/visualchars/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/visualchars/index.php +++ b/js/tiny_mce/plugins/visualchars/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/wordcount/index.php b/js/tiny_mce/plugins/wordcount/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/wordcount/index.php +++ b/js/tiny_mce/plugins/wordcount/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/xhtmlxtras/css/index.php b/js/tiny_mce/plugins/xhtmlxtras/css/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/xhtmlxtras/css/index.php +++ b/js/tiny_mce/plugins/xhtmlxtras/css/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/xhtmlxtras/index.php b/js/tiny_mce/plugins/xhtmlxtras/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/xhtmlxtras/index.php +++ b/js/tiny_mce/plugins/xhtmlxtras/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/xhtmlxtras/js/index.php b/js/tiny_mce/plugins/xhtmlxtras/js/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/plugins/xhtmlxtras/js/index.php +++ b/js/tiny_mce/plugins/xhtmlxtras/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/plugins/xhtmlxtras/langs/index.php b/js/tiny_mce/plugins/xhtmlxtras/langs/index.php index 88e934d59..195fab225 100644 --- a/js/tiny_mce/plugins/xhtmlxtras/langs/index.php +++ b/js/tiny_mce/plugins/xhtmlxtras/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/img/index.php b/js/tiny_mce/themes/advanced/img/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/img/index.php +++ b/js/tiny_mce/themes/advanced/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/index.php b/js/tiny_mce/themes/advanced/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/index.php +++ b/js/tiny_mce/themes/advanced/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/js/index.php b/js/tiny_mce/themes/advanced/js/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/js/index.php +++ b/js/tiny_mce/themes/advanced/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/langs/index.php b/js/tiny_mce/themes/advanced/langs/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/langs/index.php +++ b/js/tiny_mce/themes/advanced/langs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/img/index.php b/js/tiny_mce/themes/advanced/skins/cirkuit/img/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/skins/cirkuit/img/index.php +++ b/js/tiny_mce/themes/advanced/skins/cirkuit/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/skins/cirkuit/index.php b/js/tiny_mce/themes/advanced/skins/cirkuit/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/skins/cirkuit/index.php +++ b/js/tiny_mce/themes/advanced/skins/cirkuit/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/skins/default/img/index.php b/js/tiny_mce/themes/advanced/skins/default/img/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/skins/default/img/index.php +++ b/js/tiny_mce/themes/advanced/skins/default/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/skins/default/index.php b/js/tiny_mce/themes/advanced/skins/default/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/skins/default/index.php +++ b/js/tiny_mce/themes/advanced/skins/default/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/skins/highcontrast/index.php b/js/tiny_mce/themes/advanced/skins/highcontrast/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/skins/highcontrast/index.php +++ b/js/tiny_mce/themes/advanced/skins/highcontrast/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/skins/index.php b/js/tiny_mce/themes/advanced/skins/index.php index 7a626751d..319128b59 100755 --- a/js/tiny_mce/themes/advanced/skins/index.php +++ b/js/tiny_mce/themes/advanced/skins/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/img/index.php b/js/tiny_mce/themes/advanced/skins/o2k7/img/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/skins/o2k7/img/index.php +++ b/js/tiny_mce/themes/advanced/skins/o2k7/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/advanced/skins/o2k7/index.php b/js/tiny_mce/themes/advanced/skins/o2k7/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/themes/advanced/skins/o2k7/index.php +++ b/js/tiny_mce/themes/advanced/skins/o2k7/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/themes/index.php b/js/tiny_mce/themes/index.php index 7a626751d..319128b59 100755 --- a/js/tiny_mce/themes/index.php +++ b/js/tiny_mce/themes/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tiny_mce/utils/index.php b/js/tiny_mce/utils/index.php index ec45b2dfe..f42f03e4d 100755 --- a/js/tiny_mce/utils/index.php +++ b/js/tiny_mce/utils/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tinymce.inc.js b/js/tinymce.inc.js index 36877452a..9ca801285 100644 --- a/js/tinymce.inc.js +++ b/js/tinymce.inc.js @@ -12,9 +12,11 @@ function tinySetup(config) plugins : "safari,pagebreak,style,table,advimage,advlink,inlinepopups,media,contextmenu,paste,fullscreen,xhtmlxtras,preview", // Theme options theme_advanced_buttons1 : "newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", - theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,,|,forecolor,backcolor", - theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,media,|,ltr,rtl,|,fullscreen", - theme_advanced_buttons4 : "styleprops,|,cite,abbr,acronym,del,ins,attribs,pagebreak", + theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,,|,forecolor,backcolor, media, fullscreen", + // theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,|,ltr,rtl,|", + // theme_advanced_buttons4 : "styleprops,|,cite,abbr,acronym,del,ins,attribs,pagebreak", + theme_advanced_buttons3 : "", + theme_advanced_buttons4 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", diff --git a/js/toggle.js b/js/toggle.js index 66ba2b08d..3e8db361a 100644 --- a/js/toggle.js +++ b/js/toggle.js @@ -1,5 +1,5 @@ /* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/tools.js b/js/tools.js index a09812b51..31aa17ccc 100644 --- a/js/tools.js +++ b/js/tools.js @@ -1,5 +1,5 @@ /* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -93,7 +93,7 @@ function ps_round(value, precision) return Math.round(value * precisionFactor) / precisionFactor; } -function autoUrl(name, dest) +function autoUrl(name, dest) { var loc; var id_list; @@ -105,7 +105,7 @@ function autoUrl(name, dest) return ; } -function autoUrlNoList(name, dest) +function autoUrlNoList(name, dest) { var loc; @@ -175,7 +175,7 @@ function addBookmark(url, title) { if (window.sidebar) return window.sidebar.addPanel(title, url, ""); - else if ( window.external ) + else if ( window.external && ('AddFavorite' in window.external)) return window.external.AddFavorite( url, title); else if (window.opera && window.print) return true; @@ -188,7 +188,8 @@ function writeBookmarkLink(url, title, text, img) if (img) insert = writeBookmarkLinkObject(url, title, '' + escape(text) + '') + ' '; insert += writeBookmarkLinkObject(url, title, text); - document.write(insert); + if (window.sidebar || window.opera && window.print || (window.external && ('AddFavorite' in window.external))) + document.write(insert); } function writeBookmarkLinkObject(url, title, insert) @@ -206,9 +207,11 @@ function checkCustomizations() if (typeof customizationFields != 'undefined') for (var i = 0; i < customizationFields.length; i++) + { /* If the field is required and empty then we abort */ - if (parseInt(customizationFields[i][1]) == 1 && ($('#' + customizationFields[i][0]).html() == '' || $('#' + customizationFields[i][0]).html() != $('#' + customizationFields[i][0]).val()) && !pattern.test($('#' + customizationFields[i][0]).attr('class'))) + if (parseInt(customizationFields[i][1]) == 1 && ($('#' + customizationFields[i][0]).html() == '' || $('#' + customizationFields[i][0]).text() != $('#' + customizationFields[i][0]).val()) && !pattern.test($('#' + customizationFields[i][0]).attr('class'))) return false; + } return true; } @@ -263,7 +266,8 @@ function setCurrency(id_currency) { $.ajax({ type: 'POST', - url: baseDir + 'index.php', + headers: { "cache-control": "no-cache" }, + url: baseDir + 'index.php' + '?rand=' + new Date().getTime(), data: 'controller=change-currency&id_currency='+ parseInt(id_currency), success: function(msg) { @@ -288,4 +292,6 @@ $().ready(function() { $(this).find('.hideOnSubmit').hide(); }); + // attribute target="_blank" is not W3C compliant + $('a._blank').attr('target', '_blank'); }); diff --git a/localization/ar.xml b/localization/ar.xml index ac44566b4..7b067c659 100644 --- a/localization/ar.xml +++ b/localization/ar.xml @@ -5,6 +5,7 @@ + @@ -16,8 +17,8 @@ - - - + + + diff --git a/localization/au.xml b/localization/au.xml index e232c0d9e..99110438c 100644 --- a/localization/au.xml +++ b/localization/au.xml @@ -1,5 +1,9 @@ + + + + diff --git a/localization/be.xml b/localization/be.xml index bbdd774de..90aa1a072 100644 --- a/localization/be.xml +++ b/localization/be.xml @@ -166,8 +166,8 @@ - - - + + + diff --git a/localization/ca.xml b/localization/ca.xml index 69d9eac53..0e3f157a8 100644 --- a/localization/ca.xml +++ b/localization/ca.xml @@ -25,7 +25,7 @@ - + @@ -37,7 +37,7 @@ - + diff --git a/localization/ch.xml b/localization/ch.xml index 72f9c3c28..4ad882b86 100644 --- a/localization/ch.xml +++ b/localization/ch.xml @@ -1,7 +1,7 @@ - + diff --git a/localization/cn.xml b/localization/cn.xml index b582b2dad..bf0af22e4 100644 --- a/localization/cn.xml +++ b/localization/cn.xml @@ -27,7 +27,7 @@ - + @@ -49,7 +49,7 @@ - + @@ -58,6 +58,7 @@ + @@ -66,4 +67,4 @@ - + \ No newline at end of file diff --git a/localization/es.xml b/localization/es.xml index d9f1b1c3d..8f321d36b 100644 --- a/localization/es.xml +++ b/localization/es.xml @@ -9,11 +9,11 @@ - - + + - + @@ -43,7 +43,7 @@ - + diff --git a/localization/fj.xml b/localization/fj.xml index 9b8ce1897..ddb10ac33 100644 --- a/localization/fj.xml +++ b/localization/fj.xml @@ -1,5 +1,11 @@ + + + + + + diff --git a/localization/gb.xml b/localization/gb.xml index f5abec607..c12cff979 100644 --- a/localization/gb.xml +++ b/localization/gb.xml @@ -3,6 +3,12 @@ + + + + + + diff --git a/localization/gy.xml b/localization/gy.xml index d00b9c547..0278fce7b 100644 --- a/localization/gy.xml +++ b/localization/gy.xml @@ -4,8 +4,7 @@ - - + diff --git a/localization/hk.xml b/localization/hk.xml index a03d91b94..a50827162 100644 --- a/localization/hk.xml +++ b/localization/hk.xml @@ -1,7 +1,7 @@ - + diff --git a/localization/ie.xml b/localization/ie.xml index 108a2a40b..672136eb2 100644 --- a/localization/ie.xml +++ b/localization/ie.xml @@ -1,5 +1,10 @@ + + + + + diff --git a/localization/il.xml b/localization/il.xml index 37965a4f6..bb9c5473c 100644 --- a/localization/il.xml +++ b/localization/il.xml @@ -8,9 +8,9 @@ - + - + diff --git a/localization/in.xml b/localization/in.xml index a64c0bb40..b3a3bcf55 100644 --- a/localization/in.xml +++ b/localization/in.xml @@ -1,5 +1,10 @@ + + + + + diff --git a/localization/index.php b/localization/index.php index ec45b2dfe..1369686bd 100644 --- a/localization/index.php +++ b/localization/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -32,4 +32,4 @@ header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); header("Location: ../"); -exit; \ No newline at end of file +exit; diff --git a/localization/it.xml b/localization/it.xml index ee12c9e07..00122fe0d 100644 --- a/localization/it.xml +++ b/localization/it.xml @@ -131,7 +131,7 @@ - + @@ -280,4 +280,4 @@ - \ No newline at end of file + diff --git a/localization/je.xml b/localization/je.xml index 035e7bb54..133f6b2e7 100644 --- a/localization/je.xml +++ b/localization/je.xml @@ -5,6 +5,7 @@ + diff --git a/localization/mt.xml b/localization/mt.xml index c9a963025..3b51aaecb 100644 --- a/localization/mt.xml +++ b/localization/mt.xml @@ -1,5 +1,10 @@ + + + + + diff --git a/localization/mx.xml b/localization/mx.xml index 4ea20ac25..39ca83529 100644 --- a/localization/mx.xml +++ b/localization/mx.xml @@ -5,6 +5,7 @@ + diff --git a/localization/nl.xml b/localization/nl.xml index 44582940d..4a095436d 100644 --- a/localization/nl.xml +++ b/localization/nl.xml @@ -7,8 +7,8 @@ - - + + diff --git a/localization/nz.xml b/localization/nz.xml index 888fbab51..6abdd8a19 100644 --- a/localization/nz.xml +++ b/localization/nz.xml @@ -17,4 +17,7 @@ + + + diff --git a/localization/pk.xml b/localization/pk.xml index 3da6fdd15..61da19546 100644 --- a/localization/pk.xml +++ b/localization/pk.xml @@ -1,5 +1,11 @@ + + + + + + diff --git a/localization/se.xml b/localization/se.xml index afe1a3761..5d218ba21 100644 --- a/localization/se.xml +++ b/localization/se.xml @@ -4,7 +4,7 @@ - + diff --git a/localization/sg.xml b/localization/sg.xml index 31ad41023..bf1188b65 100644 --- a/localization/sg.xml +++ b/localization/sg.xml @@ -4,6 +4,7 @@ + diff --git a/localization/si.xml b/localization/si.xml index 247b7d56d..cbfb4ecff 100644 --- a/localization/si.xml +++ b/localization/si.xml @@ -4,7 +4,7 @@ - + diff --git a/localization/ua.xml b/localization/ua.xml index 6a4e7e30a..086d79849 100644 --- a/localization/ua.xml +++ b/localization/ua.xml @@ -6,7 +6,7 @@ - + diff --git a/localization/us.xml b/localization/us.xml index bfaed6990..f17cbcff6 100644 --- a/localization/us.xml +++ b/localization/us.xml @@ -1,5 +1,10 @@ + + + + + diff --git a/localization/vn.xml b/localization/vn.xml index 500515098..390275895 100644 --- a/localization/vn.xml +++ b/localization/vn.xml @@ -4,7 +4,7 @@ - + diff --git a/log/index.php b/log/index.php index 88e934d59..195fab225 100755 --- a/log/index.php +++ b/log/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/mails/de/account.html b/mails/de/account.html deleted file mode 100644 index ad17dfe6e..000000000 --- a/mails/de/account.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Nachricht von {shop_name} - - -
        {$key|stripslashes} = {* Prepare name string for md5() *} - {capture assign="name"}{strtolower($module_name)}_{strtolower($theme_name)}_{strtolower($template_name)}_{md5($key)}{/capture} + {capture assign="name"}{strtolower($module_name)}{if $theme_name}_{strtolower($theme_name)}{/if}_{strtolower($template_name)}_{md5($key)}{/capture} {if $key|strlen < $textarea_sized} -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/warehouses/helpers/index.php b/admin-dev/themes/default/template/controllers/warehouses/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/warehouses/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/warehouses/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/warehouses/helpers/view/index.php b/admin-dev/themes/default/template/controllers/warehouses/helpers/view/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/warehouses/helpers/view/index.php +++ b/admin-dev/themes/default/template/controllers/warehouses/helpers/view/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/warehouses/helpers/view/view.tpl b/admin-dev/themes/default/template/controllers/warehouses/helpers/view/view.tpl index b85ea0371..a17e3bf95 100644 --- a/admin-dev/themes/default/template/controllers/warehouses/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/controllers/warehouses/helpers/view/view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -28,7 +28,7 @@ {if isset($warehouse)}
        - {l s='General informations'} + {l s='General information'} @@ -59,7 +59,7 @@ - + @@ -75,7 +75,7 @@
        - {l s='Shops'} + {l s='Shops:'} {l s='The following are the shops associated with this warehouse.'}
        {l s='Reference:'}{$currency->name} ({$currency->sign})
        {l s='Products:'}{l s='Products'} {$warehouse_num_products} {l s='References:'}
        @@ -99,10 +99,10 @@ {else} - {l s='This warehouse does not exist'} + {l s='This warehouse does not exist.'} {/if} {/block} diff --git a/admin-dev/themes/default/template/controllers/warehouses/index.php b/admin-dev/themes/default/template/controllers/warehouses/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/warehouses/index.php +++ b/admin-dev/themes/default/template/controllers/warehouses/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/webservice/helpers/form/form.tpl b/admin-dev/themes/default/template/controllers/webservice/helpers/form/form.tpl index 24c440845..6ce95838b 100644 --- a/admin-dev/themes/default/template/controllers/webservice/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/controllers/webservice/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -27,7 +27,7 @@ {block name="description"} {$smarty.block.parent} {if $input.type == 'text' && $input.name == 'key'} - + {/if} {/block} diff --git a/admin-dev/themes/default/template/controllers/webservice/helpers/form/index.php b/admin-dev/themes/default/template/controllers/webservice/helpers/form/index.php index bbc3550b8..30839633c 100644 --- a/admin-dev/themes/default/template/controllers/webservice/helpers/form/index.php +++ b/admin-dev/themes/default/template/controllers/webservice/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/webservice/helpers/index.php b/admin-dev/themes/default/template/controllers/webservice/helpers/index.php index 50814f2d6..063209789 100644 --- a/admin-dev/themes/default/template/controllers/webservice/helpers/index.php +++ b/admin-dev/themes/default/template/controllers/webservice/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/controllers/webservice/index.php b/admin-dev/themes/default/template/controllers/webservice/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/controllers/webservice/index.php +++ b/admin-dev/themes/default/template/controllers/webservice/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/footer.tpl b/admin-dev/themes/default/template/footer.tpl index 7953dc1d5..8caf2c64a 100644 --- a/admin-dev/themes/default/template/footer.tpl +++ b/admin-dev/themes/default/template/footer.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,37 +18,35 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} - -
         
        - -
         
        +
         
        + +
         
        + +{if $display_footer} +{hook h="displayBackOfficeFooter"} + - - {* ajaxBox allows*} - - {/if} -
        - - + + +{* ajaxBox allows*} +{/if} +
        + + \ No newline at end of file diff --git a/admin-dev/themes/default/template/form_submit_ajax.tpl b/admin-dev/themes/default/template/form_submit_ajax.tpl index c59f6e012..d03d5b2d7 100644 --- a/admin-dev/themes/default/template/form_submit_ajax.tpl +++ b/admin-dev/themes/default/template/form_submit_ajax.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/header.tpl b/admin-dev/themes/default/template/header.tpl index a4bd6b25d..1ddf6bffc 100644 --- a/admin-dev/themes/default/template/header.tpl +++ b/admin-dev/themes/default/template/header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,11 +18,15 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} + + + + @@ -65,6 +69,7 @@ var token_admin_customers = '{getAdminToken tab='AdminCustomers' slashes=1}'; var token_admin_customer_threads = '{getAdminToken tab='AdminCustomerThreads' slashes=1}'; var currentIndex = '{$currentIndex}'; + var choose_language_translate = "{l s='Choose language' slashes=1 }"; {/if} @@ -78,7 +83,6 @@ {/foreach} {/if} - {if isset($displayBackOfficeHeader)} @@ -87,16 +91,15 @@ - {if isset($brightness)} +{if isset($brightness)} - {/if} +{/if} {if $display_header}
        {l s='Loading...'}
        -
        0}style="margin:auto;width:{$bo_width}px"{/if}>
        {* begin HEADER *} @@ -104,7 +107,7 @@
        {$shop_name}
        - {if {$show_new_orders} == 1} +{if {$show_new_orders} == 1}
        0 @@ -116,8 +119,8 @@

        {l s='Show all orders'}

        - {/if} - {if ($show_new_customers == 1)} +{/if} +{if ($show_new_customers == 1)}
        0 @@ -129,8 +132,8 @@

        {l s='Show all customers'}

        - {/if} - {if {$show_new_messages} == 1} +{/if} +{if {$show_new_messages} == 1}
        0 @@ -142,18 +145,22 @@

        {l s='Show all messages'}

        - {/if} +{/if}
        - {* end header_infos*} - - {/if} - {* end header*} - + {* end header*} +{/if}
        - {if $display_header && $install_dir_exists} -
        - {l s='For security reasons, you must also:'} {l s='delete the /install folder'} -
        - {/if} - - {if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)} -
        - {l s='Multistore configuration for'} - {$shop_list} -
        - {/if} +{if $display_header && $install_dir_exists} +
        + {l s='For security reasons, you must also:'} {l s='delete the /install folder'} +
        +{/if} +{if $display_header && $is_multishop && $shop_list && ($multishop_context & Shop::CONTEXT_GROUP || $multishop_context & Shop::CONTEXT_SHOP)} +
        + {l s='Multistore configuration for'} {$shop_list} +
        +{/if} \ No newline at end of file diff --git a/admin-dev/themes/default/template/helpers/form/assoshop.tpl b/admin-dev/themes/default/template/helpers/form/assoshop.tpl index ff1d3f9d8..fc76148fb 100644 --- a/admin-dev/themes/default/template/helpers/form/assoshop.tpl +++ b/admin-dev/themes/default/template/helpers/form/assoshop.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/form/form.tpl b/admin-dev/themes/default/template/helpers/form/form.tpl index 86d6a63c0..694486e03 100644 --- a/admin-dev/themes/default/template/helpers/form/form.tpl +++ b/admin-dev/themes/default/template/helpers/form/form.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -30,7 +30,7 @@ {if isset($fields.title)}

        {$fields.title}

        {/if} {block name="defaultForm"} -
        + {if $form_id} {/if} @@ -50,7 +50,7 @@ {else} {if $input.name == 'id_state'} -
        +
        {/if} {block name="label"} {if isset($input.label)}{/if} @@ -167,6 +167,8 @@ {/if} {/if} >{$option->$input.options.name} + {elseif $option == "-"} + {else}

        {/if} {/if} - + + {if isset($input.lang) AND $input.lang} +
        + {foreach $languages as $language} +
        + + +
        + {/foreach} +
        + {else} + + {/if} {if !empty($input.hint)}{$input.hint} {/if} {elseif $input.type == 'password'} {elseif $input.type == 'date'} *{/if} {/block}{* end block input *} {block name="description"} - {if isset($input.desc)} + {if isset($input.desc) && !empty($input.desc)}

        {if is_array($input.desc)} {foreach $input.desc as $p} @@ -341,13 +354,13 @@ {/if} {/if} {/foreach} - {hook h='displayAdminForm'} + {hook h='displayAdminForm' fieldset=$f} {if isset($name_controller)} {capture name=hookName assign=hookName}display{$name_controller|ucfirst}Form{/capture} - {hook h=$hookName} + {hook h=$hookName fieldset=$f} {elseif isset($smarty.get.controller)} {capture name=hookName assign=hookName}display{$smarty.get.controller|ucfirst|htmlentities}Form{/capture} - {hook h=$hookName} + {hook h=$hookName fieldset=$f} {/if} {elseif $key == 'submit'}

        @@ -396,11 +409,7 @@ $(document).ready(function(){ {block name="autoload_tinyMCE"} tinySetup({ - editor_selector :"autoload_rte", - theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull|cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,undo,redo", - theme_advanced_buttons2 : "link,unlink,anchor,image,cleanup,code,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,charmap,media,|,ltr,rtl,|,fullscreen", - theme_advanced_buttons3 : "", - theme_advanced_buttons4 : "" + editor_selector :"autoload_rte" }); {/block} }); diff --git a/admin-dev/themes/default/template/helpers/form/form_category.tpl b/admin-dev/themes/default/template/helpers/form/form_category.tpl index e46be38b2..55452b132 100644 --- a/admin-dev/themes/default/template/helpers/form/form_category.tpl +++ b/admin-dev/themes/default/template/helpers/form/form_category.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -35,39 +35,33 @@ buildTreeView(use_context); }); -
        - {$categories.trads['Collapse All']} - | - {$categories.trads['Expand All']} + {$categories.trads['Collapse All']} + {$categories.trads['Expand All']} {if !$categories.use_radio} - | - {$categories.trads['Check All']} - | - {$categories.trads['Uncheck All']} - {/if} + {$categories.trads['Check All']} + {$categories.trads['Uncheck All']} + {/if} {if $categories.use_search} - {$categories.trads.search} : + {$categories.trads.search}:  - + {/if}
        - {assign var=home_is_selected value=false} - {foreach $categories.selected_cat AS $cat} {if is_array($cat)} {if $cat.id_category != $categories.trads.Root.id_category} - + {else} {assign var=home_is_selected value=true} {/if} {else} {if $cat != $categories.trads.Root.id_category} - + {else} {assign var=home_is_selected value=true} {/if} @@ -80,8 +74,8 @@ + {if $home_is_selected}checked="checked"{/if} + onclick="clickOnCategoryBox($(this));"/> {$categories.trads.Root.name} {else}   @@ -97,4 +91,4 @@ searchCategory(); {/if} -{/if} +{/if} \ No newline at end of file diff --git a/admin-dev/themes/default/template/helpers/form/form_group.tpl b/admin-dev/themes/default/template/helpers/form/form_group.tpl index 38face12b..7fdef6501 100644 --- a/admin-dev/themes/default/template/helpers/form/form_group.tpl +++ b/admin-dev/themes/default/template/helpers/form/form_group.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/form/index.php b/admin-dev/themes/default/template/helpers/form/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/helpers/form/index.php +++ b/admin-dev/themes/default/template/helpers/form/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/helpers/help_access/index.php b/admin-dev/themes/default/template/helpers/help_access/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/helpers/help_access/index.php +++ b/admin-dev/themes/default/template/helpers/help_access/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/helpers/index.php b/admin-dev/themes/default/template/helpers/index.php index 192f88787..67d9932bf 100644 --- a/admin-dev/themes/default/template/helpers/index.php +++ b/admin-dev/themes/default/template/helpers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/helpers/list/index.php b/admin-dev/themes/default/template/helpers/list/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/helpers/list/index.php +++ b/admin-dev/themes/default/template/helpers/list/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/helpers/list/list.tpl b/admin-dev/themes/default/template/helpers/list/list.tpl index 5d19e0acd..2913c5b81 100644 --- a/admin-dev/themes/default/template/helpers/list/list.tpl +++ b/admin-dev/themes/default/template/helpers/list/list.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_addstock.tpl b/admin-dev/themes/default/template/helpers/list/list_action_addstock.tpl index be47ecf09..71fa41c06 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_addstock.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_addstock.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_default.tpl b/admin-dev/themes/default/template/helpers/list/list_action_default.tpl index 29c4e69ce..65e8e4ef4 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_default.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_default.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_delete.tpl b/admin-dev/themes/default/template/helpers/list/list_action_delete.tpl index 42130d3d3..d6edb4f14 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_delete.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_delete.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_details.tpl b/admin-dev/themes/default/template/helpers/list/list_action_details.tpl index 8220a3c4c..ddf25ad34 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_details.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_details.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_duplicate.tpl b/admin-dev/themes/default/template/helpers/list/list_action_duplicate.tpl index 7f58faa48..1933226bf 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_duplicate.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_duplicate.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_edit.tpl b/admin-dev/themes/default/template/helpers/list/list_action_edit.tpl index ce21fce1a..db27e6e43 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_edit.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_edit.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_enable.tpl b/admin-dev/themes/default/template/helpers/list/list_action_enable.tpl index d408217de..4abc4a22e 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_enable.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_enable.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_removestock.tpl b/admin-dev/themes/default/template/helpers/list/list_action_removestock.tpl index 796e15b82..77fd920b9 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_removestock.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_removestock.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_supplier_order_receipt.tpl b/admin-dev/themes/default/template/helpers/list/list_action_supplier_order_receipt.tpl index 801f21c6e..00802789e 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_supplier_order_receipt.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_supplier_order_receipt.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_supply_order_change_state.tpl b/admin-dev/themes/default/template/helpers/list/list_action_supply_order_change_state.tpl index 8c200bda5..0c93ac767 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_supply_order_change_state.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_supply_order_change_state.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_supply_order_create_from_template.tpl b/admin-dev/themes/default/template/helpers/list/list_action_supply_order_create_from_template.tpl index 9de56c9a1..4ae4c7f69 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_supply_order_create_from_template.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_supply_order_create_from_template.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_supply_order_receipt.tpl b/admin-dev/themes/default/template/helpers/list/list_action_supply_order_receipt.tpl index 801f21c6e..00802789e 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_supply_order_receipt.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_supply_order_receipt.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_transferstock.tpl b/admin-dev/themes/default/template/helpers/list/list_action_transferstock.tpl index f7711bdd6..60afb2dc3 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_transferstock.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_transferstock.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_action_view.tpl b/admin-dev/themes/default/template/helpers/list/list_action_view.tpl index 1ad9c4fe2..0cd241f71 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_view.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_content.tpl b/admin-dev/themes/default/template/helpers/list/list_content.tpl index c7555753d..add0db76d 100644 --- a/admin-dev/themes/default/template/helpers/list/list_content.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_content.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -61,49 +61,50 @@ {if isset($params.color) && isset($tr[$params.color])} {/if} + {if isset($tr.$key)} + {if isset($params.active)} + {$tr.$key} + {elseif isset($params.activeVisu)} + {if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if} + {elseif isset($params.position)} + {if $order_by == 'position' && $order_way != 'DESC'} + + {l s='Down'} + - {if isset($params.active)} - {$tr.$key} - {elseif isset($params.activeVisu)} - {if $tr.$key}{l s='Enabled'}{else}{l s='Disabled'}{/if} - {elseif isset($params.position)} - {if $order_by == 'position' && $order_way != 'DESC'} - - {l s='Down'} - - - - {l s='Up'} - - {else} - {$tr.$key.position + 1} - {/if} - {elseif isset($params.image)} - {$tr.$key} - {elseif isset($params.icon)} - {$tr[$key]['alt']} - {elseif isset($params.price)} - {$tr.$key} - {elseif isset($params.float)} - {$tr.$key} - {elseif isset($params.type) && $params.type == 'date'} - {$tr.$key} - {elseif isset($params.type) && $params.type == 'datetime'} - {$tr.$key} - {elseif isset($params.type) && $params.type == 'decimal'} - {$tr.$key|string_format:"%.2f"} - {elseif isset($params.type) && $params.type == 'percent'} - {$tr.$key} {l s='%'} - {* If type is 'editable', an input is created *} - {elseif isset($params.type) && $params.type == 'editable' && isset($tr.id)} - - {elseif isset($params.callback)} - {$tr.$key} - {elseif isset($tr.$key) && $key == 'color'} -
        - {elseif isset($tr.$key)} - {if isset($params.maxlength) && Tools::strlen($tr.$key) > $params.maxlength} + + {l s='Up'} + + {else} + {$tr.$key.position + 1} + {/if} + {elseif isset($params.image)} + {$tr.$key} + {elseif isset($params.icon)} + {if is_array($tr[$key])} + {$tr[$key]['alt']} + {/if} + {elseif isset($params.price)} + {$tr.$key} + {elseif isset($params.float)} + {$tr.$key} + {elseif isset($params.type) && $params.type == 'date'} + {$tr.$key} + {elseif isset($params.type) && $params.type == 'datetime'} + {$tr.$key} + {elseif isset($params.type) && $params.type == 'decimal'} + {$tr.$key|string_format:"%.2f"} + {elseif isset($params.type) && $params.type == 'percent'} + {$tr.$key} {l s='%'} + {* If type is 'editable', an input is created *} + {elseif isset($params.type) && $params.type == 'editable' && isset($tr.id)} + + {elseif isset($params.callback)} + {$tr.$key} + {elseif $key == 'color'} +
        + {elseif isset($params.maxlength) && Tools::strlen($tr.$key) > $params.maxlength} {$tr.$key|truncate:$params.maxlength:'...'|escape:'htmlall':'UTF-8'} {else} {$tr.$key|escape:'htmlall':'UTF-8'} @@ -115,6 +116,8 @@ {if isset($params.color) && isset($tr.color)}
        {/if} + {/block} + {block name="close_td"} {/block} {/foreach} diff --git a/admin-dev/themes/default/template/helpers/list/list_footer.tpl b/admin-dev/themes/default/template/helpers/list/list_footer.tpl index 4137cba8b..6e2191115 100644 --- a/admin-dev/themes/default/template/helpers/list/list_footer.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_footer.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/list/list_header.tpl b/admin-dev/themes/default/template/helpers/list/list_header.tpl index a1b7b5715..b8df4bd49 100644 --- a/admin-dev/themes/default/template/helpers/list/list_header.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_header.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -80,6 +80,9 @@ {if !$simple_header}
        + + {block name="override_form_extra"}{/block} + {/if}
        @@ -119,8 +122,7 @@ {if $table_id} id={$table_id}{/if} class="table {if $table_dnd}tableDnD{/if} {$table}" cellpadding="0" cellspacing="0" - style="width: 100%; margin-bottom:10px;" - > + style="width: 100%; margin-bottom:10px;"> {foreach $fields_display AS $key => $params} @@ -146,8 +148,10 @@ {if (!isset($params.orderby) || $params.orderby) && !$simple_header}
        - - + + + + {elseif !$simple_header}
          {/if} @@ -188,8 +192,8 @@ {elseif $params.type == 'date' || $params.type == 'datetime'} - {l s='From'}
        - {l s='To'} + {l s='From'}
        + {l s='To'} {elseif $params.type == 'select'} {if isset($params.filter_key)} + {/if} + + +
        \ No newline at end of file diff --git a/admin-dev/themes/default/template/helpers/options/index.php b/admin-dev/themes/default/template/helpers/options/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/helpers/options/index.php +++ b/admin-dev/themes/default/template/helpers/options/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/helpers/options/options.tpl b/admin-dev/themes/default/template/helpers/options/options.tpl index dc270ac08..ea9bb26c2 100644 --- a/admin-dev/themes/default/template/helpers/options/options.tpl +++ b/admin-dev/themes/default/template/helpers/options/options.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -58,7 +58,7 @@ {/if} {if !$categoryData['hide_multishop_checkbox'] && $use_multishop} - {l s='Check/uncheck all'} {l s='(check boxes if you want to set a custom value for this shop or group shop context)'} + {l s='Check/uncheck all'} {l s='(Check boxes if you want to set a custom value for this shop or group shop context)'}
        {/if} @@ -123,6 +123,15 @@ {$field['title']}
        {/if} + {elseif $field['type'] == 'color'} + {elseif $field['type'] == 'price'} {$currency_left_sign}{$currency_right_sign} {l s='(tax excl.)'} {elseif $field['type'] == 'textLang' || $field['type'] == 'textareaLang' || $field['type'] == 'selectLang'} @@ -179,7 +188,7 @@ {if isset($field['hint'])}{$field['hint']} {/if} {/block}{* end block input *} {if isset($field['desc'])}

        {$field['desc']}

        {/if} - {if $field['is_invisible']}

        {l s='You can\'t change the value of this configuration field in the context of this shop'}

        {/if} + {if $field['is_invisible']}

        {l s='You can\'t change the value of this configuration field in the context of this shop.'}

        {/if}
        diff --git a/admin-dev/themes/default/template/helpers/required_fields.tpl b/admin-dev/themes/default/template/helpers/required_fields.tpl index e628fdf14..c55be5b99 100644 --- a/admin-dev/themes/default/template/helpers/required_fields.tpl +++ b/admin-dev/themes/default/template/helpers/required_fields.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/helpers/view/index.php b/admin-dev/themes/default/template/helpers/view/index.php index bc2f36987..fcb7f5c2b 100644 --- a/admin-dev/themes/default/template/helpers/view/index.php +++ b/admin-dev/themes/default/template/helpers/view/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/helpers/view/view.tpl b/admin-dev/themes/default/template/helpers/view/view.tpl index 1988f3162..a5fe74762 100644 --- a/admin-dev/themes/default/template/helpers/view/view.tpl +++ b/admin-dev/themes/default/template/helpers/view/view.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/index.php b/admin-dev/themes/default/template/index.php index 7a626751d..319128b59 100644 --- a/admin-dev/themes/default/template/index.php +++ b/admin-dev/themes/default/template/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/themes/default/template/invalid_token.tpl b/admin-dev/themes/default/template/invalid_token.tpl index e0fa97961..e97cd66e6 100644 --- a/admin-dev/themes/default/template/invalid_token.tpl +++ b/admin-dev/themes/default/template/invalid_token.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/admin-dev/themes/default/template/layout-ajax.tpl b/admin-dev/themes/default/template/layout-ajax.tpl index 0fa192493..453a76570 100644 --- a/admin-dev/themes/default/template/layout-ajax.tpl +++ b/admin-dev/themes/default/template/layout-ajax.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/modules/sendtoafriend/sendtoafriend-form.php b/admin-dev/themes/default/template/layout-export.tpl old mode 100755 new mode 100644 similarity index 73% rename from modules/sendtoafriend/sendtoafriend-form.php rename to admin-dev/themes/default/template/layout-export.tpl index 07c6afc6e..3197a209b --- a/modules/sendtoafriend/sendtoafriend-form.php +++ b/admin-dev/themes/default/template/layout-export.tpl @@ -1,6 +1,5 @@ - -* @copyright 2007-2012 PrestaShop SA -* @version Release: $Revision$ +* @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 -*/ - -include(dirname(__FILE__).'/../../config/config.inc.php'); -require_once(dirname(__FILE__).'/sendtoafriend.php'); - -$sendtoafriend = new sendToAFriend($dontTranslate = true); -echo $sendtoafriend->displayPageForm(); +*} +{$export_precontent}{foreach from=$export_headers item=header}{$header};{/foreach} +{foreach from=$export_content item=line} +{foreach from=$line item=content}{$content};{/foreach} +{/foreach} \ No newline at end of file diff --git a/admin-dev/themes/default/template/layout.tpl b/admin-dev/themes/default/template/layout.tpl index 9551a83a4..10ca2fd13 100644 --- a/admin-dev/themes/default/template/layout.tpl +++ b/admin-dev/themes/default/template/layout.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -47,15 +47,18 @@ {/if} {/if} - {if isset($informations) && count($informations) && $informations}
        - {foreach $informations as $info} - {$info}
        - {/foreach} + + {l s='Click here to see more informations'} + +

        {/if} - {if isset($confirmations) && count($confirmations) && $confirmations}
        {foreach $confirmations as $conf} @@ -63,7 +66,6 @@ {/foreach}

        {/if} - {if count($warnings)}
        @@ -89,6 +91,5 @@ {/if}
        {/if} - {$page} -{include file='footer.tpl'} +{include file='footer.tpl'} \ No newline at end of file diff --git a/admin-dev/themes/default/template/toolbar.tpl b/admin-dev/themes/default/template/toolbar.tpl index b9b5742f5..957a6b40f 100644 --- a/admin-dev/themes/default/template/toolbar.tpl +++ b/admin-dev/themes/default/template/toolbar.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -29,10 +29,19 @@
          {foreach from=$toolbar_btn item=btn key=k}
        • - - + +
          {$btn.desc}
          + {if $k == 'modules-list'} + + {/if}
        • {/foreach}
        @@ -40,6 +49,7 @@ {/block} diff --git a/admin-dev/themes/index.php b/admin-dev/themes/index.php index 7a626751d..319128b59 100644 --- a/admin-dev/themes/index.php +++ b/admin-dev/themes/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/admin-dev/uploadProductFile.php b/admin-dev/uploadProductFile.php index 0824d6851..6dbcfd9a6 100644 --- a/admin-dev/uploadProductFile.php +++ b/admin-dev/uploadProductFile.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ define('_PS_ADMIN_DIR_', getcwd()); - include(_PS_ADMIN_DIR_.'/../config/config.inc.php'); if (!isset(Context::getContext()->employee) || !Context::getContext()->employee->isLoggedBack()) diff --git a/admin-dev/uploadProductFileAttribute.php b/admin-dev/uploadProductFileAttribute.php index 0daabdd41..715a2e849 100644 --- a/admin-dev/uploadProductFileAttribute.php +++ b/admin-dev/uploadProductFileAttribute.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ define('_PS_ADMIN_DIR_', getcwd()); - include(_PS_ADMIN_DIR_.'/../config/config.inc.php'); if (!isset(Context::getContext()->employee) || !Context::getContext()->employee->isLoggedBack()) diff --git a/attachment.php b/attachment.php index 91234b618..b279b5a60 100644 --- a/attachment.php +++ b/attachment.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=attachment'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/authentication.php b/authentication.php index b4353fc5b..71afb055d 100644 --- a/authentication.php +++ b/authentication.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=authentication'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/best-sales.php b/best-sales.php index 91eb2ebb2..0de3b406a 100644 --- a/best-sales.php +++ b/best-sales.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=best-sales'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/cache/cachefs/index.php b/cache/cachefs/index.php index f5fe8cd4a..319128b59 100644 --- a/cache/cachefs/index.php +++ b/cache/cachefs/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/cache/class_index.php b/cache/class_index.php index d2876e362..db38cb6e9 100644 --- a/cache/class_index.php +++ b/cache/class_index.php @@ -1,637 +1,639 @@ 'override/classes/log/AbstractLogger.php', + 'AbstractLogger' => '', 'AbstractLoggerCore' => 'classes/log/AbstractLogger.php', - 'Address' => 'override/classes/Address.php', - 'AddressController' => 'override/controllers/front/AddressController.php', + 'Address' => '', + 'AddressController' => '', 'AddressControllerCore' => 'controllers/front/AddressController.php', 'AddressCore' => 'classes/Address.php', - 'AddressFormat' => 'override/classes/AddressFormat.php', + 'AddressFormat' => '', 'AddressFormatCore' => 'classes/AddressFormat.php', - 'AddressesController' => 'override/controllers/front/AddressesController.php', + 'AddressesController' => '', 'AddressesControllerCore' => 'controllers/front/AddressesController.php', - 'AdminAccessController' => 'override/controllers/admin/AdminAccessController.php', + 'AdminAccessController' => '', 'AdminAccessControllerCore' => 'controllers/admin/AdminAccessController.php', - 'AdminAddonsCatalogController' => 'override/controllers/admin/AdminAddonsCatalogController.php', + 'AdminAddonsCatalogController' => '', 'AdminAddonsCatalogControllerCore' => 'controllers/admin/AdminAddonsCatalogController.php', - 'AdminAddressesController' => 'override/controllers/admin/AdminAddressesController.php', + 'AdminAddressesController' => '', 'AdminAddressesControllerCore' => 'controllers/admin/AdminAddressesController.php', - 'AdminAdminPreferencesController' => 'override/controllers/admin/AdminAdminPreferencesController.php', + 'AdminAdminPreferencesController' => '', 'AdminAdminPreferencesControllerCore' => 'controllers/admin/AdminAdminPreferencesController.php', - 'AdminAttachmentsController' => 'override/controllers/admin/AdminAttachmentsController.php', + 'AdminAttachmentsController' => '', 'AdminAttachmentsControllerCore' => 'controllers/admin/AdminAttachmentsController.php', - 'AdminAttributeGeneratorController' => 'override/controllers/admin/AdminAttributeGeneratorController.php', + 'AdminAttributeGeneratorController' => '', 'AdminAttributeGeneratorControllerCore' => 'controllers/admin/AdminAttributeGeneratorController.php', - 'AdminAttributesGroupsController' => 'override/controllers/admin/AdminAttributesGroupsController.php', + 'AdminAttributesGroupsController' => '', 'AdminAttributesGroupsControllerCore' => 'controllers/admin/AdminAttributesGroupsController.php', - 'AdminBackupController' => 'override/controllers/admin/AdminBackupController.php', + 'AdminBackupController' => '', 'AdminBackupControllerCore' => 'controllers/admin/AdminBackupController.php', - 'AdminCarriersController' => 'override/controllers/admin/AdminCarriersController.php', + 'AdminCarriersController' => '', 'AdminCarriersControllerCore' => 'controllers/admin/AdminCarriersController.php', - 'AdminCartRulesController' => 'override/controllers/admin/AdminCartRulesController.php', + 'AdminCartRulesController' => '', 'AdminCartRulesControllerCore' => 'controllers/admin/AdminCartRulesController.php', - 'AdminCartsController' => 'override/controllers/admin/AdminCartsController.php', + 'AdminCartsController' => '', 'AdminCartsControllerCore' => 'controllers/admin/AdminCartsController.php', - 'AdminCategoriesController' => 'override/controllers/admin/AdminCategoriesController.php', + 'AdminCategoriesController' => '', 'AdminCategoriesControllerCore' => 'controllers/admin/AdminCategoriesController.php', - 'AdminCmsCategoriesController' => 'override/controllers/admin/AdminCmsCategoriesController.php', + 'AdminCmsCategoriesController' => '', 'AdminCmsCategoriesControllerCore' => 'controllers/admin/AdminCmsCategoriesController.php', - 'AdminCmsContentController' => 'override/controllers/admin/AdminCmsContentController.php', + 'AdminCmsContentController' => '', 'AdminCmsContentControllerCore' => 'controllers/admin/AdminCmsContentController.php', - 'AdminCmsController' => 'override/controllers/admin/AdminCmsController.php', + 'AdminCmsController' => '', 'AdminCmsControllerCore' => 'controllers/admin/AdminCmsController.php', - 'AdminContactsController' => 'override/controllers/admin/AdminContactsController.php', + 'AdminContactsController' => '', 'AdminContactsControllerCore' => 'controllers/admin/AdminContactsController.php', - 'AdminController' => 'override/classes/controller/AdminController.php', + 'AdminController' => '', 'AdminControllerCore' => 'classes/controller/AdminController.php', - 'AdminCountriesController' => 'override/controllers/admin/AdminCountriesController.php', + 'AdminCountriesController' => '', 'AdminCountriesControllerCore' => 'controllers/admin/AdminCountriesController.php', - 'AdminCurrenciesController' => 'override/controllers/admin/AdminCurrenciesController.php', + 'AdminCurrenciesController' => '', 'AdminCurrenciesControllerCore' => 'controllers/admin/AdminCurrenciesController.php', - 'AdminCustomerPreferencesController' => 'override/controllers/admin/AdminCustomerPreferencesController.php', + 'AdminCustomerPreferencesController' => '', 'AdminCustomerPreferencesControllerCore' => 'controllers/admin/AdminCustomerPreferencesController.php', - 'AdminCustomerThreadsController' => 'override/controllers/admin/AdminCustomerThreadsController.php', + 'AdminCustomerThreadsController' => '', 'AdminCustomerThreadsControllerCore' => 'controllers/admin/AdminCustomerThreadsController.php', - 'AdminCustomersController' => 'override/controllers/admin/AdminCustomersController.php', + 'AdminCustomersController' => '', 'AdminCustomersControllerCore' => 'controllers/admin/AdminCustomersController.php', - 'AdminDeliverySlipController' => 'override/controllers/admin/AdminDeliverySlipController.php', + 'AdminDeliverySlipController' => '', 'AdminDeliverySlipControllerCore' => 'controllers/admin/AdminDeliverySlipController.php', - 'AdminEmailsController' => 'override/controllers/admin/AdminEmailsController.php', + 'AdminEmailsController' => '', 'AdminEmailsControllerCore' => 'controllers/admin/AdminEmailsController.php', - 'AdminEmployeesController' => 'override/controllers/admin/AdminEmployeesController.php', + 'AdminEmployeesController' => '', 'AdminEmployeesControllerCore' => 'controllers/admin/AdminEmployeesController.php', - 'AdminFeaturesController' => 'override/controllers/admin/AdminFeaturesController.php', + 'AdminFeaturesController' => '', 'AdminFeaturesControllerCore' => 'controllers/admin/AdminFeaturesController.php', - 'AdminGendersController' => 'override/controllers/admin/AdminGendersController.php', + 'AdminGendersController' => '', 'AdminGendersControllerCore' => 'controllers/admin/AdminGendersController.php', - 'AdminGeolocationController' => 'override/controllers/admin/AdminGeolocationController.php', + 'AdminGeolocationController' => '', 'AdminGeolocationControllerCore' => 'controllers/admin/AdminGeolocationController.php', - 'AdminGroupsController' => 'override/controllers/admin/AdminGroupsController.php', + 'AdminGroupsController' => '', 'AdminGroupsControllerCore' => 'controllers/admin/AdminGroupsController.php', - 'AdminHomeController' => 'override/controllers/admin/AdminHomeController.php', + 'AdminHomeController' => '', 'AdminHomeControllerCore' => 'controllers/admin/AdminHomeController.php', - 'AdminImagesController' => 'override/controllers/admin/AdminImagesController.php', + 'AdminImagesController' => '', 'AdminImagesControllerCore' => 'controllers/admin/AdminImagesController.php', - 'AdminImportController' => 'override/controllers/admin/AdminImportController.php', + 'AdminImportController' => '', 'AdminImportControllerCore' => 'controllers/admin/AdminImportController.php', - 'AdminInformationController' => 'override/controllers/admin/AdminInformationController.php', + 'AdminInformationController' => '', 'AdminInformationControllerCore' => 'controllers/admin/AdminInformationController.php', - 'AdminInvoicesController' => 'override/controllers/admin/AdminInvoicesController.php', + 'AdminInvoicesController' => '', 'AdminInvoicesControllerCore' => 'controllers/admin/AdminInvoicesController.php', - 'AdminLanguagesController' => 'override/controllers/admin/AdminLanguagesController.php', + 'AdminLanguagesController' => '', 'AdminLanguagesControllerCore' => 'controllers/admin/AdminLanguagesController.php', - 'AdminLocalizationController' => 'override/controllers/admin/AdminLocalizationController.php', + 'AdminLocalizationController' => '', 'AdminLocalizationControllerCore' => 'controllers/admin/AdminLocalizationController.php', - 'AdminLoginController' => 'override/controllers/admin/AdminLoginController.php', + 'AdminLoginController' => '', 'AdminLoginControllerCore' => 'controllers/admin/AdminLoginController.php', - 'AdminLogsController' => 'override/controllers/admin/AdminLogsController.php', + 'AdminLogsController' => '', 'AdminLogsControllerCore' => 'controllers/admin/AdminLogsController.php', - 'AdminMaintenanceController' => 'override/controllers/admin/AdminMaintenanceController.php', + 'AdminMaintenanceController' => '', 'AdminMaintenanceControllerCore' => 'controllers/admin/AdminMaintenanceController.php', - 'AdminManufacturersController' => 'override/controllers/admin/AdminManufacturersController.php', + 'AdminManufacturersController' => '', 'AdminManufacturersControllerCore' => 'controllers/admin/AdminManufacturersController.php', - 'AdminMetaController' => 'override/controllers/admin/AdminMetaController.php', + 'AdminMarketingController' => '', + 'AdminMarketingControllerCore' => 'controllers/admin/AdminMarketingController.php', + 'AdminMetaController' => '', 'AdminMetaControllerCore' => 'controllers/admin/AdminMetaController.php', - 'AdminModulesController' => 'override/controllers/admin/AdminModulesController.php', + 'AdminModulesController' => '', 'AdminModulesControllerCore' => 'controllers/admin/AdminModulesController.php', - 'AdminModulesPositionsController' => 'override/controllers/admin/AdminModulesPositionsController.php', + 'AdminModulesPositionsController' => '', 'AdminModulesPositionsControllerCore' => 'controllers/admin/AdminModulesPositionsController.php', - 'AdminNotFoundController' => 'override/controllers/admin/AdminNotFoundController.php', + 'AdminNotFoundController' => '', 'AdminNotFoundControllerCore' => 'controllers/admin/AdminNotFoundController.php', - 'AdminOrderMessageController' => 'override/controllers/admin/AdminOrderMessageController.php', + 'AdminOrderMessageController' => '', 'AdminOrderMessageControllerCore' => 'controllers/admin/AdminOrderMessageController.php', - 'AdminOrderPreferencesController' => 'override/controllers/admin/AdminOrderPreferencesController.php', + 'AdminOrderPreferencesController' => '', 'AdminOrderPreferencesControllerCore' => 'controllers/admin/AdminOrderPreferencesController.php', - 'AdminOrdersController' => 'override/controllers/admin/AdminOrdersController.php', + 'AdminOrdersController' => '', 'AdminOrdersControllerCore' => 'controllers/admin/AdminOrdersController.php', - 'AdminOutstandingController' => 'override/controllers/admin/AdminOutstandingController.php', + 'AdminOutstandingController' => '', 'AdminOutstandingControllerCore' => 'controllers/admin/AdminOutstandingController.php', - 'AdminPPreferencesController' => 'override/controllers/admin/AdminPPreferencesController.php', + 'AdminPPreferencesController' => '', 'AdminPPreferencesControllerCore' => 'controllers/admin/AdminPPreferencesController.php', - 'AdminPaymentController' => 'override/controllers/admin/AdminPaymentController.php', + 'AdminPaymentController' => '', 'AdminPaymentControllerCore' => 'controllers/admin/AdminPaymentController.php', - 'AdminPdfController' => 'override/controllers/admin/AdminPdfController.php', + 'AdminPdfController' => '', 'AdminPdfControllerCore' => 'controllers/admin/AdminPdfController.php', - 'AdminPerformanceController' => 'override/controllers/admin/AdminPerformanceController.php', + 'AdminPerformanceController' => '', 'AdminPerformanceControllerCore' => 'controllers/admin/AdminPerformanceController.php', - 'AdminPreferencesController' => 'override/controllers/admin/AdminPreferencesController.php', + 'AdminPreferencesController' => '', 'AdminPreferencesControllerCore' => 'controllers/admin/AdminPreferencesController.php', - 'AdminProductsController' => 'override/controllers/admin/AdminProductsController.php', + 'AdminProductsController' => '', 'AdminProductsControllerCore' => 'controllers/admin/AdminProductsController.php', - 'AdminProfilesController' => 'override/controllers/admin/AdminProfilesController.php', + 'AdminProfilesController' => '', 'AdminProfilesControllerCore' => 'controllers/admin/AdminProfilesController.php', - 'AdminQuickAccessesController' => 'override/controllers/admin/AdminQuickAccessesController.php', + 'AdminQuickAccessesController' => '', 'AdminQuickAccessesControllerCore' => 'controllers/admin/AdminQuickAccessesController.php', - 'AdminRangePriceController' => 'override/controllers/admin/AdminRangePriceController.php', + 'AdminRangePriceController' => '', 'AdminRangePriceControllerCore' => 'controllers/admin/AdminRangePriceController.php', - 'AdminRangeWeightController' => 'override/controllers/admin/AdminRangeWeightController.php', + 'AdminRangeWeightController' => '', 'AdminRangeWeightControllerCore' => 'controllers/admin/AdminRangeWeightController.php', - 'AdminReferrersController' => 'override/controllers/admin/AdminReferrersController.php', + 'AdminReferrersController' => '', 'AdminReferrersControllerCore' => 'controllers/admin/AdminReferrersController.php', - 'AdminRequestSqlController' => 'override/controllers/admin/AdminRequestSqlController.php', + 'AdminRequestSqlController' => '', 'AdminRequestSqlControllerCore' => 'controllers/admin/AdminRequestSqlController.php', - 'AdminReturnController' => 'override/controllers/admin/AdminReturnController.php', + 'AdminReturnController' => '', 'AdminReturnControllerCore' => 'controllers/admin/AdminReturnController.php', - 'AdminScenesController' => 'override/controllers/admin/AdminScenesController.php', + 'AdminScenesController' => '', 'AdminScenesControllerCore' => 'controllers/admin/AdminScenesController.php', - 'AdminSearchConfController' => 'override/controllers/admin/AdminSearchConfController.php', + 'AdminSearchConfController' => '', 'AdminSearchConfControllerCore' => 'controllers/admin/AdminSearchConfController.php', - 'AdminSearchController' => 'override/controllers/admin/AdminSearchController.php', + 'AdminSearchController' => '', 'AdminSearchControllerCore' => 'controllers/admin/AdminSearchController.php', - 'AdminSearchEnginesController' => 'override/controllers/admin/AdminSearchEnginesController.php', + 'AdminSearchEnginesController' => '', 'AdminSearchEnginesControllerCore' => 'controllers/admin/AdminSearchEnginesController.php', - 'AdminShippingController' => 'override/controllers/admin/AdminShippingController.php', + 'AdminShippingController' => '', 'AdminShippingControllerCore' => 'controllers/admin/AdminShippingController.php', - 'AdminShopController' => 'override/controllers/admin/AdminShopController.php', + 'AdminShopController' => '', 'AdminShopControllerCore' => 'controllers/admin/AdminShopController.php', - 'AdminShopGroupController' => 'override/controllers/admin/AdminShopGroupController.php', + 'AdminShopGroupController' => '', 'AdminShopGroupControllerCore' => 'controllers/admin/AdminShopGroupController.php', - 'AdminShopUrlController' => 'override/controllers/admin/AdminShopUrlController.php', + 'AdminShopUrlController' => '', 'AdminShopUrlControllerCore' => 'controllers/admin/AdminShopUrlController.php', - 'AdminSlipController' => 'override/controllers/admin/AdminSlipController.php', + 'AdminSlipController' => '', 'AdminSlipControllerCore' => 'controllers/admin/AdminSlipController.php', - 'AdminSpecificPriceRuleController' => 'override/controllers/admin/AdminSpecificPriceRuleController.php', + 'AdminSpecificPriceRuleController' => '', 'AdminSpecificPriceRuleControllerCore' => 'controllers/admin/AdminSpecificPriceRuleController.php', - 'AdminStatesController' => 'override/controllers/admin/AdminStatesController.php', + 'AdminStatesController' => '', 'AdminStatesControllerCore' => 'controllers/admin/AdminStatesController.php', - 'AdminStatsController' => 'override/controllers/admin/AdminStatsController.php', + 'AdminStatsController' => '', 'AdminStatsControllerCore' => 'controllers/admin/AdminStatsController.php', - 'AdminStatsTabController' => 'override/controllers/admin/AdminStatsTabController.php', + 'AdminStatsTabController' => '', 'AdminStatsTabControllerCore' => 'controllers/admin/AdminStatsTabController.php', - 'AdminStatusesController' => 'override/controllers/admin/AdminStatusesController.php', + 'AdminStatusesController' => '', 'AdminStatusesControllerCore' => 'controllers/admin/AdminStatusesController.php', - 'AdminStockConfigurationController' => 'override/controllers/admin/AdminStockConfigurationController.php', + 'AdminStockConfigurationController' => '', 'AdminStockConfigurationControllerCore' => 'controllers/admin/AdminStockConfigurationController.php', - 'AdminStockCoverController' => 'override/controllers/admin/AdminStockCoverController.php', + 'AdminStockCoverController' => '', 'AdminStockCoverControllerCore' => 'controllers/admin/AdminStockCoverController.php', - 'AdminStockInstantStateController' => 'override/controllers/admin/AdminStockInstantStateController.php', + 'AdminStockInstantStateController' => '', 'AdminStockInstantStateControllerCore' => 'controllers/admin/AdminStockInstantStateController.php', - 'AdminStockManagementController' => 'override/controllers/admin/AdminStockManagementController.php', + 'AdminStockManagementController' => '', 'AdminStockManagementControllerCore' => 'controllers/admin/AdminStockManagementController.php', - 'AdminStockMvtController' => 'override/controllers/admin/AdminStockMvtController.php', + 'AdminStockMvtController' => '', 'AdminStockMvtControllerCore' => 'controllers/admin/AdminStockMvtController.php', - 'AdminStoresController' => 'override/controllers/admin/AdminStoresController.php', + 'AdminStoresController' => '', 'AdminStoresControllerCore' => 'controllers/admin/AdminStoresController.php', - 'AdminSuppliersController' => 'override/controllers/admin/AdminSuppliersController.php', + 'AdminSuppliersController' => '', 'AdminSuppliersControllerCore' => 'controllers/admin/AdminSuppliersController.php', - 'AdminSupplyOrdersController' => 'override/controllers/admin/AdminSupplyOrdersController.php', + 'AdminSupplyOrdersController' => '', 'AdminSupplyOrdersControllerCore' => 'controllers/admin/AdminSupplyOrdersController.php', - 'AdminTab' => 'override/classes/AdminTab.php', + 'AdminTab' => '', 'AdminTabCore' => 'classes/AdminTab.php', - 'AdminTabsController' => 'override/controllers/admin/AdminTabsController.php', + 'AdminTabsController' => '', 'AdminTabsControllerCore' => 'controllers/admin/AdminTabsController.php', - 'AdminTagsController' => 'override/controllers/admin/AdminTagsController.php', + 'AdminTagsController' => '', 'AdminTagsControllerCore' => 'controllers/admin/AdminTagsController.php', - 'AdminTaxRulesGroupController' => 'override/controllers/admin/AdminTaxRulesGroupController.php', + 'AdminTaxRulesGroupController' => '', 'AdminTaxRulesGroupControllerCore' => 'controllers/admin/AdminTaxRulesGroupController.php', - 'AdminTaxesController' => 'override/controllers/admin/AdminTaxesController.php', + 'AdminTaxesController' => '', 'AdminTaxesControllerCore' => 'controllers/admin/AdminTaxesController.php', - 'AdminThemesController' => 'override/controllers/admin/AdminThemesController.php', + 'AdminThemesController' => '', 'AdminThemesControllerCore' => 'controllers/admin/AdminThemesController.php', - 'AdminTrackingController' => 'override/controllers/admin/AdminTrackingController.php', + 'AdminTrackingController' => '', 'AdminTrackingControllerCore' => 'controllers/admin/AdminTrackingController.php', - 'AdminTranslationsController' => 'override/controllers/admin/AdminTranslationsController.php', + 'AdminTranslationsController' => '', 'AdminTranslationsControllerCore' => 'controllers/admin/AdminTranslationsController.php', - 'AdminWarehousesController' => 'override/controllers/admin/AdminWarehousesController.php', + 'AdminWarehousesController' => '', 'AdminWarehousesControllerCore' => 'controllers/admin/AdminWarehousesController.php', - 'AdminWebserviceController' => 'override/controllers/admin/AdminWebserviceController.php', + 'AdminWebserviceController' => '', 'AdminWebserviceControllerCore' => 'controllers/admin/AdminWebserviceController.php', - 'AdminZonesController' => 'override/controllers/admin/AdminZonesController.php', + 'AdminZonesController' => '', 'AdminZonesControllerCore' => 'controllers/admin/AdminZonesController.php', - 'Alias' => 'override/classes/Alias.php', + 'Alias' => '', 'AliasCore' => 'classes/Alias.php', - 'Attachment' => 'override/classes/Attachment.php', - 'AttachmentController' => 'override/controllers/front/AttachmentController.php', + 'Attachment' => '', + 'AttachmentController' => '', 'AttachmentControllerCore' => 'controllers/front/AttachmentController.php', 'AttachmentCore' => 'classes/Attachment.php', - 'Attribute' => 'override/classes/Attribute.php', + 'Attribute' => '', 'AttributeCore' => 'classes/Attribute.php', - 'AttributeGroup' => 'override/classes/AttributeGroup.php', + 'AttributeGroup' => '', 'AttributeGroupCore' => 'classes/AttributeGroup.php', - 'AuthController' => 'override/controllers/front/AuthController.php', + 'AuthController' => '', 'AuthControllerCore' => 'controllers/front/AuthController.php', 'Autoload' => 'classes/Autoload.php', - 'Backup' => 'override/classes/Backup.php', + 'Backup' => '', 'BackupCore' => 'classes/Backup.php', - 'BestSalesController' => 'override/controllers/front/BestSalesController.php', + 'BestSalesController' => '', 'BestSalesControllerCore' => 'controllers/front/BestSalesController.php', - 'Blowfish' => 'override/classes/Blowfish.php', + 'Blowfish' => '', 'BlowfishCore' => 'classes/Blowfish.php', - 'CMS' => 'override/classes/CMS.php', - 'CMSCategory' => 'override/classes/CMSCategory.php', + 'CMS' => '', + 'CMSCategory' => '', 'CMSCategoryCore' => 'classes/CMSCategory.php', 'CMSCore' => 'classes/CMS.php', - 'CSV' => 'override/classes/CSV.php', + 'CSV' => '', 'CSVCore' => 'classes/CSV.php', - 'Cache' => 'override/classes/cache/Cache.php', - 'CacheApc' => 'override/classes/cache/CacheApc.php', + 'Cache' => '', + 'CacheApc' => '', 'CacheApcCore' => 'classes/cache/CacheApc.php', 'CacheCore' => 'classes/cache/Cache.php', - 'CacheFs' => 'override/classes/cache/CacheFs.php', + 'CacheFs' => '', 'CacheFsCore' => 'classes/cache/CacheFs.php', - 'CacheMemcache' => 'override/classes/cache/CacheMemcache.php', + 'CacheMemcache' => '', 'CacheMemcacheCore' => 'classes/cache/CacheMemcache.php', - 'CacheXcache' => 'override/classes/cache/CacheXcache.php', + 'CacheXcache' => '', 'CacheXcacheCore' => 'classes/cache/CacheXcache.php', - 'Carrier' => 'override/classes/Carrier.php', + 'Carrier' => '', 'CarrierCore' => 'classes/Carrier.php', - 'CarrierModule' => 'override/classes/module/CarrierModule.php', + 'CarrierModule' => '', 'CarrierModuleCore' => 'classes/module/CarrierModule.php', - 'Cart' => 'override/classes/Cart.php', - 'CartController' => 'override/controllers/front/CartController.php', + 'Cart' => '', + 'CartController' => '', 'CartControllerCore' => 'controllers/front/CartController.php', 'CartCore' => 'classes/Cart.php', - 'CartRule' => 'override/classes/CartRule.php', + 'CartRule' => '', 'CartRuleCore' => 'classes/CartRule.php', - 'Category' => 'override/classes/Category.php', - 'CategoryController' => 'override/controllers/front/CategoryController.php', + 'Category' => '', + 'CategoryController' => '', 'CategoryControllerCore' => 'controllers/front/CategoryController.php', 'CategoryCore' => 'classes/Category.php', - 'ChangeCurrencyController' => 'override/controllers/front/ChangeCurrencyController.php', + 'ChangeCurrencyController' => '', 'ChangeCurrencyControllerCore' => 'controllers/front/ChangeCurrencyController.php', - 'Chart' => 'override/classes/Chart.php', + 'Chart' => '', 'ChartCore' => 'classes/Chart.php', - 'CmsController' => 'override/controllers/front/CmsController.php', + 'CmsController' => '', 'CmsControllerCore' => 'controllers/front/CmsController.php', - 'Collection' => 'override/classes/Collection.php', + 'Collection' => '', 'CollectionCore' => 'classes/Collection.php', - 'Combination' => 'override/classes/Combination.php', + 'Combination' => '', 'CombinationCore' => 'classes/Combination.php', - 'CompareController' => 'override/controllers/front/CompareController.php', + 'CompareController' => '', 'CompareControllerCore' => 'controllers/front/CompareController.php', - 'CompareProduct' => 'override/classes/CompareProduct.php', + 'CompareProduct' => '', 'CompareProductCore' => 'classes/CompareProduct.php', - 'Configuration' => 'override/classes/Configuration.php', + 'Configuration' => '', 'ConfigurationCore' => 'classes/Configuration.php', - 'ConfigurationTest' => 'override/classes/ConfigurationTest.php', + 'ConfigurationTest' => '', 'ConfigurationTestCore' => 'classes/ConfigurationTest.php', - 'Connection' => 'override/classes/Connection.php', + 'Connection' => '', 'ConnectionCore' => 'classes/Connection.php', - 'ConnectionsSource' => 'override/classes/ConnectionsSource.php', + 'ConnectionsSource' => '', 'ConnectionsSourceCore' => 'classes/ConnectionsSource.php', - 'Contact' => 'override/classes/Contact.php', - 'ContactController' => 'override/controllers/front/ContactController.php', + 'Contact' => '', + 'ContactController' => '', 'ContactControllerCore' => 'controllers/front/ContactController.php', 'ContactCore' => 'classes/Contact.php', - 'Context' => 'override/classes/Context.php', + 'Context' => '', 'ContextCore' => 'classes/Context.php', - 'Controller' => 'override/classes/controller/Controller.php', + 'Controller' => '', 'ControllerCore' => 'classes/controller/Controller.php', - 'ControllerFactory' => 'override/classes/ControllerFactory.php', + 'ControllerFactory' => '', 'ControllerFactoryCore' => 'classes/ControllerFactory.php', - 'Cookie' => 'override/classes/Cookie.php', + 'Cookie' => '', 'CookieCore' => 'classes/Cookie.php', - 'Country' => 'override/classes/Country.php', + 'Country' => '', 'CountryCore' => 'classes/Country.php', - 'County' => 'override/classes/County.php', + 'County' => '', 'CountyCore' => 'classes/County.php', - 'Currency' => 'override/classes/Currency.php', + 'Currency' => '', 'CurrencyCore' => 'classes/Currency.php', - 'Customer' => 'override/classes/Customer.php', + 'Customer' => '', 'CustomerCore' => 'classes/Customer.php', - 'CustomerMessage' => 'override/classes/CustomerMessage.php', + 'CustomerMessage' => '', 'CustomerMessageCore' => 'classes/CustomerMessage.php', - 'CustomerThread' => 'override/classes/CustomerThread.php', + 'CustomerThread' => '', 'CustomerThreadCore' => 'classes/CustomerThread.php', - 'Customization' => 'override/classes/Customization.php', + 'Customization' => '', 'CustomizationCore' => 'classes/Customization.php', - 'DateRange' => 'override/classes/DateRange.php', + 'DateRange' => '', 'DateRangeCore' => 'classes/DateRange.php', - 'Db' => 'override/classes/db/Db.php', + 'Db' => '', 'DbCore' => 'classes/db/Db.php', - 'DbMySQLi' => 'override/classes/db/DbMySQLi.php', + 'DbMySQLi' => '', 'DbMySQLiCore' => 'classes/db/DbMySQLi.php', - 'DbPDO' => 'override/classes/db/DbPDO.php', + 'DbPDO' => '', 'DbPDOCore' => 'classes/db/DbPDO.php', - 'DbQuery' => 'override/classes/db/DbQuery.php', + 'DbQuery' => '', 'DbQueryCore' => 'classes/db/DbQuery.php', - 'Delivery' => 'override/classes/Delivery.php', + 'Delivery' => '', 'DeliveryCore' => 'classes/Delivery.php', - 'Discount' => 'override/classes/Discount.php', - 'DiscountController' => 'override/controllers/front/DiscountController.php', + 'Discount' => '', + 'DiscountController' => '', 'DiscountControllerCore' => 'controllers/front/DiscountController.php', 'DiscountCore' => 'classes/Discount.php', - 'Dispatcher' => 'override/classes/Dispatcher.php', + 'Dispatcher' => '', 'DispatcherCore' => 'classes/Dispatcher.php', - 'Employee' => 'override/classes/Employee.php', + 'Employee' => '', 'EmployeeCore' => 'classes/Employee.php', - 'Feature' => 'override/classes/Feature.php', + 'Feature' => '', 'FeatureCore' => 'classes/Feature.php', - 'FeatureValue' => 'override/classes/FeatureValue.php', + 'FeatureValue' => '', 'FeatureValueCore' => 'classes/FeatureValue.php', - 'FileLogger' => 'override/classes/log/FileLogger.php', + 'FileLogger' => '', 'FileLoggerCore' => 'classes/log/FileLogger.php', - 'FileUploader' => 'override/classes/FileUploader.php', + 'FileUploader' => '', 'FileUploaderCore' => 'classes/FileUploader.php', - 'FrontController' => 'override/classes/controller/FrontController.php', + 'FrontController' => '', 'FrontControllerCore' => 'classes/controller/FrontController.php', - 'Gender' => 'override/classes/Gender.php', + 'Gender' => '', 'GenderCore' => 'classes/Gender.php', - 'GetFileController' => 'override/controllers/front/GetFileController.php', + 'GetFileController' => '', 'GetFileControllerCore' => 'controllers/front/GetFileController.php', - 'Group' => 'override/classes/Group.php', + 'Group' => '', 'GroupCore' => 'classes/Group.php', - 'GroupReduction' => 'override/classes/GroupReduction.php', + 'GroupReduction' => '', 'GroupReductionCore' => 'classes/GroupReduction.php', - 'Guest' => 'override/classes/Guest.php', + 'Guest' => '', 'GuestCore' => 'classes/Guest.php', - 'GuestTrackingController' => 'override/controllers/front/GuestTrackingController.php', + 'GuestTrackingController' => '', 'GuestTrackingControllerCore' => 'controllers/front/GuestTrackingController.php', - 'HTMLTemplate' => 'override/classes/pdf/HTMLTemplate.php', + 'HTMLTemplate' => '', 'HTMLTemplateCore' => 'classes/pdf/HTMLTemplate.php', - 'HTMLTemplateDeliverySlip' => 'override/classes/pdf/HTMLTemplateDeliverySlip.php', + 'HTMLTemplateDeliverySlip' => '', 'HTMLTemplateDeliverySlipCore' => 'classes/pdf/HTMLTemplateDeliverySlip.php', - 'HTMLTemplateInvoice' => 'override/classes/pdf/HTMLTemplateInvoice.php', + 'HTMLTemplateInvoice' => '', 'HTMLTemplateInvoiceCore' => 'classes/pdf/HTMLTemplateInvoice.php', - 'HTMLTemplateOrderReturn' => 'override/classes/pdf/HTMLTemplateOrderReturn.php', + 'HTMLTemplateOrderReturn' => '', 'HTMLTemplateOrderReturnCore' => 'classes/pdf/HTMLTemplateOrderReturn.php', - 'HTMLTemplateOrderSlip' => 'override/classes/pdf/HTMLTemplateOrderSlip.php', + 'HTMLTemplateOrderSlip' => '', 'HTMLTemplateOrderSlipCore' => 'classes/pdf/HTMLTemplateOrderSlip.php', - 'HTMLTemplateSupplyOrderForm' => 'override/classes/pdf/HTMLTemplateSupplyOrderForm.php', + 'HTMLTemplateSupplyOrderForm' => '', 'HTMLTemplateSupplyOrderFormCore' => 'classes/pdf/HTMLTemplateSupplyOrderForm.php', - 'HelpAccess' => 'override/classes/HelpAccess.php', + 'HelpAccess' => '', 'HelpAccessCore' => 'classes/HelpAccess.php', - 'Helper' => 'override/classes/helper/Helper.php', + 'Helper' => '', 'HelperCore' => 'classes/helper/Helper.php', - 'HelperForm' => 'override/classes/helper/HelperForm.php', + 'HelperForm' => '', 'HelperFormCore' => 'classes/helper/HelperForm.php', - 'HelperHelpAccess' => 'override/classes/helper/HelperHelpAccess.php', + 'HelperHelpAccess' => '', 'HelperHelpAccessCore' => 'classes/helper/HelperHelpAccess.php', - 'HelperList' => 'override/classes/helper/HelperList.php', + 'HelperList' => '', 'HelperListCore' => 'classes/helper/HelperList.php', - 'HelperOptions' => 'override/classes/helper/HelperOptions.php', + 'HelperOptions' => '', 'HelperOptionsCore' => 'classes/helper/HelperOptions.php', - 'HelperView' => 'override/classes/helper/HelperView.php', + 'HelperView' => '', 'HelperViewCore' => 'classes/helper/HelperView.php', - 'HistoryController' => 'override/controllers/front/HistoryController.php', + 'HistoryController' => '', 'HistoryControllerCore' => 'controllers/front/HistoryController.php', - 'Hook' => 'override/classes/Hook.php', + 'Hook' => '', 'HookCore' => 'classes/Hook.php', - 'IdentityController' => 'override/controllers/front/IdentityController.php', + 'IdentityController' => '', 'IdentityControllerCore' => 'controllers/front/IdentityController.php', - 'Image' => 'override/classes/Image.php', + 'Image' => '', 'ImageCore' => 'classes/Image.php', - 'ImageManager' => 'override/classes/ImageManager.php', + 'ImageManager' => '', 'ImageManagerCore' => 'classes/ImageManager.php', - 'ImageType' => 'override/classes/ImageType.php', + 'ImageType' => '', 'ImageTypeCore' => 'classes/ImageType.php', - 'ImportModule' => 'override/classes/module/ImportModule.php', + 'ImportModule' => '', 'ImportModuleCore' => 'classes/module/ImportModule.php', - 'IndexController' => 'override/controllers/front/IndexController.php', + 'IndexController' => '', 'IndexControllerCore' => 'controllers/front/IndexController.php', - 'Language' => 'override/classes/Language.php', + 'Language' => '', 'LanguageCore' => 'classes/Language.php', - 'Link' => 'override/classes/Link.php', + 'Link' => '', 'LinkCore' => 'classes/Link.php', - 'LocalizationPack' => 'override/classes/LocalizationPack.php', + 'LocalizationPack' => '', 'LocalizationPackCore' => 'classes/LocalizationPack.php', - 'Logger' => 'override/classes/Logger.php', + 'Logger' => '', 'LoggerCore' => 'classes/Logger.php', - 'Mail' => 'override/classes/Mail.php', + 'Mail' => '', 'MailCore' => 'classes/Mail.php', - 'Manufacturer' => 'override/classes/Manufacturer.php', - 'ManufacturerController' => 'override/controllers/front/ManufacturerController.php', + 'Manufacturer' => '', + 'ManufacturerController' => '', 'ManufacturerControllerCore' => 'controllers/front/ManufacturerController.php', 'ManufacturerCore' => 'classes/Manufacturer.php', - 'Media' => 'override/classes/Media.php', + 'Media' => '', 'MediaCore' => 'classes/Media.php', - 'Message' => 'override/classes/Message.php', + 'Message' => '', 'MessageCore' => 'classes/Message.php', - 'Meta' => 'override/classes/Meta.php', + 'Meta' => '', 'MetaCore' => 'classes/Meta.php', - 'Module' => 'override/classes/module/Module.php', - 'ModuleAdminController' => 'override/classes/controller/ModuleAdminController.php', + 'Module' => '', + 'ModuleAdminController' => '', 'ModuleAdminControllerCore' => 'classes/controller/ModuleAdminController.php', 'ModuleCore' => 'classes/module/Module.php', - 'ModuleFrontController' => 'override/classes/controller/ModuleFrontController.php', + 'ModuleFrontController' => '', 'ModuleFrontControllerCore' => 'classes/controller/ModuleFrontController.php', - 'ModuleGraph' => 'override/classes/module/ModuleGraph.php', + 'ModuleGraph' => '', 'ModuleGraphCore' => 'classes/module/ModuleGraph.php', - 'ModuleGraphEngine' => 'override/classes/module/ModuleGraphEngine.php', + 'ModuleGraphEngine' => '', 'ModuleGraphEngineCore' => 'classes/module/ModuleGraphEngine.php', - 'ModuleGrid' => 'override/classes/module/ModuleGrid.php', + 'ModuleGrid' => '', 'ModuleGridCore' => 'classes/module/ModuleGrid.php', - 'ModuleGridEngine' => 'override/classes/module/ModuleGridEngine.php', + 'ModuleGridEngine' => '', 'ModuleGridEngineCore' => 'classes/module/ModuleGridEngine.php', - 'MyAccountController' => 'override/controllers/front/MyAccountController.php', + 'MyAccountController' => '', 'MyAccountControllerCore' => 'controllers/front/MyAccountController.php', - 'MySQL' => 'override/classes/db/MySQL.php', + 'MySQL' => '', 'MySQLCore' => 'classes/db/MySQL.php', - 'NewProductsController' => 'override/controllers/front/NewProductsController.php', + 'NewProductsController' => '', 'NewProductsControllerCore' => 'controllers/front/NewProductsController.php', - 'Notification' => 'override/classes/Notification.php', + 'Notification' => '', 'NotificationCore' => 'classes/Notification.php', - 'ObjectModel' => 'override/classes/ObjectModel.php', + 'ObjectModel' => '', 'ObjectModelCore' => 'classes/ObjectModel.php', - 'Order' => 'override/classes/order/Order.php', - 'OrderCarrier' => 'override/classes/order/OrderCarrier.php', + 'Order' => '', + 'OrderCarrier' => '', 'OrderCarrierCore' => 'classes/order/OrderCarrier.php', - 'OrderCartRule' => 'override/classes/order/OrderCartRule.php', + 'OrderCartRule' => '', 'OrderCartRuleCore' => 'classes/order/OrderCartRule.php', - 'OrderConfirmationController' => 'override/controllers/front/OrderConfirmationController.php', + 'OrderConfirmationController' => '', 'OrderConfirmationControllerCore' => 'controllers/front/OrderConfirmationController.php', - 'OrderController' => 'override/controllers/front/OrderController.php', + 'OrderController' => '', 'OrderControllerCore' => 'controllers/front/OrderController.php', 'OrderCore' => 'classes/order/Order.php', - 'OrderDetail' => 'override/classes/order/OrderDetail.php', - 'OrderDetailController' => 'override/controllers/front/OrderDetailController.php', + 'OrderDetail' => '', + 'OrderDetailController' => '', 'OrderDetailControllerCore' => 'controllers/front/OrderDetailController.php', 'OrderDetailCore' => 'classes/order/OrderDetail.php', - 'OrderDiscount' => 'override/classes/order/OrderDiscount.php', + 'OrderDiscount' => '', 'OrderDiscountCore' => 'classes/order/OrderDiscount.php', - 'OrderFollowController' => 'override/controllers/front/OrderFollowController.php', + 'OrderFollowController' => '', 'OrderFollowControllerCore' => 'controllers/front/OrderFollowController.php', - 'OrderHistory' => 'override/classes/order/OrderHistory.php', + 'OrderHistory' => '', 'OrderHistoryCore' => 'classes/order/OrderHistory.php', - 'OrderInvoice' => 'override/classes/order/OrderInvoice.php', + 'OrderInvoice' => '', 'OrderInvoiceCore' => 'classes/order/OrderInvoice.php', - 'OrderMessage' => 'override/classes/order/OrderMessage.php', + 'OrderMessage' => '', 'OrderMessageCore' => 'classes/order/OrderMessage.php', - 'OrderOpcController' => 'override/controllers/front/OrderOpcController.php', + 'OrderOpcController' => '', 'OrderOpcControllerCore' => 'controllers/front/OrderOpcController.php', - 'OrderPayment' => 'override/classes/order/OrderPayment.php', + 'OrderPayment' => '', 'OrderPaymentCore' => 'classes/order/OrderPayment.php', - 'OrderReturn' => 'override/classes/order/OrderReturn.php', - 'OrderReturnController' => 'override/controllers/front/OrderReturnController.php', + 'OrderReturn' => '', + 'OrderReturnController' => '', 'OrderReturnControllerCore' => 'controllers/front/OrderReturnController.php', 'OrderReturnCore' => 'classes/order/OrderReturn.php', - 'OrderReturnState' => 'override/classes/order/OrderReturnState.php', + 'OrderReturnState' => '', 'OrderReturnStateCore' => 'classes/order/OrderReturnState.php', - 'OrderSlip' => 'override/classes/order/OrderSlip.php', - 'OrderSlipController' => 'override/controllers/front/OrderSlipController.php', + 'OrderSlip' => '', + 'OrderSlipController' => '', 'OrderSlipControllerCore' => 'controllers/front/OrderSlipController.php', 'OrderSlipCore' => 'classes/order/OrderSlip.php', - 'OrderState' => 'override/classes/order/OrderState.php', + 'OrderState' => '', 'OrderStateCore' => 'classes/order/OrderState.php', - 'PDF' => 'override/classes/pdf/PDF.php', + 'PDF' => '', 'PDFCore' => 'classes/pdf/PDF.php', - 'PDFGenerator' => 'override/classes/pdf/PDFGenerator.php', + 'PDFGenerator' => '', 'PDFGeneratorCore' => 'classes/pdf/PDFGenerator.php', - 'Pack' => 'override/classes/Pack.php', + 'Pack' => '', 'PackCore' => 'classes/Pack.php', - 'Page' => 'override/classes/Page.php', + 'Page' => '', 'PageCore' => 'classes/Page.php', - 'PageNotFoundController' => 'override/controllers/front/PageNotFoundController.php', + 'PageNotFoundController' => '', 'PageNotFoundControllerCore' => 'controllers/front/PageNotFoundController.php', - 'ParentOrderController' => 'override/controllers/front/ParentOrderController.php', + 'ParentOrderController' => '', 'ParentOrderControllerCore' => 'controllers/front/ParentOrderController.php', - 'PasswordController' => 'override/controllers/front/PasswordController.php', + 'PasswordController' => '', 'PasswordControllerCore' => 'controllers/front/PasswordController.php', - 'PaymentCC' => 'override/classes/PaymentCC.php', + 'PaymentCC' => '', 'PaymentCCCore' => 'classes/PaymentCC.php', - 'PaymentModule' => 'override/classes/PaymentModule.php', + 'PaymentModule' => '', 'PaymentModuleCore' => 'classes/PaymentModule.php', - 'PdfInvoiceController' => 'override/controllers/front/PdfInvoiceController.php', + 'PdfInvoiceController' => '', 'PdfInvoiceControllerCore' => 'controllers/front/PdfInvoiceController.php', - 'PdfOrderReturnController' => 'override/controllers/front/PdfOrderReturnController.php', + 'PdfOrderReturnController' => '', 'PdfOrderReturnControllerCore' => 'controllers/front/PdfOrderReturnController.php', - 'PdfOrderSlipController' => 'override/controllers/front/PdfOrderSlipController.php', + 'PdfOrderSlipController' => '', 'PdfOrderSlipControllerCore' => 'controllers/front/PdfOrderSlipController.php', - 'PrestaShopDatabaseException' => 'override/classes/exception/PrestaShopDatabaseException.php', + 'PrestaShopDatabaseException' => '', 'PrestaShopDatabaseExceptionCore' => 'classes/exception/PrestaShopDatabaseException.php', - 'PrestaShopException' => 'override/classes/exception/PrestaShopException.php', + 'PrestaShopException' => '', 'PrestaShopExceptionCore' => 'classes/exception/PrestaShopException.php', - 'PrestaShopModuleException' => 'override/classes/exception/PrestaShopModuleException.php', + 'PrestaShopModuleException' => '', 'PrestaShopModuleExceptionCore' => 'classes/exception/PrestaShopModuleException.php', - 'PrestaShopPaymentException' => 'override/classes/exception/PrestaShopPaymentException.php', + 'PrestaShopPaymentException' => '', 'PrestaShopPaymentExceptionCore' => 'classes/exception/PrestaShopPaymentException.php', - 'PricesDropController' => 'override/controllers/front/PricesDropController.php', + 'PricesDropController' => '', 'PricesDropControllerCore' => 'controllers/front/PricesDropController.php', - 'Product' => 'override/classes/Product.php', - 'ProductController' => 'override/controllers/front/ProductController.php', + 'Product' => '', + 'ProductController' => '', 'ProductControllerCore' => 'controllers/front/ProductController.php', 'ProductCore' => 'classes/Product.php', - 'ProductDownload' => 'override/classes/ProductDownload.php', + 'ProductDownload' => '', 'ProductDownloadCore' => 'classes/ProductDownload.php', - 'ProductSale' => 'override/classes/ProductSale.php', + 'ProductSale' => '', 'ProductSaleCore' => 'classes/ProductSale.php', - 'ProductSupplier' => 'override/classes/ProductSupplier.php', + 'ProductSupplier' => '', 'ProductSupplierCore' => 'classes/ProductSupplier.php', - 'Profile' => 'override/classes/Profile.php', + 'Profile' => '', 'ProfileCore' => 'classes/Profile.php', - 'QuickAccess' => 'override/classes/QuickAccess.php', + 'QuickAccess' => '', 'QuickAccessCore' => 'classes/QuickAccess.php', - 'RangePrice' => 'override/classes/range/RangePrice.php', + 'RangePrice' => '', 'RangePriceCore' => 'classes/range/RangePrice.php', - 'RangeWeight' => 'override/classes/range/RangeWeight.php', + 'RangeWeight' => '', 'RangeWeightCore' => 'classes/range/RangeWeight.php', - 'Referrer' => 'override/classes/Referrer.php', + 'Referrer' => '', 'ReferrerCore' => 'classes/Referrer.php', - 'RequestSql' => 'override/classes/RequestSql.php', + 'RequestSql' => '', 'RequestSqlCore' => 'classes/RequestSql.php', - 'Rijndael' => 'override/classes/Rijndael.php', + 'Rijndael' => '', 'RijndaelCore' => 'classes/Rijndael.php', - 'Risk' => 'override/classes/Risk.php', + 'Risk' => '', 'RiskCore' => 'classes/Risk.php', - 'Scene' => 'override/classes/Scene.php', + 'Scene' => '', 'SceneCore' => 'classes/Scene.php', - 'Search' => 'override/classes/Search.php', - 'SearchController' => 'override/controllers/front/SearchController.php', + 'Search' => '', + 'SearchController' => '', 'SearchControllerCore' => 'controllers/front/SearchController.php', 'SearchCore' => 'classes/Search.php', - 'SearchEngine' => 'override/classes/SearchEngine.php', + 'SearchEngine' => '', 'SearchEngineCore' => 'classes/SearchEngine.php', - 'Shop' => 'override/classes/shop/Shop.php', + 'Shop' => '', 'ShopCore' => 'classes/shop/Shop.php', - 'ShopGroup' => 'override/classes/shop/ShopGroup.php', + 'ShopGroup' => '', 'ShopGroupCore' => 'classes/shop/ShopGroup.php', - 'ShopUrl' => 'override/classes/shop/ShopUrl.php', + 'ShopUrl' => '', 'ShopUrlCore' => 'classes/shop/ShopUrl.php', - 'SitemapController' => 'override/controllers/front/SitemapController.php', + 'SitemapController' => '', 'SitemapControllerCore' => 'controllers/front/SitemapController.php', - 'SpecificPrice' => 'override/classes/SpecificPrice.php', + 'SpecificPrice' => '', 'SpecificPriceCore' => 'classes/SpecificPrice.php', - 'SpecificPriceRule' => 'override/classes/SpecificPriceRule.php', + 'SpecificPriceRule' => '', 'SpecificPriceRuleCore' => 'classes/SpecificPriceRule.php', - 'State' => 'override/classes/State.php', + 'State' => '', 'StateCore' => 'classes/State.php', - 'StatisticsController' => 'override/controllers/front/StatisticsController.php', + 'StatisticsController' => '', 'StatisticsControllerCore' => 'controllers/front/StatisticsController.php', - 'Stock' => 'override/classes/stock/Stock.php', - 'StockAvailable' => 'override/classes/stock/StockAvailable.php', + 'Stock' => '', + 'StockAvailable' => '', 'StockAvailableCore' => 'classes/stock/StockAvailable.php', 'StockCore' => 'classes/stock/Stock.php', - 'StockManager' => 'override/classes/stock/StockManager.php', + 'StockManager' => '', 'StockManagerCore' => 'classes/stock/StockManager.php', - 'StockManagerFactory' => 'override/classes/stock/StockManagerFactory.php', + 'StockManagerFactory' => '', 'StockManagerFactoryCore' => 'classes/stock/StockManagerFactory.php', 'StockManagerInterface' => 'classes/stock/StockManagerInterface.php', - 'StockManagerModule' => 'override/classes/stock/StockManagerModule.php', + 'StockManagerModule' => '', 'StockManagerModuleCore' => 'classes/stock/StockManagerModule.php', - 'StockMvt' => 'override/classes/stock/StockMvt.php', + 'StockMvt' => '', 'StockMvtCore' => 'classes/stock/StockMvt.php', - 'StockMvtReason' => 'override/classes/stock/StockMvtReason.php', + 'StockMvtReason' => '', 'StockMvtReasonCore' => 'classes/stock/StockMvtReason.php', - 'StockMvtWS' => 'override/classes/stock/StockMvtWS.php', + 'StockMvtWS' => '', 'StockMvtWSCore' => 'classes/stock/StockMvtWS.php', - 'Store' => 'override/classes/Store.php', + 'Store' => '', 'StoreCore' => 'classes/Store.php', - 'StoresController' => 'override/controllers/front/StoresController.php', + 'StoresController' => '', 'StoresControllerCore' => 'controllers/front/StoresController.php', - 'Supplier' => 'override/classes/Supplier.php', - 'SupplierController' => 'override/controllers/front/SupplierController.php', + 'Supplier' => '', + 'SupplierController' => '', 'SupplierControllerCore' => 'controllers/front/SupplierController.php', 'SupplierCore' => 'classes/Supplier.php', - 'SupplyOrder' => 'override/classes/stock/SupplyOrder.php', + 'SupplyOrder' => '', 'SupplyOrderCore' => 'classes/stock/SupplyOrder.php', - 'SupplyOrderDetail' => 'override/classes/stock/SupplyOrderDetail.php', + 'SupplyOrderDetail' => '', 'SupplyOrderDetailCore' => 'classes/stock/SupplyOrderDetail.php', - 'SupplyOrderHistory' => 'override/classes/stock/SupplyOrderHistory.php', + 'SupplyOrderHistory' => '', 'SupplyOrderHistoryCore' => 'classes/stock/SupplyOrderHistory.php', - 'SupplyOrderReceiptHistory' => 'override/classes/stock/SupplyOrderReceiptHistory.php', + 'SupplyOrderReceiptHistory' => '', 'SupplyOrderReceiptHistoryCore' => 'classes/stock/SupplyOrderReceiptHistory.php', - 'SupplyOrderState' => 'override/classes/stock/SupplyOrderState.php', + 'SupplyOrderState' => '', 'SupplyOrderStateCore' => 'classes/stock/SupplyOrderState.php', - 'Tab' => 'override/classes/Tab.php', + 'Tab' => '', 'TabCore' => 'classes/Tab.php', - 'Tag' => 'override/classes/Tag.php', + 'Tag' => '', 'TagCore' => 'classes/Tag.php', - 'Tax' => 'override/classes/tax/Tax.php', - 'TaxCalculator' => 'override/classes/tax/TaxCalculator.php', + 'Tax' => '', + 'TaxCalculator' => '', 'TaxCalculatorCore' => 'classes/tax/TaxCalculator.php', 'TaxCore' => 'classes/tax/Tax.php', - 'TaxManagerFactory' => 'override/classes/tax/TaxManagerFactory.php', + 'TaxManagerFactory' => '', 'TaxManagerFactoryCore' => 'classes/tax/TaxManagerFactory.php', 'TaxManagerInterface' => 'classes/tax/TaxManagerInterface.php', - 'TaxManagerModule' => 'override/classes/tax/TaxManagerModule.php', + 'TaxManagerModule' => '', 'TaxManagerModuleCore' => 'classes/tax/TaxManagerModule.php', - 'TaxRule' => 'override/classes/tax/TaxRule.php', + 'TaxRule' => '', 'TaxRuleCore' => 'classes/tax/TaxRule.php', - 'TaxRulesGroup' => 'override/classes/tax/TaxRulesGroup.php', + 'TaxRulesGroup' => '', 'TaxRulesGroupCore' => 'classes/tax/TaxRulesGroup.php', - 'TaxRulesTaxManager' => 'override/classes/tax/TaxRulesTaxManager.php', + 'TaxRulesTaxManager' => '', 'TaxRulesTaxManagerCore' => 'classes/tax/TaxRulesTaxManager.php', - 'Theme' => 'override/classes/Theme.php', + 'Theme' => '', 'ThemeCore' => 'classes/Theme.php', - 'Tools' => 'override/classes/Tools.php', + 'Tools' => '', 'ToolsCore' => 'classes/Tools.php', - 'Translate' => 'override/classes/Translate.php', + 'Translate' => '', 'TranslateCore' => 'classes/Translate.php', - 'TranslatedConfiguration' => 'override/classes/TranslatedConfiguration.php', + 'TranslatedConfiguration' => '', 'TranslatedConfigurationCore' => 'classes/TranslatedConfiguration.php', - 'Upgrader' => 'override/classes/Upgrader.php', + 'Upgrader' => '', 'UpgraderCore' => 'classes/Upgrader.php', - 'Validate' => 'override/classes/Validate.php', + 'Validate' => '', 'ValidateCore' => 'classes/Validate.php', - 'Warehouse' => 'override/classes/stock/Warehouse.php', + 'Warehouse' => '', 'WarehouseCore' => 'classes/stock/Warehouse.php', - 'WarehouseProductLocation' => 'override/classes/stock/WarehouseProductLocation.php', + 'WarehouseProductLocation' => '', 'WarehouseProductLocationCore' => 'classes/stock/WarehouseProductLocation.php', - 'WebserviceException' => 'override/classes/webservice/WebserviceException.php', + 'WebserviceException' => '', 'WebserviceExceptionCore' => 'classes/webservice/WebserviceException.php', - 'WebserviceKey' => 'override/classes/webservice/WebserviceKey.php', + 'WebserviceKey' => '', 'WebserviceKeyCore' => 'classes/webservice/WebserviceKey.php', - 'WebserviceOutputBuilder' => 'override/classes/webservice/WebserviceOutputBuilder.php', + 'WebserviceOutputBuilder' => '', 'WebserviceOutputBuilderCore' => 'classes/webservice/WebserviceOutputBuilder.php', 'WebserviceOutputInterface' => 'classes/webservice/WebserviceOutputInterface.php', - 'WebserviceOutputXML' => 'override/classes/webservice/WebserviceOutputXML.php', + 'WebserviceOutputXML' => '', 'WebserviceOutputXMLCore' => 'classes/webservice/WebserviceOutputXML.php', - 'WebserviceRequest' => 'override/classes/webservice/WebserviceRequest.php', + 'WebserviceRequest' => '', 'WebserviceRequestCore' => 'classes/webservice/WebserviceRequest.php', - 'WebserviceSpecificManagementImages' => 'override/classes/webservice/WebserviceSpecificManagementImages.php', + 'WebserviceSpecificManagementImages' => '', 'WebserviceSpecificManagementImagesCore' => 'classes/webservice/WebserviceSpecificManagementImages.php', 'WebserviceSpecificManagementInterface' => 'classes/webservice/WebserviceSpecificManagementInterface.php', - 'WebserviceSpecificManagementSearch' => 'override/classes/webservice/WebserviceSpecificManagementSearch.php', + 'WebserviceSpecificManagementSearch' => '', 'WebserviceSpecificManagementSearchCore' => 'classes/webservice/WebserviceSpecificManagementSearch.php', - 'Zone' => 'override/classes/Zone.php', + 'Zone' => '', 'ZoneCore' => 'classes/Zone.php', ); ?> \ No newline at end of file diff --git a/cache/index.php b/cache/index.php index f5fe8cd4a..319128b59 100644 --- a/cache/index.php +++ b/cache/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/mails/fr/index.php b/cache/sandbox/index.php similarity index 95% rename from mails/fr/index.php rename to cache/sandbox/index.php index 88e934d59..195fab225 100644 --- a/mails/fr/index.php +++ b/cache/sandbox/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/cache/smarty/cache/index.php b/cache/smarty/cache/index.php index 15aba8204..195fab225 100644 --- a/cache/smarty/cache/index.php +++ b/cache/smarty/cache/index.php @@ -1,4 +1,28 @@ +* @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"); diff --git a/cache/smarty/compile/index.php b/cache/smarty/compile/index.php index 15aba8204..195fab225 100644 --- a/cache/smarty/compile/index.php +++ b/cache/smarty/compile/index.php @@ -1,4 +1,28 @@ +* @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"); diff --git a/cache/smarty/index.php b/cache/smarty/index.php index 15aba8204..195fab225 100644 --- a/cache/smarty/index.php +++ b/cache/smarty/index.php @@ -1,4 +1,28 @@ +* @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"); diff --git a/cache/tcpdf/index.php b/cache/tcpdf/index.php index 15aba8204..52b4e5c37 100755 --- a/cache/tcpdf/index.php +++ b/cache/tcpdf/index.php @@ -1,4 +1,28 @@ +* @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 +*/ header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); diff --git a/cart.php b/cart.php index 821b7074a..ab2437822 100644 --- a/cart.php +++ b/cart.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/category.php b/category.php index 441327494..a4113606e 100644 --- a/category.php +++ b/category.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=category'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/changecurrency.php b/changecurrency.php index c70d9a63c..fe8e4a65d 100644 --- a/changecurrency.php +++ b/changecurrency.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=change-currency'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +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'); \ No newline at end of file diff --git a/classes/Address.php b/classes/Address.php index bd2daea0e..cb1fef134 100644 --- a/classes/Address.php +++ b/classes/Address.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -124,8 +124,8 @@ class AddressCore extends ObjectModel 'postcode' => array('type' => self::TYPE_STRING, 'validate' => 'isPostCode', 'size' => 12), 'city' => array('type' => self::TYPE_STRING, 'validate' => 'isCityName', 'required' => true, 'size' => 64), 'other' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'size' => 300), - 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 16), - 'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 16), + 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), + 'phone_mobile' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), 'dni' => array('type' => self::TYPE_STRING, 'validate' => 'isDniLite', 'size' => 16), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'copy_post' => false), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDateFormat', 'copy_post' => false), @@ -222,7 +222,7 @@ class AddressCore extends ObjectModel public function validateController($htmlentities = true) { $errors = parent::validateController($htmlentities); - if (!Configuration::get('VATNUMBER_CHECKING')) + if (!Configuration::get('VATNUMBER_MANAGEMENT') || !Configuration::get('VATNUMBER_CHECKING')) return $errors; include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php'); if (class_exists('VatNumber', false)) @@ -237,6 +237,8 @@ class AddressCore extends ObjectModel */ public static function getZoneById($id_address) { + if(!isset($id_address) || empty($id_address)) + return false; if (isset(self::$_idZones[$id_address])) return self::$_idZones[$id_address]; @@ -259,6 +261,9 @@ class AddressCore extends ObjectModel */ public static function isCountryActiveById($id_address) { + if(!isset($id_address) || empty($id_address)) + return false; + if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT c.`active` FROM `'._DB_PREFIX_.'address` a @@ -337,12 +342,6 @@ class AddressCore extends ObjectModel */ public static function initialize($id_address = null) { - // set the default address - $address = new Address(); - $address->id_country = (int)Context::getContext()->country->id; - $address->id_state = 0; - $address->postcode = 0; - // if an id_address has been specified retrieve the address if ($id_address) { @@ -351,6 +350,14 @@ class AddressCore extends ObjectModel if (!Validate::isLoadedObject($address)) throw new PrestaShopException('Invalid address'); } + else + { + // set the default address + $address = new Address(); + $address->id_country = (int)Context::getContext()->country->id; + $address->id_state = 0; + $address->postcode = 0; + } return $address; } diff --git a/classes/AddressFormat.php b/classes/AddressFormat.php index 4bda5caa7..0c9fc1183 100644 --- a/classes/AddressFormat.php +++ b/classes/AddressFormat.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -61,7 +61,6 @@ class AddressFormatCore extends ObjectModel public static $forbiddenPropertyList = array( 'deleted', 'date_add', - 'other', 'alias', 'secure_key', 'note', @@ -74,6 +73,7 @@ class AddressFormatCore extends ObjectModel 'active', 'is_guest', 'date_upd', + 'country', 'years', 'days', 'months', diff --git a/classes/AdminTab.php b/classes/AdminTab.php index 85867d1b3..6375b5f12 100644 --- a/classes/AdminTab.php +++ b/classes/AdminTab.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -1676,9 +1676,9 @@ abstract class AdminTabCore elseif (isset($params['float'])) echo rtrim(rtrim($tr[$key], '0'), '.'); elseif (isset($params['type']) && $params['type'] == 'date') - echo Tools::displayDate($tr[$key], $this->context->language->id); + echo Tools::displayDate($tr[$key]); elseif (isset($params['type']) && $params['type'] == 'datetime') - echo Tools::displayDate($tr[$key], $this->context->language->id, true); + echo Tools::displayDate($tr[$key],null , true); elseif (isset($tr[$key])) { if ($key == 'price') diff --git a/classes/Alias.php b/classes/Alias.php index 3aa107f29..b6fda0903 100644 --- a/classes/Alias.php +++ b/classes/Alias.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Attachment.php b/classes/Attachment.php index 24c602235..4f980022e 100644 --- a/classes/Attachment.php +++ b/classes/Attachment.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Attribute.php b/classes/Attribute.php index 71e324c15..93391bc6c 100644 --- a/classes/Attribute.php +++ b/classes/Attribute.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -47,7 +47,6 @@ class AttributeCore extends ObjectModel 'color' => array('type' => self::TYPE_STRING, 'validate' => 'isColor'), 'position' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), - // Lang fields 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), ) ); @@ -72,7 +71,7 @@ class AttributeCore extends ObjectModel public function delete() { - if (!$this->hasMultishopEntries()) + if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) { $result = Db::getInstance()->executeS('SELECT id_product_attribute FROM '._DB_PREFIX_.'product_attribute_combination WHERE id_attribute = '.(int)$this->id); foreach ($result as $row) @@ -130,7 +129,7 @@ class AttributeCore extends ObjectModel return array(); return Db::getInstance()->executeS(' - SELECT ag.*, agl.*, a.`id_attribute`, al.`name`, agl.`name` AS `attribute_group` + SELECT DISTINCT ag.*, agl.*, a.`id_attribute`, al.`name`, agl.`name` AS `attribute_group` FROM `'._DB_PREFIX_.'attribute_group` ag LEFT JOIN `'._DB_PREFIX_.'attribute_group_lang` agl ON (ag.`id_attribute_group` = agl.`id_attribute_group` AND agl.`id_lang` = '.(int)$id_lang.') @@ -344,4 +343,4 @@ class AttributeCore extends ObjectModel return (is_numeric($position)) ? $position : -1; } -} +} \ No newline at end of file diff --git a/classes/AttributeGroup.php b/classes/AttributeGroup.php index 98b943a84..15f72122a 100644 --- a/classes/AttributeGroup.php +++ b/classes/AttributeGroup.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -70,6 +70,11 @@ class AttributeGroupCore extends ObjectModel public function add($autodate = true, $nullValues = false) { + if ($this->group_type == 'color') + $this->is_color_group = 1; + else + $this->is_color_group = 0; + if ($this->position <= 0) $this->position = AttributeGroup::getHigherPosition() + 1; @@ -80,11 +85,16 @@ class AttributeGroupCore extends ObjectModel public function update($nullValues = false) { + if ($this->group_type == 'color') + $this->is_color_group = 1; + else + $this->is_color_group = 0; + $return = parent::update($nullValues); Hook::exec('actionAttributeGroupSave', array('id_attribute_group' => $this->id)); return $return; } - + public static function cleanDeadCombinations() { $attribute_combinations = Db::getInstance()->executeS(' @@ -109,7 +119,7 @@ class AttributeGroupCore extends ObjectModel public function delete() { - if (!$this->hasMultishopEntries()) + if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) { /* Select children in order to find linked combinations */ $attribute_ids = Db::getInstance()->executeS(' diff --git a/classes/Autoload.php b/classes/Autoload.php index 4b6e74ac6..11436fda4 100644 --- a/classes/Autoload.php +++ b/classes/Autoload.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -129,29 +129,24 @@ class Autoload // Write classes index on disc to cache it $filename = $this->root_dir.Autoload::INDEX_FILE; if ((file_exists($filename) && !is_writable($filename)) || !is_writable(dirname($filename))) - throw new PrestaShopException($filename.' is not writable, please give write permissions (chmod 666) on this file.'); + { + header('HTTP/1.1 503 temporarily overloaded'); + // Cannot use PrestaShopException in this context + die('/cache/class_index.php is not writable, please give write permissions (chmod 666) on this file.'); + } else { - // Let's write index content in cache file - // In order to be sure that this file is correctly written, a check is done on the file content - $loop_protection = 0; - do - { - $integrity_is_ok = false; - file_put_contents($filename, $content); - 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; + $filename_tmp = tempnam(dirname($filename), basename($filename.'.')); + if($filename_tmp !== FALSE and file_put_contents($filename_tmp, $content, LOCK_EX) !== FALSE) + { + rename($filename_tmp, $filename); + @chmod($filename, 0664); } - while (!$integrity_is_ok); - - if (!$integrity_is_ok) - { - file_put_contents($filename, ''); - throw new PrestaShopException('Your file '.$filename.' is corrupted. Please remove this file, a new one will be regenerated automatically'); + else + { + // $filename_tmp couldn't be written. $filename should be there anyway (even if outdated), + // no need to die. + error_log('Cannot write temporary file '.$filename_tmp); } } diff --git a/classes/Backup.php b/classes/Backup.php index 31c5bab0f..3368a23a4 100644 --- a/classes/Backup.php +++ b/classes/Backup.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Blowfish.php b/classes/Blowfish.php index d940c52cb..2fd8e53d5 100644 --- a/classes/Blowfish.php +++ b/classes/Blowfish.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -42,7 +42,7 @@ class BlowfishCore extends Crypt_Blowfish $piece = substr($paddedtext, $x, 8); $cipher_piece = parent::encrypt($piece); $encoded = base64_encode($cipher_piece); - $ciphertext = $ciphertext.$encoded; + $ciphertext = $ciphertext.$encoded; } return $ciphertext.sprintf('%06d', $length); } diff --git a/classes/CMS.php b/classes/CMS.php index 391a3e8b1..db9d69d52 100644 --- a/classes/CMS.php +++ b/classes/CMS.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -53,7 +53,7 @@ class CMSCore extends ObjectModel 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128), - 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), + 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 3999999999999), ), ); diff --git a/classes/CMSCategory.php b/classes/CMSCategory.php index fb78e3fb7..ad81d0ad6 100644 --- a/classes/CMSCategory.php +++ b/classes/CMSCategory.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/CSV.php b/classes/CSV.php index e6df279b3..755e68865 100644 --- a/classes/CSV.php +++ b/classes/CSV.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Carrier.php b/classes/Carrier.php index 6beb272b0..3c3f5039a 100644 --- a/classes/Carrier.php +++ b/classes/Carrier.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -128,7 +128,7 @@ class CarrierCore extends ObjectModel 'max_width' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'max_height' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'max_depth' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), - 'max_weight' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), + 'max_weight' => array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat'), 'grade' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt', 'size' => 1), 'external_module_name' => array('type' => self::TYPE_STRING, 'size' => 64), 'is_module' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), @@ -165,6 +165,14 @@ class CarrierCore extends ObjectModel public function __construct($id = null, $id_lang = null) { parent::__construct($id, $id_lang); + + /** + * keep retrocompatibility SHIPPING_METHOD_DEFAULT + * @deprecated 1.5.5 + */ + if ($this->shipping_method == Carrier::SHIPPING_METHOD_DEFAULT) + $this->shipping_method = ((int)Configuration::get('PS_SHIPPING_METHOD') ? Carrier::SHIPPING_METHOD_WEIGHT : Carrier::SHIPPING_METHOD_PRICE); + /** * keep retrocompatibility id_tax_rules_group * @deprecated 1.5.0 @@ -370,13 +378,12 @@ class CarrierCore extends ObjectModel */ public static function getDeliveryPriceByRanges($range_table, $id_carrier) { - $range_table = pSQL($range_table); - $sql = 'SELECT d.id_'.$range_table.', d.id_carrier, d.id_zone, d.price + $sql = 'SELECT d.`id_'.bqSQL($range_table).'`, d.id_carrier, d.id_zone, d.price FROM '._DB_PREFIX_.'delivery d - LEFT JOIN '._DB_PREFIX_.$range_table.' r ON r.id_'.$range_table.' = d.id_'.$range_table.' + LEFT JOIN `'._DB_PREFIX_.bqSQL($range_table).'` r ON r.`id_'.bqSQL($range_table).'` = d.`id_'.bqSQL($range_table).'` WHERE d.id_carrier = '.(int)$id_carrier.' - AND d.id_'.$range_table.' IS NOT NULL - AND d.id_'.$range_table.' != 0 + AND d.`id_'.bqSQL($range_table).'` IS NOT NULL + AND d.`id_'.bqSQL($range_table).'` != 0 '.Carrier::sqlDeliveryRangeShop($range_table).' ORDER BY r.delimiter1'; return Db::getInstance()->executeS($sql); @@ -456,6 +463,22 @@ class CarrierCore extends ObjectModel return $carriers; } + public static function getIdTaxRulesGroupMostUsed() + { + return Db::getInstance()->getValue(' + SELECT id_tax_rules_group + FROM ( + SELECT COUNT(*) n, c.id_tax_rules_group + FROM '._DB_PREFIX_.'carrier c + JOIN '._DB_PREFIX_.'tax_rules_group trg ON (c.id_tax_rules_group = trg.id_tax_rules_group) + WHERE trg.active = 1 + GROUP BY c.id_tax_rules_group + ORDER BY n DESC + LIMIT 1 + ) most_used' + ); + } + public static function getDeliveredCountries($id_lang, $active_countries = false, $active_carriers = false, $contain_states = null) { if (!Validate::isBool($active_countries) || !Validate::isBool($active_carriers)) @@ -467,7 +490,9 @@ class CarrierCore extends ObjectModel ORDER BY s.`name` ASC'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT cl.*,c.*, cl.`name` AS country, zz.`name` AS zone FROM `'._DB_PREFIX_.'country` c + SELECT cl.*,c.*, cl.`name` AS country, zz.`name` AS zone + FROM `'._DB_PREFIX_.'country` c'. + Shop::addSqlAssociation('country', 'c').' LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country` AND cl.`id_lang` = '.(int)$id_lang.') INNER JOIN (`'._DB_PREFIX_.'carrier_zone` cz INNER JOIN `'._DB_PREFIX_.'carrier` cr ON ( cr.id_carrier = cz.id_carrier AND cr.deleted = 0 '. ($active_carriers ? 'AND cr.active = 1) ' : ') ').' @@ -482,7 +507,8 @@ class CarrierCore extends ObjectModel $countries[$country['id_country']] = $country; foreach ($states as &$state) if (isset($countries[$state['id_country']])) /* Does not keep the state if its country has been disabled and not selected */ - $countries[$state['id_country']]['states'][] = $state; + if ($state['active'] == 1) + $countries[$state['id_country']]['states'][] = $state; return $countries; } @@ -564,8 +590,8 @@ class CarrierCore extends ObjectModel } $row['name'] = (strval($row['name']) != '0' ? $row['name'] : Configuration::get('PS_SHOP_NAME')); - $row['price'] = ($shipping_method == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier'])); - $row['price_tax_exc'] = ($shipping_method == Carrier::SHIPPING_METHOD_FREE ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier'], false)); + $row['price'] = (($shipping_method == Carrier::SHIPPING_METHOD_FREE) ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier'], true, null, null, $id_zone)); + $row['price_tax_exc'] = (($shipping_method == Carrier::SHIPPING_METHOD_FREE) ? 0 : $cart->getPackageShippingCost((int)$row['id_carrier'], false, null, null, $id_zone)); $row['img'] = file_exists(_PS_SHIP_IMG_DIR_.(int)$row['id_carrier']).'.jpg' ? _THEME_SHIP_DIR_.(int)$row['id_carrier'].'.jpg' : ''; // If price is false, then the carrier is unavailable (carrier module) @@ -709,7 +735,7 @@ class CarrierCore extends ObjectModel */ public function deleteDeliveryPrice($range_table) { - $where = '`id_carrier` = '.(int)$this->id.' AND (`id_'.$range_table.'` IS NOT NULL OR `id_'.$range_table.'` = 0) '; + $where = '`id_carrier` = '.(int)$this->id.' AND (`id_'.bqSQL($range_table).'` IS NOT NULL OR `id_'.bqSQL($range_table).'` = 0) '; if (Shop::getContext() == Shop::CONTEXT_ALL) $where .= 'AND id_shop IS NULL AND id_shop_group IS NULL'; @@ -727,7 +753,7 @@ class CarrierCore extends ObjectModel * @param array $priceList Prices list in multiple arrays (changed to array since 1.5.0) * @return boolean Insertion result */ - public function addDeliveryPrice($price_list) + public function addDeliveryPrice($price_list, $delete = false) { if (!$price_list) return false; @@ -746,6 +772,17 @@ class CarrierCore extends ObjectModel if (!isset($values['id_shop_group'])) $values['id_shop_group'] = (Shop::getContext() != Shop::CONTEXT_ALL) ? Shop::getContextShopGroupID() : null; + if ($delete) + Db::getInstance()->execute(' + DELETE FROM `'._DB_PREFIX_.'delivery` + WHERE id_shop = '.(int)$values['id_shop'].' + AND id_shop_group='.(int)$values['id_shop_group'].' + AND id_carrier='.(int)$values['id_carrier']. + ($values['id_range_price'] !== null ? ' AND id_range_price='.(int)$values['id_range_price'] : ''). + ($values['id_range_weight'] !== null ? ' AND id_range_weight='.(int)$values['id_range_weight'] : '').' + AND id_zone='.(int)$values['id_zone'] + ); + $sql .= '('; foreach ($values as $v) { @@ -849,8 +886,7 @@ class CarrierCore extends ObjectModel (SELECT '.(int)$this->id.', `id_tax_rules_group`, `id_shop` FROM `'._DB_PREFIX_.'carrier_tax_rules_group_shop` WHERE `id_carrier`='.(int)$old_id.')'); - // Update warehouse_carriers - Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'warehouse_carrier SET id_carrier='.(int)$this->id.' WHERE id_carrier='.(int)$old_id); + } /** @@ -910,9 +946,11 @@ class CarrierCore extends ObjectModel 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) return new RangeWeight(); elseif ($shipping_method == Carrier::SHIPPING_METHOD_PRICE) @@ -1030,9 +1068,9 @@ class CarrierCore extends ObjectModel $sql = 'AND '.$alias.'.id_delivery = ( SELECT d2.id_delivery FROM '._DB_PREFIX_.'delivery d2 - WHERE d2.id_carrier = '.$alias.'.id_carrier - AND d2.id_zone = '.$alias.'.id_zone - AND d2.id_'.$range_table.' = '.$alias.'.id_'.$range_table.' + WHERE d2.id_carrier = `'.bqSQL($alias).'`.id_carrier + AND d2.id_zone = `'.bqSQL($alias).'`.id_zone + AND d2.`id_'.bqSQL($range_table).'` = `'.bqSQL($alias).'`.`id_'.bqSQL($range_table).'` '.$where.' ORDER BY d2.id_shop DESC, d2.id_shop_group DESC LIMIT 1 @@ -1161,23 +1199,18 @@ class CarrierCore extends ObjectModel $query->where('pc.id_product = '.(int)$product->id); $query->where('pc.id_shop = '.(int)$id_shop); - $carriers = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); - - if (!empty($carriers)) - { + $carriers_for_product = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); + $carrier_list = array(); + if (!empty($carriers_for_product)) + { //the product is linked with carriers - $carrier_list = array(); - foreach ($carriers as $carrier) //check if the linked carriers are available in current zone + foreach ($carriers_for_product as $carrier) //check if the linked carriers are available in current zone if (Carrier::checkCarrierZone($carrier['id_carrier'], $id_zone)) $carrier_list[] = $carrier['id_carrier']; - if (!empty($carrier_list)) - return $carrier_list; - else + if (empty($carrier_list)) return array();//no linked carrier are available for this zone } - $carrier_list = array(); - // The product is not dirrectly linked with a carrier // Get all the carriers linked to a warehouse if ($id_warehouse) @@ -1189,13 +1222,17 @@ class CarrierCore extends ObjectModel $available_carrier_list = array(); $customer = new Customer($cart->id_customer); $carriers = Carrier::getCarriersForOrder($id_zone, $customer->getGroups(), $cart); + foreach ($carriers as $carrier) $available_carrier_list[] = $carrier['id_carrier']; - - if (empty($warehouse_carrier_list)) - $carrier_list = $available_carrier_list; + + if ($carrier_list) + $carrier_list = array_intersect($available_carrier_list, $carrier_list); else - $carrier_list = array_intersect($warehouse_carrier_list, $available_carrier_list); + $carrier_list = $available_carrier_list; + + if (isset($warehouse_carrier_list)) + $carrier_list = array_intersect($carrier_list, $warehouse_carrier_list); if ($product->width > 0 || $product->height > 0 || $product->depth > 0 || $product->weight > 0) { @@ -1249,5 +1286,18 @@ class CarrierCore extends ObjectModel return true; } + + public function setGroups($groups, $delete = true) + { + if ($delete) + Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'carrier_group WHERE id_carrier = '.(int)$id_carrier); + if (!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, ',')); + } } diff --git a/classes/Cart.php b/classes/Cart.php index 6941b6471..337d55e1a 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -51,7 +51,7 @@ class CartCore extends ObjectModel public $id_lang; /** @var boolean True if the customer wants a recycled package */ - public $recyclable = 1; + public $recyclable = 0; /** @var boolean True if the customer wants a gift wrapping */ public $gift = 0; @@ -59,6 +59,9 @@ class CartCore extends ObjectModel /** @var string Gift message if specified */ public $gift_message; + /** @var boolean Mobile Theme */ + public $mobile_theme; + /** @var string Object creation date */ public $date_add; @@ -109,6 +112,7 @@ class CartCore extends ObjectModel 'recyclable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'gift' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'gift_message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage'), + 'mobile_theme' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'delivery_option' => array('type' => self::TYPE_STRING), 'secure_key' => array('type' => self::TYPE_STRING, 'size' => 32), 'allow_seperated_package' =>array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), @@ -119,12 +123,12 @@ class CartCore extends ObjectModel protected $webserviceParameters = array( 'fields' => array( - 'id_address_delivery' => array('xlink_resource' => 'addresses'), - 'id_address_invoice' => array('xlink_resource' => 'addresses'), - 'id_currency' => array('xlink_resource' => 'currencies'), - 'id_customer' => array('xlink_resource' => 'customers'), - 'id_guest' => array('xlink_resource' => 'guests'), - 'id_lang' => array('xlink_resource' => 'languages'), + 'id_address_delivery' => array('xlink_resource' => 'addresses'), + 'id_address_invoice' => array('xlink_resource' => 'addresses'), + 'id_currency' => array('xlink_resource' => 'currencies'), + 'id_customer' => array('xlink_resource' => 'customers'), + 'id_guest' => array('xlink_resource' => 'guests'), + 'id_lang' => array('xlink_resource' => 'languages'), ), 'associations' => array( 'cart_rows' => array('resource' => 'cart_row', 'virtual_entity' => true, 'fields' => array( @@ -154,7 +158,6 @@ class CartCore extends ObjectModel $customer = Context::getContext()->customer; else $customer = new Customer((int)$this->id_customer); - $this->_taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group); if ((!$this->secure_key || $this->secure_key == '-1') && $customer->secure_key) { @@ -162,8 +165,7 @@ class CartCore extends ObjectModel $this->save(); } } - else - $this->_taxCalculationMethod = Group::getDefaultPriceDisplayMethod(); + $this->_taxCalculationMethod = Group::getPriceDisplayMethod(Group::getCurrent()->id); } @@ -290,7 +292,7 @@ class CartCore extends ObjectModel if (Configuration::get('PS_TAX_ADDRESS_TYPE') == 'id_address_invoice') $address_id = (int)$cart->id_address_invoice; else - $address_id = (int)$product->id_address_delivery; // Get delivery address of the product from the cart + $address_id = (int)$product['id_address_delivery']; // Get delivery address of the product from the cart if (!Address::addressExists($address_id)) $address_id = null; @@ -422,11 +424,12 @@ class CartCore extends ObjectModel // Build SELECT $sql->select('cp.`id_product_attribute`, cp.`id_product`, cp.`quantity` AS cart_quantity, cp.id_shop, pl.`name`, p.`is_virtual`, pl.`description_short`, pl.`available_now`, pl.`available_later`, p.`id_product`, product_shop.`id_category_default`, p.`id_supplier`, - p.`id_manufacturer`, product_shop.`on_sale`, product_shop.`ecotax`, product_shop.`additional_shipping_cost`, product_shop.`available_for_order`, product_shop.`price`, p.`weight`, - stock.`quantity` quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, product_shop.`active`, p.`date_add`, - p.`date_upd`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category, - CONCAT(cp.`id_product`, cp.`id_product_attribute`, cp.`id_address_delivery`) AS unique_id, cp.id_address_delivery, - product_shop.`wholesale_price`, product_shop.advanced_stock_management'); + p.`id_manufacturer`, product_shop.`on_sale`, product_shop.`ecotax`, product_shop.`additional_shipping_cost`, + product_shop.`available_for_order`, product_shop.`price`, product_shop.`active`, product_shop.`unity`, product_shop.`unit_price_ratio`, + stock.`quantity` AS quantity_available, p.`width`, p.`height`, p.`depth`, stock.`out_of_stock`, p.`weight`, + p.`date_add`, p.`date_upd`, IFNULL(stock.quantity, 0) as quantity, pl.`link_rewrite`, cl.`link_rewrite` AS category, + CONCAT(cp.`id_product`, IFNULL(cp.`id_product_attribute`, 0), IFNULL(cp.`id_address_delivery`, 0)) AS unique_id, cp.id_address_delivery, + product_shop.`wholesale_price`, product_shop.advanced_stock_management, ps.product_supplier_reference supplier_reference'); // Build FROM $sql->from('cart_product', 'cp'); @@ -438,13 +441,14 @@ class CartCore extends ObjectModel p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$this->id_lang.Shop::addSqlRestrictionOnLang('pl', 'cp.id_shop') ); - $sql->leftJoin('category_lang', 'cl', ' product_shop.`id_category_default` = cl.`id_category` AND cl.`id_lang` = '.(int)$this->id_lang.Shop::addSqlRestrictionOnLang('cl', 'cp.id_shop') ); + $sql->leftJoin('product_supplier', 'ps', 'ps.id_product=cp.id_product AND ps.id_product_attribute=cp.id_product_attribute AND ps.id_supplier=p.id_supplier'); + // @todo test if everything is ok, then refactorise call of this method $sql->join(Product::sqlStock('cp', 'cp')); @@ -474,7 +478,6 @@ class CartCore extends ObjectModel $sql->select(' product_attribute_shop.`price` AS price_attribute, product_attribute_shop.`ecotax` AS ecotax_attr, IF (IFNULL(pa.`reference`, \'\') = \'\', p.`reference`, pa.`reference`) AS reference, - IF (IFNULL(pa.`supplier_reference`, \'\') = \'\', p.`supplier_reference`, pa.`supplier_reference`) AS supplier_reference, (p.`weight`+ pa.`weight`) weight_attribute, IF (IFNULL(pa.`ean13`, \'\') = \'\', p.`ean13`, pa.`ean13`) AS ean13, IF (IFNULL(pa.`upc`, \'\') = \'\', p.`upc`, pa.`upc`) AS upc, @@ -489,7 +492,7 @@ class CartCore extends ObjectModel } else $sql->select( - 'p.`reference` AS reference, p.`supplier_reference` AS supplier_reference, p.`ean13`, + 'p.`reference` AS reference, p.`ean13`, p.`upc` AS upc, product_shop.`minimal_quantity` AS minimal_quantity' ); $result = Db::getInstance()->executeS($sql); @@ -629,8 +632,8 @@ class CartCore extends ObjectModel { $row2 = Db::getInstance()->getRow(' SELECT image_shop.`id_image` id_image, il.`legend` - FROM `'._DB_PREFIX_.'image` i'. - Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' + FROM `'._DB_PREFIX_.'image` i + JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (i.id_image = image_shop.id_image AND image_shop.cover=1 AND image_shop.id_shop='.(int)$row['id_shop'].') LEFT JOIN `'._DB_PREFIX_.'image_lang` il ON (image_shop.`id_image` = il.`id_image` AND il.`id_lang` = '.(int)$this->id_lang.') WHERE i.`id_product` = '.(int)$row['id_product'].' AND image_shop.`cover` = 1' ); @@ -832,6 +835,13 @@ class CartCore extends ObjectModel $id_product_attribute = (int)$id_product_attribute; $product = new Product($id_product, false, Configuration::get('PS_LANG_DEFAULT'), $shop->id); + if ($id_product_attribute) + { + $combination = new Combination((int)$id_product_attribute); + if ($combination->id_product != $id_product) + return false; + } + /* If we have a product combination, the minimal quantity is set with the one of this combination */ if (!empty($id_product_attribute)) $minimal_quantity = (int)Attribute::getAttributeMinimalQty($id_product_attribute); @@ -944,6 +954,7 @@ class CartCore extends ObjectModel $this->update(true); $context = Context::getContext()->cloneContext(); $context->cart = $this; + Cache::clean('getContextualValue_*'); if ($auto_add_cart_rule) CartRule::autoAddToCart($context); @@ -1131,8 +1142,8 @@ class CartCore extends ObjectModel 'SELECT `quantity` FROM `'._DB_PREFIX_.'cart_product` WHERE `id_product` = '.(int)$id_product.' - AND `id_product_attribute` = '.(int)$id_product_attribute - ); + AND `id_cart` = '.(int)$this->id.' + AND `id_product_attribute` = '.(int)$id_product_attribute); $customization_quantity = (int)Db::getInstance()->getValue(' SELECT `quantity` @@ -1142,12 +1153,12 @@ class CartCore extends ObjectModel AND `id_product_attribute` = '.(int)$id_product_attribute.' '.((int)$id_address_delivery ? 'AND `id_address_delivery` = '.(int)$id_address_delivery : '')); - if (!$this->_deleteCustomization((int)$id_customization, (int)$id_product, (int)$id_product_attribute, $id_address_delivery)) + if (!$this->_deleteCustomization((int)$id_customization, (int)$id_product, (int)$id_product_attribute, (int)$id_address_delivery)) return false; // refresh cache of self::_products $this->_products = $this->getProducts(true); - return ($this->deleteProduct((int)$id_product, $id_product_attribute, $id_address_delivery) && $customization_quantity == $product_total_quantity); + return ($customization_quantity == $product_total_quantity && $this->deleteProduct((int)$id_product, (int)$id_product_attribute, null, (int)$id_address_delivery)); } /* Get customization quantity */ @@ -1156,8 +1167,7 @@ class CartCore extends ObjectModel FROM `'._DB_PREFIX_.'customization` WHERE `id_cart` = '.(int)$this->id.' AND `id_product` = '.(int)$id_product.' - AND `id_product_attribute` = '.(int)$id_product_attribute - ); + AND `id_product_attribute` = '.(int)$id_product_attribute); if ($result === false) return false; @@ -1171,7 +1181,7 @@ class CartCore extends ObjectModel AND `id_product` = '.(int)$id_product. ($id_product_attribute != null ? ' AND `id_product_attribute` = '.(int)$id_product_attribute : '') ); - + /* Product deletion */ $result = Db::getInstance()->execute(' DELETE FROM `'._DB_PREFIX_.'cart_product` @@ -1186,6 +1196,7 @@ class CartCore extends ObjectModel // refresh cache of self::_products $this->_products = $this->getProducts(true); CartRule::autoRemoveFromCart(); + CartRule::autoAddToCart(); return $return; } @@ -1326,6 +1337,9 @@ class CartCore extends ObjectModel else $shipping_fees = 0; + if ($type == Cart::ONLY_SHIPPING) + return $shipping_fees; + if ($type == Cart::ONLY_PRODUCTS_WITHOUT_SHIPPING) $type = Cart::ONLY_PRODUCTS; @@ -1449,21 +1463,15 @@ class CartCore extends ObjectModel // Wrapping Fees $wrapping_fees = 0; if ($this->gift) - { - $wrapping_fees = (float)Configuration::get('PS_GIFT_WRAPPING_PRICE'); - if ($with_taxes) - { - $wrapping_fees_tax = new Tax(Configuration::get('PS_GIFT_WRAPPING_TAX')); - $wrapping_fees *= 1 + ((float)$wrapping_fees_tax->rate / 100); - } - $wrapping_fees = Tools::convertPrice(Tools::ps_round($wrapping_fees, 2), Currency::getCurrencyInstance((int)$this->id_currency)); - } + $wrapping_fees = Tools::convertPrice(Tools::ps_round($this->getGiftWrappingPrice($with_taxes), 2), Currency::getCurrencyInstance((int)$this->id_currency)); + if ($type == Cart::ONLY_WRAPPING) + return $wrapping_fees; $order_total_discount = 0; if (!in_array($type, array(Cart::ONLY_SHIPPING, Cart::ONLY_PRODUCTS)) && CartRule::isFeatureActive()) { // First, retrieve the cart rules associated to this "getOrderTotal" - if ($with_shipping) + if ($with_shipping || $type == Cart::ONLY_DISCOUNTS) $cart_rules = $this->getCartRules(CartRule::FILTER_ACTION_ALL); else { @@ -1489,7 +1497,7 @@ class CartCore extends ObjectModel foreach ($cart_rules as $cart_rule) { // If the cart rule offers free shipping, add the shipping cost - if ($with_shipping && $cart_rule['obj']->free_shipping) + if (($with_shipping || $type == Cart::ONLY_DISCOUNTS) && $cart_rule['obj']->free_shipping) $order_total_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_SHIPPING, ($param_product ? $package : null), $use_cache), 2); // If the cart rule is a free gift, then add the free gift value only if the gift is in this package @@ -1509,21 +1517,12 @@ class CartCore extends ObjectModel // If the cart rule offers a reduction, the amount is prorated (with the products in the package) if ($cart_rule['obj']->reduction_percent > 0 || $cart_rule['obj']->reduction_amount > 0) - { $order_total_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_REDUCTION, $package, $use_cache), 2); - } } - $order_total_discount = min(Tools::ps_round($order_total_discount, 2), $wrapping_fees + $order_total_products + $shipping_fees); $order_total -= $order_total_discount; } - if ($type == Cart::ONLY_SHIPPING) - return $shipping_fees; - - if ($type == Cart::ONLY_WRAPPING) - return $wrapping_fees; - if ($type == Cart::BOTH) $order_total += $shipping_fees + $wrapping_fees; @@ -1535,6 +1534,32 @@ class CartCore extends ObjectModel return Tools::ps_round((float)$order_total, 2); } + + /** + * Get the gift wrapping price + * @param boolean $with_taxes With or without taxes + * @return gift wrapping price + */ + public function getGiftWrappingPrice($with_taxes = true, $id_address = null) + { + static $address = null; + + if ($id_address === null) + $id_address = (int)$this->{Configuration::get('PS_TAX_ADDRESS_TYPE')}; + + if ($address === null) + $address = Address::initialize($id_address); + + $wrapping_fees = (float)Configuration::get('PS_GIFT_WRAPPING_PRICE'); + if ($with_taxes && $wrapping_fees > 0) + { + $tax_manager = TaxManagerFactory::getManager($address, (int)Configuration::get('PS_GIFT_WRAPPING_TAX_RULES_GROUP')); + $tax_calculator = $tax_manager->getTaxCalculator(); + $wrapping_fees = $tax_calculator->addTaxes($wrapping_fees); + } + + return $wrapping_fees; + } /** * Get the number of packages @@ -1568,9 +1593,9 @@ class CartCore extends ObjectModel */ public function getPackageList($flush = false) { - static $cache = false; - if ($cache !== false && !$flush) - return $cache; + static $cache = array(); + if (isset($cache[(int)$this->id]) && $cache[(int)$this->id] !== false && !$flush) + return $cache[(int)$this->id]; $product_list = $this->getProducts(); // Step 1 : Get product informations (warehouse_list and carrier_list), count warehouse @@ -1665,7 +1690,7 @@ class CartCore extends ObjectModel { $product['carrier_list'] = array_merge($product['carrier_list'], Carrier::getAvailableCarrierList(new Product($product['id_product']), $id_war, $product['id_address_delivery'], null, $this)); if (in_array((int)$id_war, $product['warehouse_list']) && $id_warehouse == 0) - $id_warehouse = $id_war; + $id_warehouse = (int)$id_war; } if (!isset($grouped_by_warehouse[$product['id_address_delivery']]['in_stock'][$id_warehouse])) @@ -1677,7 +1702,7 @@ class CartCore extends ObjectModel if (!$this->allow_seperated_package) $key = 'in_stock'; else - $key = (!$product['out_of_stock']) ? 'in_stock' : 'out_of_stock'; + $key = $product['in_stock'] ? 'in_stock' : 'out_of_stock'; if (empty($product['carrier_list'])) $product['carrier_list'] = array(0); @@ -1798,7 +1823,7 @@ class CartCore extends ObjectModel ); } } - $cache = $final_package_list; + $cache[(int)$this->id] = $final_package_list; return $final_package_list; } @@ -2269,7 +2294,7 @@ class CartCore extends ObjectModel $this->id_carrier = 0; return; } - + Cache::clean('getContextualValue_*'); $delivery_option_list = $this->getDeliveryOptionList(null, true); foreach ($delivery_option_list as $id_address => $options) @@ -2302,11 +2327,12 @@ class CartCore extends ObjectModel * Get the delivery option seleted, or if no delivery option was selected, the cheapest option for each address * @return array delivery option */ - public function getDeliveryOption($default_country = null, $dontAutoSeletectOptions = false, $use_cache = true) + public function getDeliveryOption($default_country = null, $dontAutoSelectOptions = false, $use_cache = true) { - static $cache = array(0 => false, 1 => false); - if ($cache[(int)$dontAutoSeletectOptions] !== false && $use_cache) - return $cache[(int)$dontAutoSeletectOptions]; + static $cache = array(); + $cache_id = (int)(is_object($default_country) ? $default_country->id : 0).'-'.(int)$dontAutoSelectOptions; + if (isset($cache[$cache_id]) && $use_cache) + return $cache[$cache_id]; $delivery_option_list = $this->getDeliveryOptionList($default_country); @@ -2324,12 +2350,12 @@ class CartCore extends ObjectModel if ($validated) { - $cache[(int)$dontAutoSeletectOptions] = $delivery_option; + $cache[$cache_id] = $delivery_option; return $delivery_option; } } - if ($dontAutoSeletectOptions) + if ($dontAutoSelectOptions) return false; // No delivery option selected or delivery option selected is not valid, get the better for all options @@ -2358,7 +2384,7 @@ class CartCore extends ObjectModel $delivery_option[$id_address] = key($options); } - $cache[(int)$dontAutoSeletectOptions] = $delivery_option; + $cache[$cache_id] = $delivery_option; return $delivery_option; } @@ -2373,11 +2399,13 @@ class CartCore extends ObjectModel */ public function getTotalShippingCost($delivery_option = null, $use_tax = true, Country $default_country = null) { + if(isset(Context::getContext()->cookie->id_country)) + $default_country = new Country(Context::getContext()->cookie->id_country); if (is_null($delivery_option)) $delivery_option = $this->getDeliveryOption($default_country, false, false); $total_shipping = 0; - $delivery_option_list = $this->getDeliveryOptionList(); + $delivery_option_list = $this->getDeliveryOptionList($default_country); foreach ($delivery_option as $id_address => $key) { if (!isset($delivery_option_list[$id_address]) || !isset($delivery_option_list[$id_address][$key])) @@ -2415,9 +2443,9 @@ class CartCore extends ObjectModel if (isset($delivery_option_list[$id_address][$key]['carrier_list'][$id_carrier])) { if ($useTax) - $total_shipping += $delivery_option_list[$id_address][$key]['carrier_list'][$id_carrier]['total_price_with_tax']; + $total_shipping += $delivery_option_list[$id_address][$key]['carrier_list'][$id_carrier]['price_with_tax']; else - $total_shipping += $delivery_option_list[$id_address][$key]['carrier_list'][$id_carrier]['total_price_without_tax']; + $total_shipping += $delivery_option_list[$id_address][$key]['carrier_list'][$id_carrier]['price_without_tax']; } } @@ -2445,7 +2473,7 @@ class CartCore extends ObjectModel * * @return float Shipping total */ - public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null) + public function getPackageShippingCost($id_carrier = null, $use_tax = true, Country $default_country = null, $product_list = null, $id_zone = null) { if ($this->isVirtualCart()) return 0; @@ -2471,7 +2499,7 @@ class CartCore extends ObjectModel if (!Address::addressExists($address_id)) $address_id = null; - $cache_id = 'getPackageShippingCost_'.(int)$address_id.'_'.(int)$id_carrier.'_'.(int)$use_tax.'_'.(int)$default_country->id; + $cache_id = 'getPackageShippingCost_'.(int)$this->id.'_'.(int)$address_id.'_'.(int)$id_carrier.'_'.(int)$use_tax.'_'.(int)$default_country->id; if ($products) foreach ($products as $product) $cache_id .= '_'.(int)$product['id_product'].'_'.(int)$product['id_product_attribute']; @@ -2491,19 +2519,22 @@ class CartCore extends ObjectModel return $shipping_cost; } - // Get id zone - if (!$this->isMultiAddressDelivery() - && isset($this->id_address_delivery) // Be carefull, id_address_delivery is not usefull one 1.5 - && $this->id_address_delivery - && Customer::customerHasAddress($this->id_customer, $this->id_address_delivery - )) - $id_zone = Address::getZoneById((int)$this->id_address_delivery); - else + if(!isset($id_zone)) { - if (!Validate::isLoadedObject($default_country)) - $default_country = new Country(Configuration::get('PS_COUNTRY_DEFAULT'), Configuration::get('PS_LANG_DEFAULT')); - - $id_zone = (int)$default_country->id_zone; + // Get id zone + if (!$this->isMultiAddressDelivery() + && isset($this->id_address_delivery) // Be carefull, id_address_delivery is not usefull one 1.5 + && $this->id_address_delivery + && Customer::customerHasAddress($this->id_customer, $this->id_address_delivery + )) + $id_zone = Address::getZoneById((int)$this->id_address_delivery); + else + { + if (!Validate::isLoadedObject($default_country)) + $default_country = new Country(Configuration::get('PS_COUNTRY_DEFAULT'), Configuration::get('PS_LANG_DEFAULT')); + + $id_zone = (int)$default_country->id_zone; + } } if ($id_carrier && !$this->isCarrierInRange((int)$id_carrier, (int)$id_zone)) @@ -2512,6 +2543,7 @@ class CartCore extends ObjectModel if (empty($id_carrier) && $this->isCarrierInRange((int)Configuration::get('PS_CARRIER_DEFAULT'), (int)$id_zone)) $id_carrier = (int)Configuration::get('PS_CARRIER_DEFAULT'); + $total_package_without_shipping_tax_inc = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list); if (empty($id_carrier)) { if ((int)$this->id_customer) @@ -2546,7 +2578,7 @@ class CartCore extends ObjectModel { $check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight($row['id_carrier'], $this->getTotalWeight(), (int)$id_zone); - $total_order = $this->getOrderTotal(true, Cart::BOTH_WITHOUT_SHIPPING, $product_list); + $total_order = $total_package_without_shipping_tax_inc; $check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice($row['id_carrier'], $total_order, (int)$id_zone, (int)$this->id_currency); // Get only carriers that have a range compatible with cart @@ -2582,8 +2614,12 @@ class CartCore extends ObjectModel $carrier = self::$_carriers[$id_carrier]; + // No valid Carrier or $id_carrier <= 0 ? if (!Validate::isLoadedObject($carrier)) - die(Tools::displayError('Fatal error: "no default carrier"')); + { + Cache::store($cache_id, 0); + return 0; + } if (!$carrier->active) { @@ -2600,7 +2636,10 @@ class CartCore extends ObjectModel // Select carrier tax if ($use_tax && !Tax::excludeTaxeOption()) - $carrier_tax = $carrier->getTaxesRate(new Address((int)$address_id)); + { + $address = Address::initialize((int)$address_id); + $carrier_tax = $carrier->getTaxesRate($address); + } $configuration = Configuration::getMultiple(array( 'PS_SHIPPING_FREE_PRICE', @@ -2631,34 +2670,19 @@ class CartCore extends ObjectModel // Get shipping cost using correct method if ($carrier->range_behavior) { - // Get id zone - if (isset($this->id_address_delivery) - && $this->id_address_delivery - && Customer::customerHasAddress($this->id_customer, $this->id_address_delivery)) - $id_zone = Address::getZoneById((int)$this->id_address_delivery); - else - $id_zone = (int)$default_country->id_zone; + if(!isset($id_zone)) + { + // Get id zone + if (isset($this->id_address_delivery) + && $this->id_address_delivery + && Customer::customerHasAddress($this->id_customer, $this->id_address_delivery)) + $id_zone = Address::getZoneById((int)$this->id_address_delivery); + else + $id_zone = (int)$default_country->id_zone; + } - $check_delivery_price_by_weight = Carrier::checkDeliveryPriceByWeight((int)$carrier->id, $this->getTotalWeight(), (int)$id_zone); - - // Code Review V&V TO FINISH - $check_delivery_price_by_price = Carrier::checkDeliveryPriceByPrice( - $carrier->id, - $this->getOrderTotal( - true, - Cart::BOTH_WITHOUT_SHIPPING, - $product_list - ), - $id_zone, - (int)$this->id_currency - ); - - if (( - $carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT - && !$check_delivery_price_by_weight - ) || ( - $carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE - && !$check_delivery_price_by_price + if (($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_WEIGHT && !Carrier::checkDeliveryPriceByWeight($carrier->id, $this->getTotalWeight(), (int)$id_zone)) + || ($carrier->getShippingMethod() == Carrier::SHIPPING_METHOD_PRICE && !Carrier::checkDeliveryPriceByPrice($carrier->id, $total_package_without_shipping_tax_inc, $id_zone, (int)$this->id_currency) )) $shipping_cost += 0; else @@ -2802,10 +2826,13 @@ class CartCore extends ObjectModel $invoice = new Address((int)$this->id_address_invoice); // New layout system with personalization fields + $formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery); $formatted_addresses['invoice'] = AddressFormat::getFormattedLayoutData($invoice); - $formatted_addresses['delivery'] = AddressFormat::getFormattedLayoutData($delivery); - $total_tax = $this->getOrderTotal() - $this->getOrderTotal(false); + $base_total_tax_inc = $this->getOrderTotal(true); + $base_total_tax_exc = $this->getOrderTotal(false); + + $total_tax = $base_total_tax_inc - $base_total_tax_exc; if ($total_tax < 0) $total_tax = 0; @@ -2826,10 +2853,16 @@ class CartCore extends ObjectModel foreach ($cart_rules as &$cart_rule) { // If the cart rule is automatic (wihtout any code) and include free shipping, it should not be displayed as a cart rule but only set the shipping cost to 0 - if ($cart_rule['free_shipping'] && empty($cart_rule['code'])) + if ($cart_rule['free_shipping'] && (empty($cart_rule['code']) || preg_match('/^'.CartRule::BO_ORDER_CODE_PREFIX.'[0-9]+/', $cart_rule['code']))) { $cart_rule['value_real'] -= $total_shipping; - $cart_rule['value_tax_exc'] = $total_shipping_tax_exc; + $cart_rule['value_tax_exc'] -= $total_shipping_tax_exc; + $cart_rule['value_real'] = Tools::ps_round($cart_rule['value_real'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_); + $cart_rule['value_tax_exc'] = Tools::ps_round($cart_rule['value_tax_exc'], (int)$context->currency->decimals * _PS_PRICE_DISPLAY_PRECISION_); + if ($total_discounts > $cart_rule['value_real']) + $total_discounts -= $total_shipping; + if ($total_discounts_tax_exc > $cart_rule['value_tax_exc']) + $total_discounts_tax_exc -= $total_shipping_tax_exc; // Update total shipping $total_shipping = 0; @@ -2897,9 +2930,9 @@ class CartCore extends ObjectModel 'total_shipping_tax_exc' => $total_shipping_tax_exc, 'total_products_wt' => $total_products_wt, 'total_products' => $total_products, - 'total_price' => $this->getOrderTotal(), + 'total_price' => $base_total_tax_inc, 'total_tax' => $total_tax, - 'total_price_without_tax' => $this->getOrderTotal(false), + 'total_price_without_tax' => $base_total_tax_exc, 'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1), 'free_ship' => $total_shipping ? 0 : 1, 'carrier' => new Carrier($this->id_carrier, $id_lang), @@ -2912,12 +2945,8 @@ class CartCore extends ObjectModel return false; foreach ($this->getProducts() as $product) - - if (!$product['active'] - || ( - !$product['allow_oosp'] && $product['stock_quantity'] < $product['cart_quantity'] - ) - || !$product['available_for_order']) + if (!$product['active'] || !$product['available_for_order'] + || (!$product['allow_oosp'] && $product['stock_quantity'] < $product['cart_quantity'])) return false; return true; @@ -2927,7 +2956,7 @@ class CartCore extends ObjectModel { $sql = 'SELECT c.`id_cart` FROM '._DB_PREFIX_.'cart c - WHERE c.`id_cart` NOT IN (SELECT o.`id_cart` FROM '._DB_PREFIX_.'orders o) + WHERE c.`id_cart` NOT IN (SELECT o.`id_cart` FROM '._DB_PREFIX_.'orders o WHERE o.`id_customer` = '.(int)$id_customer.') AND c.`id_customer` = '.(int)$id_customer.' '.Shop::addSqlRestriction(Shop::SHARE_ORDER, 'c').' ORDER BY c.`date_upd` DESC'; @@ -2935,7 +2964,7 @@ class CartCore extends ObjectModel if (!$id_cart = Db::getInstance()->getValue($sql)) return false; - return $id_cart; + return (int)$id_cart; } /** @@ -3001,8 +3030,10 @@ class CartCore extends ObjectModel public function addTextFieldToProduct($id_product, $index, $type, $text_value) { $text_value = str_replace(array("\n", "\r"), '', nl2br($text_value)); - $text_value = str_replace('\\', '\\\\', $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); + } return $this->_addCustomization($id_product, 0, $index, $type, $text_value, 0); } @@ -3087,7 +3118,7 @@ class CartCore extends ObjectModel SELECT * FROM '._DB_PREFIX_.'cart c WHERE c.`id_customer` = '.(int)$id_customer.' - '.(!$with_order ? 'AND id_cart NOT IN (SELECT id_cart FROM '._DB_PREFIX_.'orders o WHERE o.`id_customer` = '.(int)$id_customer.')' : '').' + '.(!$with_order ? 'AND id_cart NOT IN (SELECT id_cart FROM '._DB_PREFIX_.'orders o)' : '').' ORDER BY c.`date_add` DESC'); } @@ -3381,62 +3412,59 @@ class CartCore extends ObjectModel */ public function setNoMultishipping() { - // Upgrading quantities - $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) + if (Configuration::get('PS_ALLOW_MULTISHIPPING')) { - $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); + // Upgrading quantities + $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` + 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 - $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); - - // Upgrading address delivery - $sql = 'UPDATE `'._DB_PREFIX_.'cart_product` - SET `id_address_delivery` = - ( - SELECT `id_address_delivery` - FROM `'._DB_PREFIX_.'cart` - WHERE `id_cart` = '.(int)$this->id.' - AND `id_shop` = '.(int)$this->id_shop.' - ) - 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` + + // Update delivery address for each product line + Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'cart_product` + SET `id_address_delivery` = ( + SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart` + WHERE `id_cart` = '.(int)$this->id.' AND `id_shop` = '.(int)$this->id_shop.' + ) + WHERE `id_cart` = '.(int)$this->id.' + '.(Configuration::get('PS_ALLOW_MULTISHIPPING') ? ' AND `id_shop` = '.(int)$this->id_shop : '')); + + if (Customization::isFeatureActive()) + Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'customization` + SET `id_address_delivery` = ( + SELECT `id_address_delivery` FROM `'._DB_PREFIX_.'cart` WHERE `id_cart` = '.(int)$this->id.' ) - WHERE `id_cart` = '.(int)$this->id; - - Db::getInstance()->execute($sql); + WHERE `id_cart` = '.(int)$this->id); } /** diff --git a/classes/CartRule.php b/classes/CartRule.php index 5f1bf625a..001e8cd22 100644 --- a/classes/CartRule.php +++ b/classes/CartRule.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -31,6 +31,9 @@ class CartRuleCore extends ObjectModel const FILTER_ACTION_SHIPPING = 2; const FILTER_ACTION_REDUCTION = 3; const FILTER_ACTION_GIFT = 4; + const FILTER_ACTION_ALL_NOCAP = 5; + + const BO_ORDER_CODE_PREFIX = 'BO_ORDER_'; /* This variable controls that a free gift is offered only once, even when multi-shippping is activated and the same product is delivered in both addresses */ protected static $only_one_gift = array(); @@ -64,6 +67,7 @@ class CartRuleCore extends ObjectModel public $reduction_product; public $gift_product; public $gift_product_attribute; + public $highlight; public $active = 1; public $date_add; public $date_upd; @@ -103,6 +107,7 @@ class CartRuleCore extends ObjectModel 'reduction_product' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), 'gift_product' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'gift_product_attribute' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), + 'highlight' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), @@ -115,14 +120,20 @@ class CartRuleCore extends ObjectModel /** * @see ObjectModel::add() */ - public function add($autodate = true, $nullValues = false) + public function add($autodate = true, $null_values = false) { - if (!parent::add($autodate, $nullValues)) + if (!parent::add($autodate, $null_values)) return false; Configuration::updateGlobalValue('PS_CART_RULE_FEATURE_ACTIVE', '1'); return true; } + + public function update($null_values = false) + { + Cache::clean('getContextualValue_'.$this->id.'_*'); + return parent::update($null_values); + } /** * @see ObjectModel::delete() @@ -212,27 +223,26 @@ class CartRuleCore extends ObjectModel FROM `'._DB_PREFIX_.'cart_rule` cr LEFT JOIN `'._DB_PREFIX_.'cart_rule_lang` crl ON (cr.`id_cart_rule` = crl.`id_cart_rule` AND crl.`id_lang` = '.(int)$id_lang.') WHERE ( - cr.`id_customer` = '.(int)$id_customer.' + cr.`id_customer` = '.(int)$id_customer.' OR cr.group_restriction = 1 '.($includeGeneric ? 'OR cr.`id_customer` = 0' : '').' ) + AND cr.date_from < "'.date('Y-m-d H:i:s').'" + AND cr.date_to > "'.date('Y-m-d H:i:s').'" '.($active ? 'AND cr.`active` = 1' : '').' '.($inStock ? 'AND cr.`quantity` > 0' : '')); // Remove cart rule that does not match the customer groups - if ($includeGeneric) - { - $customerGroups = Customer::getGroupsStatic($id_customer); - foreach ($result as $key => $cart_rule) - if ($cart_rule['group_restriction']) - { - $cartRuleGroups = Db::getInstance()->getValue('SELECT id_group FROM '._DB_PREFIX_.'cart_rule_group WHERE id_cart_rule = '.(int)$cart_rule['id_cart_rule']); - foreach ($cartRuleGroups as $cartRuleGroup) - if (in_array($cartRuleGroups['id_group'], $customerGroups)) - continue 2; + $customerGroups = Customer::getGroupsStatic($id_customer); + foreach ($result as $key => $cart_rule) + if ($cart_rule['group_restriction']) + { + $cartRuleGroups = Db::getInstance()->executeS('SELECT id_group FROM '._DB_PREFIX_.'cart_rule_group WHERE id_cart_rule = '.(int)$cart_rule['id_cart_rule']); + foreach ($cartRuleGroups as $cartRuleGroup) + if (in_array($cartRuleGroup['id_group'], $customerGroups)) + continue 2; - unset($result[$key]); - } - } + unset($result[$key]); + } foreach ($result as &$cart_rule) if ($cart_rule['quantity_per_user']) @@ -323,11 +333,8 @@ class CartRuleCore extends ObjectModel return array(); $productRuleGroups = array(); - $results = Db::getInstance()->executeS(' - SELECT * - FROM '._DB_PREFIX_.'cart_rule_product_rule_group prg - WHERE prg.id_cart_rule = '.(int)$this->id, false); - foreach ($results as $row) + $result = Db::getInstance()->executeS('SELECT * FROM '._DB_PREFIX_.'cart_rule_product_rule_group WHERE id_cart_rule = '.(int)$this->id); + foreach ($result as $row) { if (!isset($productRuleGroups[$row['id_product_rule_group']])) $productRuleGroups[$row['id_product_rule_group']] = array('id_product_rule_group' => $row['id_product_rule_group'], 'quantity' => $row['quantity']); @@ -414,8 +421,10 @@ class CartRuleCore extends ObjectModel } // Check if the customer delivery address is usable with the cart rule - if ($this->country_restriction && $context->cart->id_address_delivery) + if ($this->country_restriction) { + if (!$context->cart->id_address_delivery) + return (!$display_error) ? false : Tools::displayError('You must choose a delivery address before applying this voucher to your order'); $id_cart_rule = (int)Db::getInstance()->getValue(' SELECT crc.id_cart_rule FROM '._DB_PREFIX_.'cart_rule_country crc @@ -426,13 +435,16 @@ class CartRuleCore extends ObjectModel } // Check if the carrier chosen by the customer is usable with the cart rule - if ($this->carrier_restriction && $context->cart->id_carrier) + if ($this->carrier_restriction) { + if (!$context->cart->id_carrier) + return (!$display_error) ? false : Tools::displayError('You must choose a carrier before applying this voucher to your order'); $id_cart_rule = (int)Db::getInstance()->getValue(' SELECT crc.id_cart_rule FROM '._DB_PREFIX_.'cart_rule_carrier crc + INNER JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crc.id_carrier AND c.deleted = 0) WHERE crc.id_cart_rule = '.(int)$this->id.' - AND crc.id_carrier = '.(int)$context->cart->id_carrier); + AND c.id_carrier = '.(int)$context->cart->id_carrier); if (!$id_cart_rule) return (!$display_error) ? false : Tools::displayError('You cannot use this voucher with this carrier'); } @@ -518,14 +530,21 @@ class CartRuleCore extends ObjectModel return (!$display_error) ? false : Tools::displayError('You have not reached the minimum amount required to use this voucher'); } - // Check if the voucher is already in the cart of if a non compatible voucher is in the cart - // Important note: this MUST be the last check, because if the tested cart rule has priority over a non combinable one in the cart, we will switch them + /* This loop checks: + - if the voucher is already in the cart + - if a non compatible voucher is in the cart + - if there are products in the cart (gifts excluded) + Important note: this MUST be the last check, because if the tested cart rule has priority over a non combinable one in the cart, we will switch them + */ + $nb_products = Cart::getNbProducts($context->cart->id); $otherCartRules = $context->cart->getCartRules(); if (count($otherCartRules)) foreach ($otherCartRules as $otherCartRule) { if ($otherCartRule['id_cart_rule'] == $this->id && !$alreadyInCart) return (!$display_error) ? false : Tools::displayError('This voucher is already in your cart'); + if ($otherCartRule['gift_product']) + --$nb_products; if ($this->cart_rule_restriction && $otherCartRule['cart_rule_restriction'] && $otherCartRule['id_cart_rule'] != $this->id) { $combinable = Db::getInstance()->getValue(' @@ -546,6 +565,9 @@ class CartRuleCore extends ObjectModel } } + if (!$nb_products) + return (!$display_error) ? false : Tools::displayError('Cart is empty'); + if (!$display_error) return true; } @@ -615,7 +637,8 @@ class CartRuleCore extends ObjectModel FROM `'._DB_PREFIX_.'cart_product` cp LEFT JOIN `'._DB_PREFIX_.'category_product` catp ON cp.id_product = catp.id_product WHERE cp.`id_cart` = '.(int)$context->cart->id.' - AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').')'); + AND cp.`id_product` IN ('.implode(array_map('intval', $eligibleProductsList), ',').') + AND cp.`id_product` <> '.(int)$this->gift_product); $countMatchingProducts = 0; $matchingProductsList = array(); foreach ($cartCategories as $cartCategory) @@ -741,17 +764,18 @@ class CartRuleCore extends ObjectModel return Cache::retrieve($cache_id); // Free shipping on selected carriers - if ($this->free_shipping && ($filter == CartRule::FILTER_ACTION_ALL || $filter == CartRule::FILTER_ACTION_SHIPPING)) + if ($this->free_shipping && in_array($filter, array(CartRule::FILTER_ACTION_ALL, CartRule::FILTER_ACTION_ALL_NOCAP, CartRule::FILTER_ACTION_SHIPPING))) { if (!$this->carrier_restriction) $reduction_value += $context->cart->getOrderTotal($use_tax, Cart::ONLY_SHIPPING, is_null($package) ? null : $package['products'], is_null($package) ? null : $package['id_carrier']); else { $data = Db::getInstance()->executeS(' - SELECT crc.id_cart_rule, crc.id_carrier + SELECT crc.id_cart_rule, c.id_carrier FROM '._DB_PREFIX_.'cart_rule_carrier crc + INNER JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crc.id_carrier AND c.deleted = 0) WHERE crc.id_cart_rule = '.(int)$this->id.' - AND crc.id_carrier = '.(int)$context->cart->id_carrier); + AND c.id_carrier = '.(int)$context->cart->id_carrier); if ($data) foreach ($data as $cart_rule) @@ -759,7 +783,7 @@ class CartRuleCore extends ObjectModel } } - if ($filter == CartRule::FILTER_ACTION_ALL || $filter == CartRule::FILTER_ACTION_REDUCTION) + if (in_array($filter, array(CartRule::FILTER_ACTION_ALL, CartRule::FILTER_ACTION_ALL_NOCAP, CartRule::FILTER_ACTION_REDUCTION))) { // Discount (%) on the whole order if ($this->reduction_percent && $this->reduction_product == 0) @@ -850,7 +874,15 @@ class CartRuleCore extends ObjectModel // If it has the same tax application that you need, then it's the right value, whatever the product! if ($this->reduction_tax == $use_tax) + { + // The reduction cannot exceed the products total, except when we do not want it to be limited (for the partial use calculation) + if ($filter != CartRule::FILTER_ACTION_ALL_NOCAP) + { + $cart_amount = $context->cart->getOrderTotal($use_tax, Cart::ONLY_PRODUCTS); + $reduction_amount = min($reduction_amount, $cart_amount); + } $reduction_value += $prorata * $reduction_amount; + } else { if ($this->reduction_product > 0) @@ -876,16 +908,19 @@ class CartRuleCore extends ObjectModel // Discount (¤) on the whole order elseif ($this->reduction_product == 0) { - // TODO : this should not use the prorata $cart_amount_ti = $context->cart->getOrderTotal(true, Cart::ONLY_PRODUCTS); $cart_amount_te = $context->cart->getOrderTotal(false, Cart::ONLY_PRODUCTS); + + // The reduction cannot exceed the products total, except when we do not want it to be limited (for the partial use calculation) + if ($filter != CartRule::FILTER_ACTION_ALL_NOCAP) + $reduction_amount = min($reduction_amount, $this->reduction_tax ? $cart_amount_ti : $cart_amount_te); $cart_vat_amount = $cart_amount_ti - $cart_amount_te; if ($cart_vat_amount == 0 || $cart_amount_te == 0) $cart_average_vat_rate = 0; else - $cart_average_vat_rate = $cart_vat_amount / $cart_amount_te; + $cart_average_vat_rate = Tools::ps_round($cart_vat_amount / $cart_amount_te, 3); if ($this->reduction_tax && !$use_tax) $reduction_value += $prorata * $reduction_amount / (1 + $cart_average_vat_rate); @@ -903,7 +938,7 @@ class CartRuleCore extends ObjectModel } // Free gift - if ((int)$this->gift_product && ($filter == CartRule::FILTER_ACTION_ALL || $filter == CartRule::FILTER_ACTION_GIFT)) + if ((int)$this->gift_product && in_array($filter, array(CartRule::FILTER_ACTION_ALL, CartRule::FILTER_ACTION_ALL_NOCAP, CartRule::FILTER_ACTION_GIFT))) { $id_address = (is_null($package) ? 0 : $package['id_address']); foreach ($package_products as $product) @@ -1007,9 +1042,10 @@ class CartRuleCore extends ObjectModel SELECT t.*'.($i18n ? ', tl.*' : '').', IF(crt.id_'.$type.' IS NULL, 0, 1) as selected FROM `'._DB_PREFIX_.$type.'` t '.($i18n ? 'LEFT JOIN `'._DB_PREFIX_.$type.'_lang` tl ON (t.id_'.$type.' = tl.id_'.$type.' AND tl.id_lang = '.(int)Context::getContext()->language->id.')' : '').' - LEFT JOIN (SELECT id_'.$type.' FROM `'._DB_PREFIX_.'cart_rule_'.$type.'` WHERE id_cart_rule = '.(int)$this->id.') crt ON t.id_'.$type.' = crt.id_'.$type.' + LEFT JOIN (SELECT id_'.$type.' FROM `'._DB_PREFIX_.'cart_rule_'.$type.'` WHERE id_cart_rule = '.(int)$this->id.') crt ON t.id_'.($type == 'carrier' ? 'reference' : $type).' = crt.id_'.$type.' WHERE 1 '.($active_only ? ' AND t.active = 1' : ''). - $shop_list. + $shop_list + .(in_array($type, array('carrier', 'shop')) ? ' AND t.deleted = 0' : ''). ' ORDER BY name ASC', false); while ($row = Db::getInstance()->nextRow($resource)) @@ -1051,11 +1087,12 @@ class CartRuleCore extends ObjectModel if (!CartRule::isFeatureActive() || !Validate::isLoadedObject($context->cart)) return; - $result = Db::getInstance()->executeS(' + $sql = ' SELECT cr.* FROM '._DB_PREFIX_.'cart_rule cr LEFT JOIN '._DB_PREFIX_.'cart_rule_shop crs ON cr.id_cart_rule = crs.id_cart_rule LEFT JOIN '._DB_PREFIX_.'cart_rule_carrier crca ON cr.id_cart_rule = crca.id_cart_rule + '.($context->cart->id_carrier ? 'LEFT JOIN '._DB_PREFIX_.'carrier c ON (c.id_reference = crca.id_carrier AND c.deleted = 0)' : '').' LEFT JOIN '._DB_PREFIX_.'cart_rule_country crco ON cr.id_cart_rule = crco.id_cart_rule WHERE cr.active = 1 AND cr.code = "" @@ -1067,34 +1104,35 @@ class CartRuleCore extends ObjectModel '.($context->customer->id ? 'OR cr.id_customer = '.(int)$context->cart->id_customer : '').' ) AND ( - cr.carrier_restriction = 0 - '.($context->cart->id_carrier ? 'OR crca.id_carrier = '.(int)$context->cart->id_carrier : '').' + cr.`carrier_restriction` = 0 + '.($context->cart->id_carrier ? 'OR c.id_carrier = '.(int)$context->cart->id_carrier : '').' ) AND ( - cr.shop_restriction = 0 + cr.`shop_restriction` = 0 '.((Shop::isFeatureActive() && $context->shop->id) ? 'OR crs.id_shop = '.(int)$context->shop->id : '').' ) AND ( - cr.group_restriction = 0 + cr.`group_restriction` = 0 '.($context->customer->id ? 'OR 0 < ( - SELECT cg.id_group - FROM '._DB_PREFIX_.'customer_group cg - LEFT JOIN '._DB_PREFIX_.'cart_rule_group crg ON cg.id_group = crg.id_group - WHERE cr.id_cart_rule = crg.id_cart_rule - AND cg.id_customer = '.(int)$context->customer->id.' + SELECT cg.`id_group` + FROM `'._DB_PREFIX_.'customer_group` cg + INNER JOIN `'._DB_PREFIX_.'cart_rule_group` crg ON cg.id_group = crg.id_group + WHERE cr.`id_cart_rule` = crg.`id_cart_rule` + AND cg.`id_customer` = '.(int)$context->customer->id.' + LIMIT 1 )' : '').' ) AND ( - cr.reduction_product <= 0 - OR cr.reduction_product IN ( - SELECT id_product - FROM '._DB_PREFIX_.'cart_product - WHERE id_cart = '.(int)$context->cart->id.' + cr.`reduction_product` <= 0 + OR cr.`reduction_product` IN ( + SELECT `id_product` + FROM `'._DB_PREFIX_.'cart_product` + WHERE `id_cart` = '.(int)$context->cart->id.' ) ) AND cr.id_cart_rule NOT IN (SELECT id_cart_rule FROM '._DB_PREFIX_.'cart_cart_rule WHERE id_cart = '.(int)$context->cart->id.') - ORDER BY priority'); - + ORDER BY priority'; + $result = Db::getInstance()->executeS($sql); if ($result) { $cart_rules = ObjectModel::hydrateCollection('CartRule', $result); diff --git a/classes/Category.php b/classes/Category.php index d814db0be..a5fea0fbd 100644 --- a/classes/Category.php +++ b/classes/Category.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -109,7 +109,7 @@ class CategoryCore extends ObjectModel // Lang fields 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isCatalogName', 'required' => true, 'size' => 64), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 64), - 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString'), + 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128), 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), @@ -210,7 +210,7 @@ class CategoryCore extends ObjectModel if (!isset($this->doNotRegenerateNTree) || !$this->doNotRegenerateNTree) { Category::regenerateEntireNtree(); - $this->recalculateLevelDepth($this->id_category); + $this->recalculateLevelDepth($this->id); } Hook::exec('actionCategoryUpdate', array('category' => $this)); return $ret; @@ -240,9 +240,6 @@ class CategoryCore extends ObjectModel { $id_lang = is_null($id_lang) ? Context::getContext()->language->id : (int)$id_lang; - if (!(int)$id_lang) - $id_lang = _USER_ID_LANG_; - $children = array(); $subcats = $this->getSubCategories($id_lang, true); if (($max_depth == 0 || $current_depth < $max_depth) && $subcats && count($subcats)) @@ -264,7 +261,7 @@ class CategoryCore extends ObjectModel $this->description = Category::getDescriptionClean($this->description); return array( - 'id' => (int)$this->id_category, + 'id' => (int)$this->id, 'link' => Context::getContext()->link->getCategoryLink($this->id, $this->link_rewrite), 'name' => $this->name, 'desc'=> $this->description, @@ -513,7 +510,7 @@ class CategoryCore extends ObjectModel die(Tools::displayError()); $groups = FrontController::getCurrentCustomerGroups(); - $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '= 1'); + $sql_groups = (count($groups) ? 'IN ('.implode(',', $groups).')' : '='.(int)Group::getCurrent()->id); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT c.*, cl.id_lang, cl.name, cl.description, cl.link_rewrite, cl.meta_title, cl.meta_keywords, cl.meta_description @@ -607,8 +604,8 @@ class CategoryCore extends ObjectModel return (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql); } - $sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, product_attribute_shop.`id_product_attribute`, product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity, pl.`description`, pl.`description_short`, pl.`available_now`, - pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, image_shop.`id_image`, + $sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, MAX(product_attribute_shop.id_product_attribute) id_product_attribute, product_attribute_shop.minimal_quantity AS product_attribute_minimal_quantity, pl.`description`, pl.`description_short`, pl.`available_now`, + pl.`available_later`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, pl.`meta_title`, pl.`name`, MAX(image_shop.`id_image`) id_image, il.`legend`, m.`name` AS manufacturer_name, cl.`name` AS category_default, DATEDIFF(product_shop.`date_add`, DATE_SUB(NOW(), INTERVAL '.(Validate::isUnsignedInt(Configuration::get('PS_NB_DAYS_NEW_PRODUCT')) ? Configuration::get('PS_NB_DAYS_NEW_PRODUCT') : 20).' @@ -636,12 +633,11 @@ class CategoryCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON m.`id_manufacturer` = p.`id_manufacturer` WHERE product_shop.`id_shop` = '.(int)$context->shop->id.' - AND (pa.id_product_attribute IS NULL OR product_attribute_shop.id_shop='.(int)$context->shop->id.') - AND (i.id_image IS NULL OR image_shop.id_shop='.(int)$context->shop->id.') AND cp.`id_category` = '.(int)$this->id .($active ? ' AND product_shop.`active` = 1' : '') .($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '') - .($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : ''); + .($id_supplier ? ' AND p.id_supplier = '.(int)$id_supplier : '') + .' GROUP BY product_shop.id_product'; if ($random === true) { @@ -657,7 +653,7 @@ class CategoryCore extends ObjectModel Tools::orderbyPrice($result, $order_way); if (!$result) - return false; + return array(); /* Modify SQL result */ return Product::getProductsProperties($id_lang, $result); @@ -688,8 +684,7 @@ class CategoryCore extends ObjectModel else return new Category($shop->getCategory(), $id_lang); $is_more_than_one_root_category = count(Category::getCategoriesWithoutParent()) > 1; - if ((!Shop::isFeatureActive() && $is_more_than_one_root_category) || - Shop::isFeatureActive() && $is_more_than_one_root_category && Shop::getContext() != Shop::CONTEXT_SHOP) + if (Shop::isFeatureActive() && $is_more_than_one_root_category && Shop::getContext() != Shop::CONTEXT_SHOP) $category = Category::getTopCategory($id_lang); else $category = new Category($shop->getCategory(), $id_lang); @@ -801,7 +796,7 @@ class CategoryCore extends ObjectModel )).')'; $flag = Db::getInstance()->execute(' - INSERT INTO `'._DB_PREFIX_.'category_product` (`id_product`, `id_category`, `position`) + INSERT IGNORE INTO `'._DB_PREFIX_.'category_product` (`id_product`, `id_category`, `position`) VALUES '.implode(',', $row) ); return $flag; @@ -836,20 +831,15 @@ class CategoryCore extends ObjectModel if (!Validate::isUnsignedId($id_category) || !Validate::isUnsignedId($id_lang)) return false; - if (isset(self::$_links[$id_category.'-'.$id_lang])) - return self::$_links[$id_category.'-'.$id_lang]; - - $result = Db::getInstance()->getRow(' - SELECT cl.`link_rewrite` - FROM `'._DB_PREFIX_.'category_lang` cl - WHERE `id_lang` = '.(int)$id_lang.' - '.Shop::addSqlRestrictionOnLang('cl').' - AND cl.`id_category` = '.(int)$id_category - ); - - self::$_links[$id_category.'-'.$id_lang] = $result['link_rewrite']; - - return $result['link_rewrite']; + if (!isset(self::$_links[$id_category.'-'.$id_lang])) + self::$_links[$id_category.'-'.$id_lang] = Db::getInstance()->getValue(' + SELECT cl.`link_rewrite` + FROM `'._DB_PREFIX_.'category_lang` cl + WHERE `id_lang` = '.(int)$id_lang.' + '.Shop::addSqlRestrictionOnLang('cl').' + AND cl.`id_category` = '.(int)$id_category + ); + return self::$_links[$id_category.'-'.$id_lang]; } public function getLink(Link $link = null) @@ -964,8 +954,8 @@ class CategoryCore extends ObjectModel $root_category = Category::getRootCategory(); if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP && (!Tools::isSubmit('id_category') || - (int)Tools::getValue('id_category') == (int)$root_category->id_category || - (int)$root_category->id_category == (int)$context->shop->id_category)) + (int)Tools::getValue('id_category') == (int)$root_category->id || + (int)$root_category->id == (int)$context->shop->id_category)) $sql .= ' AND c.`id_parent` != 0'; @@ -1051,7 +1041,7 @@ class CategoryCore extends ObjectModel $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' SELECT ctg.`id_group` FROM '._DB_PREFIX_.'category_group ctg - WHERE ctg.`id_category` = '.(int)$this->id.' AND ctg.`id_group` = 1 + WHERE ctg.`id_category` = '.(int)$this->id.' AND ctg.`id_group` = '.(int)Group::getCurrent()->id.' '); } else { $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' @@ -1164,7 +1154,7 @@ class CategoryCore extends ObjectModel UPDATE `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_shop` cs ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.') - SET cs.`position` = '.(int)$i.' + SET cs.`position` = '.(int)($i+1).' WHERE c.`id_parent` = '.(int)$id_category_parent.' AND c.`id_category` = '.(int)$result[$i]['id_category']; $return &= Db::getInstance()->execute($sql); @@ -1351,7 +1341,7 @@ class CategoryCore extends ObjectModel SELECT c.`id_category` FROM `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_shop` cs - ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` = '.(int)$id_shop.') + ON (c.`id_category` = cs.`id_category` AND cs.`id_shop` IN ('.implode(', ', Shop::getContextListShopID()).') ) WHERE cs.`id_shop` = '.(int)$id_shop.' AND c.`id_parent` = '.(int)$this->id_parent); } @@ -1400,8 +1390,7 @@ class CategoryCore extends ObjectModel SELECT DISTINCT c.* FROM `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)Context::getContext()->language->id.') - WHERE `level_depth` = 1 - '); + WHERE `level_depth` = 1'); } public function isRootCategoryForAShop() diff --git a/classes/Chart.php b/classes/Chart.php index 3fa7333da..98a5059ea 100644 --- a/classes/Chart.php +++ b/classes/Chart.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Collection.php b/classes/Collection.php index 241f116f5..7f8094059 100644 --- a/classes/Collection.php +++ b/classes/Collection.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -287,7 +287,7 @@ class CollectionCore implements Iterator, ArrayAccess, Countable */ public function sqlGroupBy($sql) { - $this->query->orderBy($this->parseFields($sql)); + $this->query->groupBy($this->parseFields($sql)); return $this; } diff --git a/classes/Combination.php b/classes/Combination.php index 74e3543c9..47b8e2eca 100644 --- a/classes/Combination.php +++ b/classes/Combination.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -102,7 +102,14 @@ class CombinationCore extends ObjectModel // Removes the product from StockAvailable, for the current shop StockAvailable::removeProductFromStockAvailable((int)$this->id_product, (int)$this->id); - + + if ($specific_prices = SpecificPrice::getByProductId((int)$this->id_product, (int)$this->id)) + foreach ($specific_prices as $specific_price) + { + $price = new SpecificPrice((int)$specific_price['id_specific_price']); + $price->delete(); + } + if (!$this->hasMultishopEntries() && !$this->deleteAssociations()) return false; return true; @@ -134,7 +141,8 @@ class CombinationCore extends ObjectModel public function setAttributes($ids_attribute) { - if ($this->deleteAssociations()) + $result = $this->deleteAssociations(); + if ($result && !empty($ids_attribute)) { $sql_values = array(); foreach ($ids_attribute as $value) @@ -144,10 +152,8 @@ class CombinationCore extends ObjectModel INSERT INTO `'._DB_PREFIX_.'product_attribute_combination` (`id_attribute`, `id_product_attribute`) VALUES '.implode(',', $sql_values) ); - - return $result; } - return false; + return $result; } public function setWsProductOptionValues($values) diff --git a/classes/CompareProduct.php b/classes/CompareProduct.php index da5e6de2d..c58405f25 100644 --- a/classes/CompareProduct.php +++ b/classes/CompareProduct.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Configuration.php b/classes/Configuration.php index af7c23b66..ee8871754 100644 --- a/classes/Configuration.php +++ b/classes/Configuration.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -145,6 +145,9 @@ class ConfigurationCore extends ObjectModel */ public static function get($key, $id_lang = null, $id_shop_group = null, $id_shop = null) { + if (defined('_PS_DO_NOT_LOAD_CONFIGURATION_') && _PS_DO_NOT_LOAD_CONFIGURATION_) + return false; + // If conf if not initialized, try manual query if (!self::$_CONF) { @@ -323,7 +326,7 @@ class ConfigurationCore extends ObjectModel $result &= Db::getInstance()->update('configuration', array( 'value' => pSQL($value, $html), 'date_upd' => date('Y-m-d H:i:s'), - ), '`name` = \''.pSQL($key).'\''.Configuration::sqlRestriction($id_shop_group, $id_shop), true, true); + ), '`name` = \''.pSQL($key).'\''.Configuration::sqlRestriction($id_shop_group, $id_shop), 1, true); } else { @@ -368,12 +371,9 @@ class ConfigurationCore extends ObjectModel )); } } - if (!$is_i18n) - Configuration::set($key, $value, $id_shop_group, $id_shop); } - if ($is_i18n) - Configuration::set($key, $values, $id_shop_group, $id_shop); + Configuration::set($key, $values, $id_shop_group, $id_shop); return $result; } @@ -504,10 +504,10 @@ class ConfigurationCore extends ObjectModel { if ($id_shop) return ' AND id_shop = '.(int)$id_shop; - else if ($id_shop_group) - return ' AND id_shop_group = '.(int)$id_shop_group.' AND id_shop IS NULL'; + elseif ($id_shop_group) + return ' AND id_shop_group = '.(int)$id_shop_group.' AND (id_shop IS NULL OR id_shop = 0)'; else - return ' AND id_shop_group IS NULL AND id_shop IS NULL'; + return ' AND (id_shop_group IS NULL OR id_shop_group = 0) AND (id_shop IS NULL OR id_shop = 0)'; } /** diff --git a/classes/ConfigurationTest.php b/classes/ConfigurationTest.php index 6adb493a7..7fac9df94 100644 --- a/classes/ConfigurationTest.php +++ b/classes/ConfigurationTest.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -54,9 +54,9 @@ class ConfigurationTestCore 'img_dir' => 'img', 'mails_dir' => 'mails', 'module_dir' => 'modules', - 'theme_lang_dir' => 'themes/'._THEME_NAME_.'/lang', + 'theme_lang_dir' => 'themes/'._THEME_NAME_.'/lang/', 'theme_pdf_lang_dir' => 'themes/'._THEME_NAME_.'/pdf/lang/', - 'theme_cache_dir' => 'themes/'._THEME_NAME_.'/cache', + 'theme_cache_dir' => 'themes/'._THEME_NAME_.'/cache/', 'translations_dir' => 'translations', 'customizable_products_dir' => 'upload', 'virtual_products_dir' => 'download' @@ -76,6 +76,7 @@ class ConfigurationTestCore 'register_globals' => false, 'gz' => false, 'mcrypt' => false, + 'mbstring' => false, 'magicquotes' => false, 'dom' => false, 'pdo_mysql' => false, @@ -265,21 +266,24 @@ class ConfigurationTestCore public static function test_theme_lang_dir($dir) { - if (!file_exists($dir)) - return true; + $absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/'); + if (!file_exists($absoluteDir)) + return true; return ConfigurationTest::test_dir($dir, true); } public static function test_theme_pdf_lang_dir($dir) { - if (!file_exists($dir)) + $absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/'); + if (!file_exists($absoluteDir)) return true; return ConfigurationTest::test_dir($dir, true); } public static function test_theme_cache_dir($dir) { - if (!file_exists($dir)) + $absoluteDir = rtrim(_PS_ROOT_DIR_, '\\/').DIRECTORY_SEPARATOR.trim($dir, '\\/'); + if (!file_exists($absoluteDir)) return true; return ConfigurationTest::test_dir($dir, true); } @@ -294,13 +298,25 @@ class ConfigurationTestCore return ConfigurationTest::test_dir($dir); } + public static function test_mbstring() + { + return function_exists('mb_strtolower'); + } + public static function test_mcrypt() { return function_exists('mcrypt_encrypt'); } + public static function test_sessions() + { + if (!$path = @ini_get('session.save_path')) + return true; + + return is_writable($path); + } public static function test_dom() { return extension_loaded('Dom'); } -} +} \ No newline at end of file diff --git a/classes/Connection.php b/classes/Connection.php index 55ebde070..4b171b1f0 100644 --- a/classes/Connection.php +++ b/classes/Connection.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -70,8 +70,6 @@ class ConnectionCore extends ObjectModel */ public function getFields() { - if (!$this->id_shop) - $this->id_shop = Context::getContext()->shop->id; if (!$this->id_shop_group) $this->id_shop_group = Context::getContext()->shop->id_shop_group; @@ -84,8 +82,12 @@ class ConnectionCore extends ObjectModel // The connection is created if it does not exist yet and we get the current page id if (!isset($cookie->id_connections) || !strstr(isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '', Tools::getHttpHost(false, false))) $id_page = Connection::setNewConnection($cookie); + // If we do not track the pages, no need to get the page id + if (!Configuration::get('PS_STATSDATA_PAGESVIEWS') && !Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) + return array(); if (!isset($id_page) || !$id_page) $id_page = Page::getCurrentId(); + // If we do not track the page views by customer, the id_page is the only information needed if (!Configuration::get('PS_STATSDATA_CUSTOMER_PAGESVIEWS')) return array('id_page' => $id_page); @@ -147,7 +149,7 @@ class ConnectionCore extends ObjectModel $connection->id_shop_group = Context::getContext()->shop->id_shop_group; $connection->date_add = $cookie->date_add; if (Validate::isAbsoluteUrl($referer)) - $connection->http_referer = $referer; + $connection->http_referer = substr($referer, 0, 254); $connection->add(); $cookie->id_connections = $connection->id; return $connection->id_page; diff --git a/classes/ConnectionsSource.php b/classes/ConnectionsSource.php index 234a2e329..c818c9796 100644 --- a/classes/ConnectionsSource.php +++ b/classes/ConnectionsSource.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -61,32 +61,37 @@ class ConnectionsSourceCore extends ObjectModel $cookie = Context::getContext()->cookie; if (!isset($cookie->id_connections) || !Validate::isUnsignedId($cookie->id_connections)) return false; + + // If the referrer is not correct, we drop the connection + if (isset($_SERVER['HTTP_REFERER']) && !Validate::isAbsoluteUrl($_SERVER['HTTP_REFERER'])) + return false; + // If there is no referrer and we do not want to save direct traffic (as opposed to referral traffic), we drop the connection if (!isset($_SERVER['HTTP_REFERER']) && !Configuration::get('TRACKING_DIRECT_TRAFFIC')) return false; $source = new ConnectionsSource(); - if (isset($_SERVER['HTTP_REFERER']) && Validate::isAbsoluteUrl($_SERVER['HTTP_REFERER'])) + + // There are a few more operations if there is a referrer + if (isset($_SERVER['HTTP_REFERER'])) { + // If the referrer is internal (i.e. from your own website), then we drop the connection $parsed = parse_url($_SERVER['HTTP_REFERER']); $parsed_host = parse_url(Tools::getProtocol().Tools::getHttpHost(false, false).__PS_BASE_URI__); - if ((preg_replace('/^www./', '', $parsed['host']) == preg_replace('/^www./', '', Tools::getHttpHost(false, false))) - && !strncmp($parsed['path'], $parsed_host['path'], strlen(__PS_BASE_URI__))) + if ((!isset($parsed['path']) ||!isset($parsed_host['path'])) || (preg_replace('/^www./', '', $parsed['host']) == preg_replace('/^www./', '', Tools::getHttpHost(false, false))) && !strncmp($parsed['path'], $parsed_host['path'], strlen(__PS_BASE_URI__))) return false; - if (Validate::isAbsoluteUrl(strval($_SERVER['HTTP_REFERER']))) - { - $source->http_referer = substr(strval($_SERVER['HTTP_REFERER']), 0, ConnectionsSource::$uri_max_size); - $source->keywords = trim(SearchEngine::getKeywords(strval($_SERVER['HTTP_REFERER']))); - if (!Validate::isMessage($source->keywords)) - return false; - } + + $source->http_referer = substr($_SERVER['HTTP_REFERER'], 0, ConnectionsSource::$uri_max_size); + $source->keywords = substr(trim(SearchEngine::getKeywords($_SERVER['HTTP_REFERER'])), 0, ConnectionsSource::$uri_max_size); } $source->id_connections = (int)$cookie->id_connections; $source->request_uri = Tools::getHttpHost(false, false); - if (isset($_SERVER['REDIRECT_URL'])) - $source->request_uri .= strval($_SERVER['REDIRECT_URL']); - elseif (isset($_SERVER['REQUEST_URI'])) - $source->request_uri .= strval($_SERVER['REQUEST_URI']); + + if (isset($_SERVER['REQUEST_URI'])) + $source->request_uri .= $_SERVER['REQUEST_URI']; + elseif (isset($_SERVER['REDIRECT_URL'])) + $source->request_uri .= $_SERVER['REDIRECT_URL']; + if (!Validate::isUrl($source->request_uri)) $source->request_uri = ''; $source->request_uri = substr($source->request_uri, 0, ConnectionsSource::$uri_max_size); @@ -104,4 +109,4 @@ class ConnectionsSourceCore extends ObjectModel WHERE id_order = '.(int)($id_order).' ORDER BY cos.date_add DESC'); } -} +} \ No newline at end of file diff --git a/classes/Contact.php b/classes/Contact.php index be3b4ee48..5962ecc83 100644 --- a/classes/Contact.php +++ b/classes/Contact.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Context.php b/classes/Context.php index 7790dc27c..838273337 100644 --- a/classes/Context.php +++ b/classes/Context.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -111,22 +111,27 @@ class ContextCore $this->mobile_device = false; if ($this->checkMobileContext()) { - require_once(_PS_TOOL_DIR_.'mobile_Detect/Mobile_Detect.php'); - $this->mobile_detect = new Mobile_Detect(); - switch ((int)Configuration::get('PS_ALLOW_MOBILE_DEVICE')) + if (isset(Context::getContext()->cookie->no_mobile) && Context::getContext()->cookie->no_mobile == false AND (int)Configuration::get('PS_ALLOW_MOBILE_DEVICE') != 0) + $this->mobile_device = true; + else { - case 1: // Only for mobile device - if ($this->mobile_detect->isMobile() && !$this->mobile_detect->isTablet()) - $this->mobile_device = true; - break; - case 2: // Only for touchpads - if ($this->mobile_detect->isTablet() && $this->mobile_detect->isMobile()) - $this->mobile_device = true; - break; - case 3: // For touchpad or mobile devices - if ($this->mobile_detect->isMobile() || $this->mobile_detect->isTablet()) - $this->mobile_device = true; - break; + require_once(_PS_TOOL_DIR_.'mobile_Detect/Mobile_Detect.php'); + $this->mobile_detect = new Mobile_Detect(); + switch ((int)Configuration::get('PS_ALLOW_MOBILE_DEVICE')) + { + case 1: // Only for mobile device + if ($this->mobile_detect->isMobile() && !$this->mobile_detect->isTablet()) + $this->mobile_device = true; + break; + case 2: // Only for touchpads + if ($this->mobile_detect->isTablet() && $this->mobile_detect->isMobile()) + $this->mobile_device = true; + break; + case 3: // For touchpad or mobile devices + if ($this->mobile_detect->isMobile() || $this->mobile_detect->isTablet()) + $this->mobile_device = true; + break; + } } } } @@ -138,9 +143,25 @@ class ContextCore { // Check mobile context if (Tools::isSubmit('no_mobile_theme')) + { Context::getContext()->cookie->no_mobile = true; - else if (Tools::isSubmit('mobile_theme_ok')) + if (Context::getContext()->cookie->id_guest) + { + $guest = new Guest(Context::getContext()->cookie->id_guest); + $guest->mobile_theme = false; + $guest->update(); + } + } + elseif (Tools::isSubmit('mobile_theme_ok')) + { Context::getContext()->cookie->no_mobile = false; + if (Context::getContext()->cookie->id_guest) + { + $guest = new Guest(Context::getContext()->cookie->id_guest); + $guest->mobile_theme = true; + $guest->update(); + } + } return isset($_SERVER['HTTP_USER_AGENT']) && isset(Context::getContext()->cookie) diff --git a/classes/ControllerFactory.php b/classes/ControllerFactory.php index 1ceb4036b..945e161cf 100644 --- a/classes/ControllerFactory.php +++ b/classes/ControllerFactory.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Cookie.php b/classes/Cookie.php index 6a242b820..8d358c6be 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -44,15 +44,13 @@ class CookieCore /** @var array cipher tool instance */ protected $_cipherTool; - /** @var array cipher tool initialization key */ - protected $_key; - - /** @var array cipher tool initilization vector */ - protected $_iv; - protected $_modified = false; protected $_allow_writing; + + protected $_salt; + + protected $_standalone; /** * Get data if the cookie exists and else initialize an new one @@ -60,24 +58,26 @@ class CookieCore * @param $name Cookie name before encrypting * @param $path */ - public function __construct($name, $path = '', $expire = null, $shared_urls = null) + public function __construct($name, $path = '', $expire = null, $shared_urls = null, $standalone = false) { $this->_content = array(); - $this->_expire = isset($expire) ? (int)($expire) : (time() + 1728000); - $this->_name = md5(_PS_VERSION_.$name); - $this->_path = trim(Context::getContext()->shop->physical_uri.$path, '/\\').'/'; + $this->_standalone = $standalone; + $this->_expire = is_null($expire) ? time() + 1728000 : (int)$expire; + $this->_name = md5(($this->_standalone ? '' : _PS_VERSION_).$name); + $this->_path = trim(($this->_standalone ? '' : Context::getContext()->shop->physical_uri).$path, '/\\').'/'; if ($this->_path{0} != '/') $this->_path = '/'.$this->_path; $this->_path = rawurlencode($this->_path); $this->_path = str_replace('%2F', '/', $this->_path); $this->_path = str_replace('%7E', '~', $this->_path); - $this->_key = _COOKIE_KEY_; - $this->_iv = _COOKIE_IV_; $this->_domain = $this->getDomain($shared_urls); $this->_allow_writing = true; - if (Configuration::get('PS_CIPHER_ALGORITHM')) - $this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); + $this->_salt = $this->_standalone ? str_pad('', 8, md5('ps'.__FILE__)) : _COOKIE_IV_; + if ($this->_standalone) + $this->_cipherTool = new Blowfish(str_pad('', 56, md5('ps'.__FILE__)), str_pad('', 56, md5('iv'.__FILE__))); + elseif (!Configuration::get('PS_CIPHER_ALGORITHM')) + $this->_cipherTool = new Blowfish(_COOKIE_KEY_, _COOKIE_IV_); else - $this->_cipherTool = new Blowfish($this->_key, $this->_iv); + $this->_cipherTool = new Rijndael(_RIJNDAEL_KEY_, _RIJNDAEL_IV_); $this->update(); } @@ -107,7 +107,7 @@ class CookieCore { if ($shared_url != $out[4]) continue; - if (preg_match('/^(?:.*\.)?([^.]*(?:.{2,3})?\..{2,3})$/Ui', $shared_url, $res)) + if (preg_match('/^(?:.*\.)?([^.]*(?:.{2,4})?\..{2,3})$/Ui', $shared_url, $res)) { $domain = '.'.$res[1]; break; @@ -270,7 +270,7 @@ class CookieCore //printf("\$content = %s
        ", $content); /* Get cookie checksum */ - $checksum = crc32($this->_iv.substr($content, 0, strrpos($content, '¤') + 2)); + $checksum = crc32($this->_salt.substr($content, 0, strrpos($content, '¤') + 2)); //printf("\$checksum = %s
        ", $checksum); /* Unserialize cookie content */ @@ -297,8 +297,12 @@ class CookieCore $this->_content['date_add'] = date('Y-m-d H:i:s'); //checks if the language exists, if not choose the default language - if (!Language::getLanguage((int)$this->id_lang)) + if (!$this->_standalone && !Language::getLanguage((int)$this->id_lang)) + { $this->id_lang = Configuration::get('PS_LANG_DEFAULT'); + // set detect_language to force going through Tools::setCookieLanguage to figure out browser lang + $this->detect_language = true; + } } @@ -344,7 +348,7 @@ class CookieCore $cookie .= $key.'|'.$value.'¤'; /* Add checksum to cookie */ - $cookie .= 'checksum|'.crc32($this->_iv.$cookie); + $cookie .= 'checksum|'.crc32($this->_salt.$cookie); $this->_modified = false; /* Cookies are encrypted for evident security reasons */ return $this->_setcookie($cookie); diff --git a/classes/Country.php b/classes/Country.php index 2ed891b27..c6c2623fd 100644 --- a/classes/Country.php +++ b/classes/Country.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -82,7 +82,7 @@ class CountryCore extends ObjectModel 'zip_code_format' => array('type' => self::TYPE_STRING, 'validate' => 'isZipCodeFormat'), 'display_tax_label' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), - // Lang fields + /* Lang fields */ 'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64), ), 'associations' => array( @@ -121,19 +121,23 @@ class CountryCore extends ObjectModel public static function getCountries($id_lang, $active = false, $contain_states = false, $list_states = true) { $countries = array(); - foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT cl.*,c.*, cl.`name` country, z.`name` 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_.'zone` z ON (z.`id_zone` = c.`id_zone`) - WHERE 1'.($active ? ' AND c.active = 1' : '').($contain_states ? ' AND c.`contains_states` = '.(int)$contain_states : '').' - ORDER BY cl.name ASC') as $country) - $countries[$country['id_country']] = $country; + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' + SELECT cl.*,c.*, cl.`name` country, z.`name` 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_.'zone` z ON (z.`id_zone` = c.`id_zone`) + WHERE 1'.($active ? ' AND c.active = 1' : '').($contain_states ? ' AND c.`contains_states` = '.(int)$contain_states : '').' + ORDER BY cl.name ASC'); + foreach ($result as $row) + $countries[$row['id_country']] = $row; if ($list_states) - foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'state` ORDER BY `name` ASC') as $state) - if (isset($countries[$state['id_country']])) /* Does not keep the state if its country has been disabled and not selected */ - $countries[$state['id_country']]['states'][] = $state; - + { + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'state` ORDER BY `name` ASC'); + foreach ($result as $row) + if (isset($countries[$row['id_country']]) && $row['active'] == 1) /* Does not keep the state if its country has been disabled and not selected */ + $countries[$row['id_country']]['states'][] = $row; + } return $countries; } @@ -369,4 +373,10 @@ class CountryCore extends ObjectModel else return true; } -} + + public function add($autodate = true, $null_values = false) + { + $return = parent::add($autodate, $null_values) && self::addModuleRestrictions(array(), array(array('id_country' => $this->id)), array()); + return $return; + } +} \ No newline at end of file diff --git a/classes/County.php b/classes/County.php index 5facc03f2..dfca4958d 100644 --- a/classes/County.php +++ b/classes/County.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* @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 */ diff --git a/classes/Currency.php b/classes/Currency.php index fd22cb9f4..6740dd955 100644 --- a/classes/Currency.php +++ b/classes/Currency.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -43,7 +43,7 @@ class CurrencyCore extends ObjectModel /** @var int bool used for displaying blank between sign and price */ public $blank; - /** @var string Conversion rate from euros */ + /** @var string exchange rate from euros */ public $conversion_rate; /** @var boolean True if currency has been deleted (staying in database as deleted) */ @@ -73,7 +73,7 @@ class CurrencyCore extends ObjectModel 'sign' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true, 'size' => 8), 'format' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'decimals' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true), - 'conversion_rate' =>array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true), + 'conversion_rate' =>array('type' => self::TYPE_FLOAT, 'validate' => 'isFloat', 'required' => true, 'shop' => true), 'deleted' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), ), @@ -326,23 +326,23 @@ class CurrencyCore extends ObjectModel } /** - * Refresh the currency conversion rate - * The XML file define conversion rate for each from a default currency ($isoCodeSource). + * Refresh the currency exchange rate + * The XML file define exchange rate for each from a default currency ($isoCodeSource). * - * @param $data XML content which contains all the conversion rates + * @param $data XML content which contains all the exchange rates * @param $isoCodeSource The default currency used in the XML file * @param $defaultCurrency The default currency object */ public function refreshCurrency($data, $isoCodeSource, $defaultCurrency) { - // fetch the conversion rate of the default currency - $conversion_rate = 1; + // fetch the exchange rate of the default currency + $exchange_rate = 1; if ($defaultCurrency->iso_code != $isoCodeSource) { foreach ($data->currency as $currency) if ($currency['iso_code'] == $defaultCurrency->iso_code) { - $conversion_rate = round((float)$currency['rate'], 6); + $exchange_rate = round((float)$currency['rate'], 6); break; } } @@ -364,7 +364,7 @@ class CurrencyCore extends ObjectModel } if (isset($rate)) - $this->conversion_rate = round($rate / $conversion_rate, 6); + $this->conversion_rate = round($rate / $exchange_rate, 6); } $this->update(); } diff --git a/classes/Customer.php b/classes/Customer.php index c6eb3f70d..f8a01c5ce 100644 --- a/classes/Customer.php +++ b/classes/Customer.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -42,7 +42,10 @@ class CustomerCore extends ObjectModel public $id_gender = 0; /** @var integer Default group ID */ - public $id_default_group = _PS_DEFAULT_CUSTOMER_GROUP_; + public $id_default_group; + + /** @var integer Current language used by the customer */ + public $id_lang; /** @var string Lastname */ public $lastname; @@ -135,6 +138,7 @@ class CustomerCore extends ObjectModel protected $webserviceParameters = array( 'fields' => array( 'id_default_group' => array('xlink_resource' => 'groups'), + 'id_lang' => array('xlink_resource' => 'languages'), 'newsletter_date_add' => array(), 'ip_registration_newsletter' => array(), 'last_passwd_gen' => array('setter' => null), @@ -181,6 +185,7 @@ class CustomerCore extends ObjectModel 'id_shop' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false), 'id_shop_group' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false), 'id_default_group' => array('type' => self::TYPE_INT, 'copy_post' => false), + 'id_lang' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'copy_post' => false), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), ), @@ -189,11 +194,18 @@ class CustomerCore extends ObjectModel protected static $_defaultGroupId = array(); protected static $_customerHasAddress = array(); protected static $_customer_groups = array(); - + + public function __construct($id = null) + { + $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); + parent::__construct($id); + } + public function add($autodate = true, $null_values = true) { $this->id_shop = ($this->id_shop) ? $this->id_shop : Context::getContext()->shop->id; $this->id_shop_group = ($this->id_shop_group) ? $this->id_shop_group : Context::getContext()->shop->id_shop_group; + $this->id_lang = ($this->id_lang) ? $this->id_lang : Context::getContext()->language->id; $this->birthday = (empty($this->years) ? $this->birthday : (int)$this->years.'-'.(int)$this->months.'-'.(int)$this->days); $this->secure_key = md5(uniqid(rand(), true)); $this->last_passwd_gen = date('Y-m-d H:i:s', strtotime('-'.Configuration::get('PS_PASSWD_TIME_FRONT').'minutes')); @@ -201,11 +213,11 @@ class CustomerCore extends ObjectModel if ($this->newsletter && !Validate::isDate($this->newsletter_date_add)) $this->newsletter_date_add = date('Y-m-d H:i:s'); - if ($this->id_default_group == _PS_DEFAULT_CUSTOMER_GROUP_) + if ($this->id_default_group == Configuration::get('PS_CUSTOMER_GROUP')) if ($this->is_guest) - $this->id_default_group = Configuration::get('PS_GUEST_GROUP'); + $this->id_default_group = (int)Configuration::get('PS_GUEST_GROUP'); else - $this->id_default_group = Configuration::get('PS_CUSTOMER_GROUP'); + $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); /* Can't create a guest customer, if this feature is disabled */ if ($this->is_guest && !Configuration::get('PS_GUEST_CHECKOUT_ENABLED')) @@ -221,7 +233,7 @@ class CustomerCore extends ObjectModel if ($this->newsletter && !Validate::isDate($this->newsletter_date_add)) $this->newsletter_date_add = date('Y-m-d H:i:s'); - if (Context::getContext()->controller->controller_type == 'admin') + if (isset(Context::getContext()->controller) && Context::getContext()->controller->controller_type == 'admin') $this->updateGroup($this->groupBox); if ($this->deleted) @@ -298,7 +310,7 @@ class CustomerCore extends ObjectModel * @param string $passwd Password is also checked if specified * @return Customer instance */ - public function getByEmail($email, $passwd = null) + public function getByEmail($email, $passwd = null, $ignore_guest = true) { if (!Validate::isEmail($email) || ($passwd && !Validate::isPasswd($passwd))) die (Tools::displayError()); @@ -308,8 +320,9 @@ class CustomerCore extends ObjectModel WHERE `email` = \''.pSQL($email).'\' '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' '.(isset($passwd) ? 'AND `passwd` = \''.Tools::encrypt($passwd).'\'' : '').' - AND `deleted` = 0 - AND `is_guest` = 0'; + AND `deleted` = 0'. + ($ignore_guest ? ' AND `is_guest` = 0' : ''); + $result = Db::getInstance()->getRow($sql); if (!$result) @@ -371,8 +384,13 @@ class CustomerCore extends ObjectModel public static function customerExists($email, $return_id = false, $ignore_guest = true) { if (!Validate::isEmail($email)) - die (Tools::displayError()); - + { + if (defined('_PS_MODE_DEV_') && _PS_MODE_DEV_) + die (Tools::displayError('Invalid email')); + else + return false; + } + $sql = 'SELECT `id_customer` FROM `'._DB_PREFIX_.'customer` WHERE `email` = \''.pSQL($email).'\' @@ -394,16 +412,17 @@ class CustomerCore extends ObjectModel */ public static function customerHasAddress($id_customer, $id_address) { - if (!array_key_exists($id_customer, self::$_customerHasAddress)) + $key = (int)$id_customer.'-'.(int)$id_address; + if (!array_key_exists($id_address, self::$_customerHasAddress)) { - self::$_customerHasAddress[$id_customer] = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + self::$_customerHasAddress[$key] = (bool)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' SELECT `id_address` FROM `'._DB_PREFIX_.'address` WHERE `id_customer` = '.(int)$id_customer.' AND `id_address` = '.(int)$id_address.' AND `deleted` = 0'); } - return self::$_customerHasAddress[$id_customer]; + return self::$_customerHasAddress[$key]; } public static function resetAddressCache($id_customer) @@ -420,12 +439,14 @@ class CustomerCore extends ObjectModel */ public function getAddresses($id_lang) { - $sql = 'SELECT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso + $sql = 'SELECT DISTINCT a.*, cl.`name` AS country, s.name AS state, s.iso_code AS state_iso FROM `'._DB_PREFIX_.'address` a LEFT JOIN `'._DB_PREFIX_.'country` c ON (a.`id_country` = c.`id_country`) LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (c.`id_country` = cl.`id_country`) LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = a.`id_state`) + '.(Context::getContext()->shop->getGroup()->share_order ? '' : Shop::addSqlAssociation('country', 'c')).' WHERE `id_lang` = '.(int)$id_lang.' AND `id_customer` = '.(int)$this->id.' AND a.`deleted` = 0'; + return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); } @@ -591,9 +612,12 @@ class CustomerCore extends ObjectModel public static function getGroupsStatic($id_customer) { - if (!Group::isFeatureActive() || $id_customer == 0) + if (!Group::isFeatureActive()) return array(Configuration::get('PS_CUSTOMER_GROUP')); + if ($id_customer == 0) + self::$_customer_groups[$id_customer] = array((int)Configuration::get('PS_UNIDENTIFIED_GROUP')); + if (!isset(self::$_customer_groups[$id_customer])) { self::$_customer_groups[$id_customer] = array(); diff --git a/classes/CustomerMessage.php b/classes/CustomerMessage.php index 77bbf64e6..ae8709d5b 100644 --- a/classes/CustomerMessage.php +++ b/classes/CustomerMessage.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -55,6 +55,17 @@ class CustomerMessageCore extends ObjectModel 'read' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool') ), ); + + protected $webserviceParameters = array( + 'fields' => array( + 'id_employee' => array( + 'xlink_resource' => 'employees' + ), + 'id_customer_thread' => array( + 'xlink_resource' => 'customer_threads' + ), + ), + ); public static function getMessagesByOrderId($id_order, $private = true) { @@ -73,7 +84,7 @@ class CustomerMessageCore extends ObjectModel LEFT OUTER JOIN `'._DB_PREFIX_.'employee` e ON e.`id_employee` = cm.`id_employee` WHERE ct.id_order = '.(int)$id_order.' - AND '.(!$private ? 'cm.`private` = 0' : '').' + '.(!$private ? 'AND cm.`private` = 0' : '').' GROUP BY cm.id_customer_message ORDER BY cm.date_add DESC '); @@ -93,6 +104,11 @@ class CustomerMessageCore extends ObjectModel WHERE '.$where ); } - -} - + + public function delete() + { + if (!empty($this->file_name)) + @unlink(_PS_UPLOAD_DIR_.$this->file_name); + return parent::delete(); + } +} \ No newline at end of file diff --git a/classes/CustomerThread.php b/classes/CustomerThread.php index 0c7d3c407..3425b38d1 100644 --- a/classes/CustomerThread.php +++ b/classes/CustomerThread.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -59,16 +59,65 @@ class CustomerThreadCore extends ObjectModel 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), ), ); + + protected $webserviceParameters = array( + 'fields' => array( + 'id_lang' => array( + 'xlink_resource' => 'languages' + ), + 'id_shop' => array( + 'xlink_resource' => 'shops' + ), + 'id_customer' => array( + 'xlink_resource' => 'customers' + ), + 'id_order' => array( + 'xlink_resource' => 'orders' + ), + 'id_product' => array( + 'xlink_resource' => 'products' + ), + ), + 'associations' => array( + 'customer_messages' => array( + 'resource' => 'customer_message', + 'id' => array('required' => true)), + ) + ); + + public function getWsCustomerMessages() + { + return Db::getInstance()->executeS(' + SELECT `id_customer_message` id + FROM `'._DB_PREFIX_.'customer_message` + WHERE `id_customer_thread` = '.(int)$this->id); + } public function delete() { if (!Validate::isUnsignedId($this->id)) return false; - Db::getInstance()->execute(' - DELETE FROM `'._DB_PREFIX_.'customer_message` + + $return = true; + $result = Db::getInstance()->executeS(' + SELECT `id_customer_message` + FROM `'._DB_PREFIX_.'customer_message` WHERE `id_customer_thread` = '.(int)$this->id ); - return (parent::delete()); + + if( count($result)) + { + foreach ($result AS $res) + { + $message = new CustomerMessage((int)$res['id_customer_message']); + if (!Validate::isLoadedObject($message)) + $return = false; + else + $return &= $message->delete(); + } + } + $return &= parent::delete(); + return $return; } public static function getCustomerMessages($id_customer, $read = null) @@ -102,6 +151,7 @@ class CustomerThreadCore extends ObjectModel SELECT id_customer_thread FROM '._DB_PREFIX_.'customer_thread ct2 WHERE status = "open" AND ct.id_contact = ct2.id_contact + '.Shop::addSqlRestriction().' ORDER BY date_upd ASC LIMIT 1 ) as id_customer_thread @@ -111,6 +161,7 @@ class CustomerThreadCore extends ObjectModel WHERE ct.status = "open" AND ct.id_contact IS NOT NULL AND cl.id_contact IS NOT NULL + '.Shop::addSqlRestriction().' GROUP BY ct.id_contact HAVING COUNT(*) > 0 '); } @@ -169,5 +220,4 @@ class CustomerThreadCore extends ObjectModel ' ORDER BY ct.date_upd ASC '); } -} - +} \ No newline at end of file diff --git a/classes/Customization.php b/classes/Customization.php index 1c4a9e825..96bc352bc 100644 --- a/classes/Customization.php +++ b/classes/Customization.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/DateRange.php b/classes/DateRange.php index 70ee2dd4b..b1fb03cea 100644 --- a/classes/DateRange.php +++ b/classes/DateRange.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Delivery.php b/classes/Delivery.php index 10df4b7b0..b6ee64a88 100644 --- a/classes/Delivery.php +++ b/classes/Delivery.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Discount.php b/classes/Discount.php index 8c4155c11..d35136f11 100644 --- a/classes/Discount.php +++ b/classes/Discount.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Dispatcher.php b/classes/Dispatcher.php index 8fabc3853..e8894f88d 100644 --- a/classes/Dispatcher.php +++ b/classes/Dispatcher.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -45,36 +45,6 @@ class DispatcherCore * @var array List of default routes */ public $default_routes = array( - 'product_rule' => array( - 'controller' => 'product', - 'rule' => '{category:/}{id}-{rewrite}{-:ean13}.html', - 'keywords' => array( - 'id' => array('regexp' => '[0-9]+', 'param' => 'id_product'), - 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - 'ean13' => array('regexp' => '[0-9\pL]*'), - 'category' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - 'categories' => array('regexp' => '[/_a-zA-Z0-9-\pL]*'), - 'reference' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - 'manufacturer' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - 'supplier' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - 'price' => array('regexp' => '[0-9\.,]*'), - 'tags' => array('regexp' => '[a-zA-Z0-9-\pL]*'), - ), - ), - 'layered_rule' => array( - 'controller' => 'category', - 'rule' => '{id}-{rewrite}{/:selected_filters}', - 'keywords' => array( - 'id' => array('regexp' => '[0-9]+', 'param' => 'id_category'), - /* Selected filters is used by the module blocklayered */ - 'selected_filters' => array('regexp' => '.*', 'param' => 'selected_filters'), - 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), - ), - ), 'category_rule' => array( 'controller' => 'category', 'rule' => '{id}-{rewrite}', @@ -136,6 +106,37 @@ class DispatcherCore 'fc' => 'module', ), ), + 'product_rule' => array( + 'controller' => 'product', + 'rule' => '{category:/}{id}-{rewrite}{-:ean13}.html', + 'keywords' => array( + 'id' => array('regexp' => '[0-9]+', 'param' => 'id_product'), + 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'ean13' => array('regexp' => '[0-9\pL]*'), + 'category' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'categories' => array('regexp' => '[/_a-zA-Z0-9-\pL]*'), + 'reference' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'manufacturer' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'supplier' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'price' => array('regexp' => '[0-9\.,]*'), + 'tags' => array('regexp' => '[a-zA-Z0-9-\pL]*'), + ), + ), + // Must be after the product and category rules in order to avoid conflict + 'layered_rule' => array( + 'controller' => 'category', + 'rule' => '{id}-{rewrite}{/:selected_filters}', + 'keywords' => array( + 'id' => array('regexp' => '[0-9]+', 'param' => 'id_category'), + /* Selected filters is used by the module blocklayered */ + 'selected_filters' => array('regexp' => '.*', 'param' => 'selected_filters'), + 'rewrite' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_keywords' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + 'meta_title' => array('regexp' => '[_a-zA-Z0-9-\pL]*'), + ), + ), ); /** @@ -205,7 +206,6 @@ class DispatcherCore $this->front_controller = self::FC_ADMIN; $this->controller_not_found = 'adminnotfound'; $this->default_controller = 'adminhome'; - $this->use_routes = false; } elseif (Tools::getValue('fc') == 'module') { @@ -243,7 +243,6 @@ class DispatcherCore $this->getController(); if (!$this->controller) $this->controller = $this->default_controller; - // Dispatch with right front controller switch ($this->front_controller) { @@ -380,18 +379,22 @@ class DispatcherCore /** * Load default routes group by languages */ - protected function loadRoutes() + protected function loadRoutes($id_shop = null) { $context = Context::getContext(); // Load custom routes from modules - $modules_routes = Hook::exec('moduleRoutes', array(), null, true, false); + $modules_routes = Hook::exec('moduleRoutes', array('id_shop' => $id_shop), null, true, false); if (is_array($modules_routes) && count($modules_routes)) - foreach($modules_routes as $module_route) - foreach($module_route as $route => $route_details) - if (array_key_exists('controller', $route_details) && array_key_exists('rule', $route_details) - && array_key_exists('keywords', $route_details) && array_key_exists('params', $route_details)) - $this->addRoute($route, $route_details['rule'], $route_details['controller'], null, $route_details['keywords'], $route_details['params']); + foreach($modules_routes as $module_route) + foreach($module_route as $route => $route_details) + if (array_key_exists('controller', $route_details) && array_key_exists('rule', $route_details) + && array_key_exists('keywords', $route_details) && array_key_exists('params', $route_details)) + { + if (!isset($this->default_routes[$route])) + $this->default_routes[$route] = array(); + $this->default_routes[$route] = array_merge($this->default_routes[$route], $route_details); + } // Set default routes foreach (Language::getLanguages() as $lang) @@ -402,9 +405,11 @@ class DispatcherCore $route['controller'], $lang['id_lang'], $route['keywords'], - isset($route['params']) ? $route['params'] : array() + isset($route['params']) ? $route['params'] : array(), + $id_shop ); - + + // Load the custom routes prior the defaults to avoid infinite loops if ($this->use_routes) { // Get iso lang @@ -416,13 +421,13 @@ class DispatcherCore // Load routes from meta table $sql = 'SELECT m.page, ml.url_rewrite, ml.id_lang FROM `'._DB_PREFIX_.'meta` m - LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.id_meta = ml.id_meta'.Shop::addSqlRestrictionOnLang('ml').') + LEFT JOIN `'._DB_PREFIX_.'meta_lang` ml ON (m.id_meta = ml.id_meta'.Shop::addSqlRestrictionOnLang('ml', $id_shop).') ORDER BY LENGTH(ml.url_rewrite) DESC'; if ($results = Db::getInstance()->executeS($sql)) foreach ($results as $row) { if ($row['url_rewrite']) - $this->addRoute($row['page'], $row['url_rewrite'], $row['page'], $row['id_lang']); + $this->addRoute($row['page'], $row['url_rewrite'], $row['page'], $row['id_lang'], array(), array(), $id_shop); } // Set default empty route if no empty route (that's weird I know) @@ -435,7 +440,7 @@ class DispatcherCore // Load custom routes foreach ($this->default_routes as $route_id => $route_data) - if ($custom_route = Configuration::get('PS_ROUTE_'.$route_id)) + if ($custom_route = Configuration::get('PS_ROUTE_'.$route_id, null, null, $id_shop)) foreach (Language::getLanguages() as $lang) $this->addRoute( $route_id, @@ -443,7 +448,8 @@ class DispatcherCore $route_data['controller'], $lang['id_lang'], $route_data['keywords'], - isset($route_data['params']) ? $route_data['params'] : array() + isset($route_data['params']) ? $route_data['params'] : array(), + $id_shop ); } } @@ -454,17 +460,21 @@ class DispatcherCore * @param string $rule Url rule * @param string $controller Controller to call if request uri match the rule * @param int $id_lang + * @param int $id_shop */ - public function addRoute($route_id, $rule, $controller, $id_lang = null, array $keywords = array(), array $params = array()) + public function addRoute($route_id, $rule, $controller, $id_lang = null, array $keywords = array(), array $params = array(), $id_shop = null) { - if (is_null($id_lang)) - $id_lang = Context::getContext()->language->id; + if ($id_lang === null) + $id_lang = (int)Context::getContext()->language->id; + + if ($id_shop === null) + $id_shop = (int)Context::getContext()->shop->id; $regexp = preg_quote($rule, '#'); if ($keywords) { $transform_keywords = array(); - preg_match_all('#\\\{(([^{}]+)\\\:)?('.implode('|', array_keys($keywords)).')(\\\:([^{}]+))?\\\}#', $regexp, $m); + preg_match_all('#\\\{(([^{}]*)\\\:)?('.implode('|', array_keys($keywords)).')(\\\:([^{}]*))?\\\}#', $regexp, $m); for ($i = 0, $total = count($m[0]); $i < $total; $i++) { $prepend = $m[2][$i]; @@ -493,10 +503,12 @@ class DispatcherCore } $regexp = '#^/'.$regexp.'(\?.*)?$#u'; - if (!isset($this->routes[$id_lang])) - $this->routes[$id_lang] = array(); + if (!isset($this->routes[$id_shop])) + $this->routes[$id_shop] = array(); + if (!isset($this->routes[$id_shop][$id_lang])) + $this->routes[$id_shop][$id_lang] = array(); - $this->routes[$id_lang][$route_id] = array( + $this->routes[$id_shop][$id_lang][$route_id] = array( 'rule' => $rule, 'regexp' => $regexp, 'controller' => $controller, @@ -510,14 +522,17 @@ class DispatcherCore * * @param string $route_id * @param int $id_lang + * @param int $id_shop * @return bool */ - public function hasRoute($route_id, $id_lang = null) + public function hasRoute($route_id, $id_lang = null, $id_shop = null) { - if (is_null($id_lang)) - $id_lang = Context::getContext()->language->id; + if ($id_lang === null) + $id_lang = (int)Context::getContext()->language->id; + if ($id_shop === null) + $id_shop = (int)Context::getContext()->shop->id; - return isset($this->routes[$id_lang]) && isset($this->routes[$id_lang][$route_id]); + return isset($this->routes[$id_shop]) && isset($this->routes[$id_shop][$id_lang]) && isset($this->routes[$id_shop][$id_lang][$route_id]); } /** @@ -526,14 +541,18 @@ class DispatcherCore * @param string $route_id * @param int $id_lang * @param string $keyword + * @param int $id_shop * @return bool */ - public function hasKeyword($route_id, $id_lang, $keyword) + public function hasKeyword($route_id, $id_lang, $keyword, $id_shop = null) { - if (!isset($this->routes[$id_lang]) && !isset($this->routes[$id_lang][$route_id])) + if ($id_shop === null) + $id_shop = (int)Context::getContext()->shop->id; + + if (!isset($this->routes[$id_shop]) || !isset($this->routes[$id_shop][$id_lang]) || !isset($this->routes[$id_shop][$id_lang][$route_id])) return false; - return preg_match('#\{([^{}]+:)?'.preg_quote($keyword, '#').'(:[^{}])?\}#', $this->routes[$id_lang][$route_id]['rule']); + return preg_match('#\{([^{}]*:)?'.preg_quote($keyword, '#').'(:[^{}]*)?\}#', $this->routes[$id_shop][$id_lang][$route_id]['rule']); } /** @@ -550,7 +569,7 @@ class DispatcherCore return false; foreach ($this->default_routes[$route_id]['keywords'] as $keyword => $data) - if (isset($data['param']) && !preg_match('#\{([^{}]+:)?'.$keyword.'(:[^{}])?\}#', $rule)) + if (isset($data['param']) && !preg_match('#\{([^{}]*:)?'.$keyword.'(:[^{}]*)?\}#', $rule)) $errors[] = $keyword; return (count($errors)) ? false : true; @@ -565,19 +584,23 @@ class DispatcherCore * @param bool $use_routes If false, don't use to create this url * @param string $anchor Optional anchor to add at the end of this url */ - public function createUrl($route_id, $id_lang = null, array $params = array(), $force_routes = false, $anchor = '') + public function createUrl($route_id, $id_lang = null, array $params = array(), $force_routes = false, $anchor = '', $id_shop = null) { - if (!$id_lang) - $id_lang = Context::getContext()->language->id; + if ($id_lang === null) + $id_lang = (int)Context::getContext()->language->id; + if ($id_shop === null) + $id_shop = (int)Context::getContext()->shop->id; - if (!isset($this->routes[$id_lang][$route_id])) + if ($this->use_routes && !isset($this->routes[$id_shop])) + $this->loadRoutes($id_shop); + + if (!isset($this->routes[$id_shop][$id_lang][$route_id])) { $query = http_build_query($params, '', '&'); $index_link = $this->use_routes ? '' : 'index.php'; return ($route_id == 'index') ? $index_link.(($query) ? '?'.$query : '') : 'index.php?controller='.$route_id.(($query) ? '&'.$query : '').$anchor; } - $route = $this->routes[$id_lang][$route_id]; - + $route = $this->routes[$id_shop][$id_lang][$route_id]; // Check required fields $query_params = isset($route['params']) ? $route['params'] : array(); foreach ($route['keywords'] as $key => $data) @@ -594,8 +617,10 @@ class DispatcherCore // Build an url which match a route if ($this->use_routes || $force_routes) { + $url = $route['rule']; $add_param = array(); + foreach ($params as $key => $value) { if (!isset($route['keywords'][$key])) @@ -609,10 +634,10 @@ class DispatcherCore $replace = $route['keywords'][$key]['prepend'].$params[$key].$route['keywords'][$key]['append']; else $replace = ''; - $url = preg_replace('#\{([^{}]+:)?'.$key.'(:[^{}])?\}#', $replace, $url); + $url = preg_replace('#\{([^{}]*:)?'.$key.'(:[^{}]*)?\}#', $replace, $url); } } - $url = preg_replace('#\{([^{}]+:)?[a-z0-9_]+?(:[^{}])?\}#', '', $url); + $url = preg_replace('#\{([^{}]*:)?[a-z0-9_]+?(:[^{}]*)?\}#', '', $url); if (count($add_param)) $url .= '?'.http_build_query($add_param, '', '&'); } @@ -641,10 +666,18 @@ class DispatcherCore * * @return string */ - public function getController() - { + public function getController($id_shop = null) + { + if (defined('_PS_ADMIN_DIR_')) + $_GET['controllerUri'] = Tools::getvalue('controller'); if ($this->controller) + { + $_GET['controller'] = $this->controller; return $this->controller; + } + + if ($id_shop === null) + $id_shop = (int)Context::getContext()->shop->id; $controller = Tools::getValue('controller'); @@ -661,44 +694,48 @@ class DispatcherCore $controller = false; // Use routes ? (for url rewriting) - if ($this->use_routes && !$controller) + if ($this->use_routes && !$controller && !defined('_PS_ADMIN_DIR_')) { if (!$this->request_uri) return strtolower($this->controller_not_found); $controller = $this->controller_not_found; + + // If the request_uri matches a static file, then there is no need to check the routes, we keep "controller_not_found" (a static file should not go through the dispatcher) + if (!preg_match('/\.(gif|jpe?g|png|css|js|ico)$/i', $this->request_uri)) + { + // Add empty route as last route to prevent this greedy regexp to match request uri before right time + if ($this->empty_route) + $this->addRoute($this->empty_route['routeID'], $this->empty_route['rule'], $this->empty_route['controller'], Context::getContext()->language->id, array(), array(), $id_shop); - // Add empty route as last route to prevent this greedy regexp to match request uri before right time - if ($this->empty_route) - $this->addRoute($this->empty_route['routeID'], $this->empty_route['rule'], $this->empty_route['controller'], Context::getContext()->language->id); - - if (isset($this->routes[Context::getContext()->language->id])) - foreach ($this->routes[Context::getContext()->language->id] as $route) - if (preg_match($route['regexp'], $this->request_uri, $m)) - { - // Route found ! Now fill $_GET with parameters of uri - foreach ($m as $k => $v) - if (!is_numeric($k)) - $_GET[$k] = $v; - - $controller = $route['controller'] ? $route['controller'] : $_GET['controller']; - if (!empty($route['params'])) - foreach ($route['params'] as $k => $v) - $_GET[$k] = $v; - - // A patch for module friendly urls - if (preg_match('#module-([a-z0-9_-]+)-([a-z0-9]+)$#i', $controller, $m)) + if (isset($this->routes[$id_shop][Context::getContext()->language->id])) + foreach ($this->routes[$id_shop][Context::getContext()->language->id] as $route) + if (preg_match($route['regexp'], $this->request_uri, $m)) { - $_GET['module'] = $m[1]; - $_GET['fc'] = 'module'; - $controller = $m[2]; + // Route found ! Now fill $_GET with parameters of uri + foreach ($m as $k => $v) + if (!is_numeric($k)) + $_GET[$k] = $v; + + $controller = $route['controller'] ? $route['controller'] : $_GET['controller']; + if (!empty($route['params'])) + foreach ($route['params'] as $k => $v) + $_GET[$k] = $v; + + // A patch for module friendly urls + if (preg_match('#module-([a-z0-9_-]+)-([a-z0-9]+)$#i', $controller, $m)) + { + $_GET['module'] = $m[1]; + $_GET['fc'] = 'module'; + $controller = $m[2]; + } + + if (isset($_GET['fc']) && $_GET['fc'] == 'module') + $this->front_controller = self::FC_MODULE; + break; } - - if (isset($_GET['fc']) && $_GET['fc'] == 'module') - $this->front_controller = self::FC_MODULE; - break; - } - - if ($controller == 'index' || $this->request_uri == '/index.php') + } + + if ($controller == 'index' || $this->request_uri == '/index.php') $controller = $this->default_controller; $this->controller = $controller; } @@ -757,4 +794,4 @@ class DispatcherCore return $controllers; } -} +} \ No newline at end of file diff --git a/classes/Employee.php b/classes/Employee.php index 763b94c68..1debb4eed 100644 --- a/classes/Employee.php +++ b/classes/Employee.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -244,12 +244,15 @@ class EmployeeCore extends ObjectModel */ public function isLoggedBack() { - /* Employee is valid only if it can be load and if cookie password is the same as database one */ - return ($this->id - && Validate::isUnsignedId($this->id) - && Employee::checkPassword($this->id, $this->passwd) - && (!isset($this->remote_addr) || $this->remote_addr == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP')) - ); + if (!Cache::isStored('isLoggedBack'.$this->id)) + { + /* Employee is valid only if it can be load and if cookie password is the same as database one */ + Cache::store('isLoggedBack'.$this->id, ( + $this->id && Validate::isUnsignedId($this->id) && Employee::checkPassword($this->id, $this->passwd) + && (!isset($this->remote_addr) || $this->remote_addr == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP')) + )); + } + return Cache::retrieve('isLoggedBack'.$this->id); } /** diff --git a/classes/Feature.php b/classes/Feature.php index 192d417e7..38e566ed0 100644 --- a/classes/Feature.php +++ b/classes/Feature.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -81,7 +81,7 @@ class FeatureCore extends ObjectModel public static function getFeatures($id_lang, $with_shop = true) { return Db::getInstance()->executeS(' - SELECT * + SELECT DISTINCT f.id_feature, f.*, fl.* FROM `'._DB_PREFIX_.'feature` f '.($with_shop ? Shop::addSqlAssociation('feature', 'f') : '').' LEFT JOIN `'._DB_PREFIX_.'feature_lang` fl ON (f.`id_feature` = fl.`id_feature` AND fl.`id_lang` = '.(int)$id_lang.') @@ -312,21 +312,16 @@ class FeatureCore extends ObjectModel */ public static function cleanPositions() { - $return = true; - - $sql = ' - SELECT `id_feature` - FROM `'._DB_PREFIX_.'feature` - ORDER BY `position`'; - $result = Db::getInstance()->executeS($sql); - - $i = 0; - foreach ($result as $value) - $return = Db::getInstance()->execute(' - UPDATE `'._DB_PREFIX_.'feature` - SET `position` = '.(int)$i++.' - WHERE `id_feature` = '.(int)$value['id_feature']); - return $return; + return Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'feature` f + LEFT JOIN ( + SELECT @i := @i +1 AS rank, id_feature, position + FROM `'._DB_PREFIX_.'feature` + JOIN (SELECT @i :=1) dummy + ORDER by position + ) AS f2 + USING (id_feature) + SET f.position = f2.rank - 1'); } /** diff --git a/classes/FeatureValue.php b/classes/FeatureValue.php index 8917b3bab..9ad101f95 100644 --- a/classes/FeatureValue.php +++ b/classes/FeatureValue.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/FileUploader.php b/classes/FileUploader.php index 326eb9ef3..be70593df 100755 --- a/classes/FileUploader.php +++ b/classes/FileUploader.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -162,14 +162,13 @@ class QqUploadedFileXhr public function upload($path) { $input = fopen('php://input', 'r'); - $temp = tmpfile(); - $realSize = stream_copy_to_stream($input, $temp); - fclose($input); + $target = fopen($path, 'w'); + + $realSize = stream_copy_to_stream($input, $target); if ($realSize != $this->getSize()) return false; - $target = fopen($path, 'w'); - fseek($temp, 0, SEEK_SET); - stream_copy_to_stream($temp, $target); + + fclose($input); fclose($target); return true; diff --git a/classes/Gender.php b/classes/Gender.php index 41cf0eba1..62b21d471 100644 --- a/classes/Gender.php +++ b/classes/Gender.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -66,8 +66,8 @@ class GenderCore extends ObjectModel public function getImage($use_unknown = false) { - if (!file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg')) - return ($use_unknown) ? _PS_ADMIN_IMG_.'unknown.gif' : false; + if (!isset($this->id) || empty($this->id) || !file_exists(_PS_GENDERS_DIR_.$this->id.'.jpg')) + return _THEME_GENDERS_DIR_.'Unknown.jpg'; return _THEME_GENDERS_DIR_.$this->id.'.jpg'; } } \ No newline at end of file diff --git a/classes/Group.php b/classes/Group.php index 2f6b05a66..eb8b95e3d 100644 --- a/classes/Group.php +++ b/classes/Group.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -70,6 +70,13 @@ class GroupCore extends ObjectModel protected $webserviceParameters = array(); + public function __construct($id = null, $id_lang = null, $id_shop = null) + { + parent::__construct($id, $id_lang, $id_shop); + if ($this->id && !isset(Group::$group_price_display_method[$this->id])) + self::$group_price_display_method[$this->id] = $this->price_display_method; + } + public static function getGroups($id_lang, $id_shop = false) { $shop_criteria = ''; @@ -84,7 +91,7 @@ class GroupCore extends ObjectModel ORDER BY g.`id_group` ASC'); } - public function getCustomers($count = false, $start = 0, $limit = 0) + public function getCustomers($count = false, $start = 0, $limit = 0, $shop_filtering = false) { if ($count) return Db::getInstance()->getValue(' @@ -92,6 +99,7 @@ class GroupCore extends ObjectModel FROM `'._DB_PREFIX_.'customer_group` cg LEFT JOIN `'._DB_PREFIX_.'customer` c ON (cg.`id_customer` = c.`id_customer`) WHERE cg.`id_group` = '.(int)$this->id.' + '.($shop_filtering ? Shop::addSqlRestriction(Shop::SHARE_CUSTOMER) : '').' AND c.`deleted` != 1'); return Db::getInstance()->executeS(' SELECT cg.`id_customer`, c.* @@ -99,6 +107,7 @@ class GroupCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'customer` c ON (cg.`id_customer` = c.`id_customer`) WHERE cg.`id_group` = '.(int)$this->id.' AND c.`deleted` != 1 + '.($shop_filtering ? Shop::addSqlRestriction(Shop::SHARE_CUSTOMER) : '').' ORDER BY cg.`id_customer` ASC '.($limit > 0 ? 'LIMIT '.(int)$start.', '.(int)$limit : '')); } @@ -106,10 +115,10 @@ class GroupCore extends ObjectModel public static function getReduction($id_customer = null) { if (!isset(self::$cache_reduction['customer'][(int)$id_customer])) - { - $id_group = $id_customer ? Customer::getDefaultGroupId((int)$id_customer) : (int)Configuration::get('PS_CUSTOMER_GROUP'); - self::$cache_reduction['customer'][(int)$id_customer] = Group::getReductionByIdGroup($id_group); - } + { + $id_group = $id_customer ? Customer::getDefaultGroupId((int)$id_customer) : (int)Group::getCurrent()->id; + self::$cache_reduction['customer'][(int)$id_customer] = Group::getReductionByIdGroup($id_group); + } return self::$cache_reduction['customer'][(int)$id_customer]; } @@ -157,7 +166,7 @@ class GroupCore extends ObjectModel public function delete() { - if ($this->id == _PS_DEFAULT_CUSTOMER_GROUP_) + if ($this->id == (int)Configuration::get('PS_CUSTOMER_GROUP')) return false; if (parent::delete()) { @@ -295,13 +304,17 @@ class GroupCore extends ObjectModel */ public static function getCurrent() { + static $groups = array(); $customer = Context::getContext()->customer; - $id_group = (int)Configuration::get('PS_UNIDENTIFIED_GROUP'); - if (Validate::isLoadedObject($customer)) $id_group = (int)$customer->id_default_group; + else + $id_group = (int)Configuration::get('PS_UNIDENTIFIED_GROUP'); + + if (!isset($groups[$id_group])) + $groups[$id_group] = new Group($id_group); - return new self($id_group); + return $groups[$id_group]; } } diff --git a/classes/GroupReduction.php b/classes/GroupReduction.php index f24915685..599342844 100644 --- a/classes/GroupReduction.php +++ b/classes/GroupReduction.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -216,13 +216,18 @@ class GroupReductionCore extends ObjectModel FROM `'._DB_PREFIX_.'product_group_reduction_cache` pgr WHERE pgr.`id_product` = '.(int)$id_product_old ); + if (!$res) return true; + + $query = ''; + foreach ($res as $row) { - $query = 'INSERT INTO `'._DB_PREFIX_.'product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES '; - $query .= '('.(int)$id_product.', '.(int)$row['id_group'].', '.(float)$row['reduction'].')'; + $query .= 'INSERT INTO `'._DB_PREFIX_.'product_group_reduction_cache` (`id_product`, `id_group`, `reduction`) VALUES '; + $query .= '('.(int)$id_product.', '.(int)$row['id_group'].', '.(float)$row['reduction'].') ON DUPLICATE KEY UPDATE `reduction` = '.(float)$row['reduction'].';'; } + return Db::getInstance()->execute($query); } diff --git a/classes/Guest.php b/classes/Guest.php index debbf5702..cd57912cd 100644 --- a/classes/Guest.php +++ b/classes/Guest.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -40,6 +40,7 @@ class GuestCore extends ObjectModel public $real_player; public $windows_media; public $accept_language; + public $mobile_theme; /** * @see ObjectModel::$definition @@ -62,6 +63,7 @@ class GuestCore extends ObjectModel 'real_player' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'windows_media' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'accept_language' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'size' => 8), + 'mobile_theme' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), ), ); @@ -77,7 +79,7 @@ class GuestCore extends ObjectModel $acceptLanguage = isset($_SERVER['HTTP_ACCEPT_LANGUAGE']) ? $_SERVER['HTTP_ACCEPT_LANGUAGE'] : ''; $this->id_operating_system = $this->getOs($userAgent); $this->id_web_browser = $this->getBrowser($userAgent); - $this->accept_language = $this->getLanguage($acceptLanguage); + $this->mobile_theme = Context::getContext()->getMobileDevice(); } protected function getLanguage($acceptLanguage) @@ -183,12 +185,7 @@ class GuestCore extends ObjectModel { $guest = new Guest(isset($cookie->id_customer) ? Guest::getFromCustomer((int)($cookie->id_customer)) : null); $guest->userAgent(); - if ($guest->id_operating_system || $guest->id_web_browser) - { - $guest->save(); - $cookie->id_guest = (int)($guest->id); - } + $guest->save(); + $cookie->id_guest = (int)($guest->id); } } - - diff --git a/classes/HelpAccess.php b/classes/HelpAccess.php index 893b99b35..59f01dcc5 100644 --- a/classes/HelpAccess.php +++ b/classes/HelpAccess.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -79,7 +79,7 @@ class HelpAccessCore $tooltip = ''; $ctx = @stream_context_create(array('http' => array('timeout' => 10))); - $res = @file_get_contents($url, 0, $ctx); + $res = Tools::file_get_contents($url, false, $ctx); $infos = preg_split('/\|/', $res); if (count($infos) > 0) diff --git a/classes/Hook.php b/classes/Hook.php index eb5e76f21..451b3b31b 100644 --- a/classes/Hook.php +++ b/classes/Hook.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -64,10 +64,10 @@ class HookCore extends ObjectModel 'primary' => 'id_hook', 'fields' => array( 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isHookName', 'required' => true, 'size' => 64), - 'title' => array('type' => self::TYPE_STRING), - 'description' => array('type' => self::TYPE_HTML), - 'position' => array('type' => self::TYPE_BOOL), - 'live_edit' => array('type' => self::TYPE_BOOL), + 'title' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName'), + 'description' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml'), + 'position' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), + 'live_edit' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), ), ); @@ -83,7 +83,7 @@ class HookCore extends ObjectModel public function add($autodate = true, $null_values = false) { - Cache::clean('hook_idbyname_'.$this->name); + Cache::clean('hook_idsbyname'); return parent::add($autodate, $null_values); } @@ -98,7 +98,7 @@ class HookCore extends ObjectModel return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' SELECT * FROM `'._DB_PREFIX_.'hook` h '.($position ? 'WHERE h.`position` = 1' : '').' - ORDER BY `title`' + ORDER BY `name`' ); } @@ -113,20 +113,59 @@ class HookCore extends ObjectModel if (!Validate::isHookName($hook_name)) return false; - $cache_id = 'hook_idbyname_'.$hook_name; + $cache_id = 'hook_idsbyname'; if (!Cache::isStored($cache_id)) { - $retro_hook_name = Hook::getRetroHookName($hook_name); - Cache::store($cache_id, Db::getInstance()->getValue(' - SELECT `id_hook` - FROM `'._DB_PREFIX_.'hook` - WHERE `name` = \''.pSQL($hook_name).'\' - OR `name` = \''.pSQL($retro_hook_name).'\' - ')); + // Get all hook ID by name and alias + $hook_ids = array(); + $result = Db::getInstance()->ExecuteS(' + SELECT `id_hook`, `name` + FROM `'._DB_PREFIX_.'hook` + UNION + SELECT `id_hook`, ha.`alias` as name + FROM `'._DB_PREFIX_.'hook_alias` ha + INNER JOIN `'._DB_PREFIX_.'hook` h ON ha.name = h.name'); + foreach ($result as $row) + { + $hook_ids[$row['name']] = $row['id_hook']; + } + Cache::store($cache_id, $hook_ids); } + else + $hook_ids = Cache::retrieve($cache_id); + return (isset($hook_ids[$hook_name]) ? $hook_ids[$hook_name] : false); + } + + /** + * Return hook ID from name + */ + public static function getNameById($hook_id) + { + $cache_id = 'hook_namebyid_'.$hook_id; + if (!Cache::isStored($cache_id)) + Cache::store($cache_id, Db::getInstance()->getValue(' + SELECT `name` + FROM `'._DB_PREFIX_.'hook` + WHERE `id_hook` = '.(int)$hook_id) + ); return Cache::retrieve($cache_id); } + + /** + * Return hook live edit bool from ID + */ + public static function getLiveEditById($hook_id) + { + $cache_id = 'hook_live_editbyid_'.$hook_id; + if (!Cache::isStored($cache_id)) + Cache::store($cache_id, Db::getInstance()->getValue(' + SELECT `live_edit` + FROM `'._DB_PREFIX_.'hook` + WHERE `id_hook` = '.(int)$hook_id) + ); + return Cache::retrieve($cache_id); + } /** * Get list of hook alias @@ -274,8 +313,9 @@ class HookCore extends ObjectModel // For payment modules, we check that they are available in the contextual country elseif ($frontend) { + $sql->where(Module::getPaypalIgnore()); if (Validate::isLoadedObject($context->country)) - $sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' LIMIT 1) = '.(int)$context->country->id.')'); + $sql->where('(h.name = "displayPayment" AND (SELECT id_country FROM '._DB_PREFIX_.'module_country mc WHERE mc.id_module = m.id_module AND id_country = '.(int)$context->country->id.' AND id_shop = '.(int)$context->shop->id.' LIMIT 1) = '.(int)$context->country->id.')'); if (Validate::isLoadedObject($context->currency)) $sql->where('(h.name = "displayPayment" AND (SELECT id_currency FROM '._DB_PREFIX_.'module_currency mcr WHERE mcr.id_module = m.id_module AND id_currency IN ('.(int)$context->currency->id.', -2) LIMIT 1) IN ('.(int)$context->currency->id.', -2))'); } @@ -291,23 +331,10 @@ class HookCore extends ObjectModel $sql->orderBy('hm.`position`'); - // Store results per hook name - $results = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); $list = array(); - - // Get all available payment module - $payment_modules = array(); - - if (isset($context->shop->id)) - foreach (Module::getPaymentModules() as $module) - $payment_modules[] = $module['name']; - - if ($results) - foreach ($results as $row) + if ($result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql)) + foreach ($result as $row) { - if ($row['hook'] == 'displayPayment' && !in_array($row['module'], $payment_modules)) - continue; - $row['hook'] = strtolower($row['hook']); if (!isset($list[$row['hook']])) $list[$row['hook']] = array(); @@ -336,14 +363,17 @@ class HookCore extends ObjectModel $hook_name = strtolower($hook_name); $return = array(); + $inserted_modules = array(); if (isset($list[$hook_name])) $return = $list[$hook_name]; + foreach ($return as $module) + $inserted_modules[] = $module['id_module']; if (isset($list[$retro_hook_name])) - $return = array_merge($return, $list[$retro_hook_name]); + foreach ($list[$retro_hook_name] as $retro_module_call) + if (!in_array($retro_module_call['id_module'], $inserted_modules)) + $return[] = $retro_module_call; - if (count($return) > 0) - return $return; - return false; + return (count($return) > 0 ? $return : false); } else return $list; @@ -387,6 +417,7 @@ class HookCore extends ObjectModel // Look on modules list $altern = 0; $output = ''; + foreach ($module_list as $array) { // Check errors @@ -399,7 +430,17 @@ class HookCore extends ObjectModel if ($check_exceptions) { $exceptions = $moduleInstance->getExceptions($array['id_hook']); - if (in_array(Dispatcher::getInstance()->getController(), $exceptions)) + $controller = Dispatcher::getInstance()->getController(); + + if (in_array($controller, $exceptions)) + continue; + + //retro compat of controller names + $matching_name = array( + 'authentication' => 'auth', + 'compare' => 'products-comparison', + ); + if (isset($matching_name[$controller]) && in_array($matching_name[$controller], $exceptions)) continue; if (Validate::isLoadedObject($context->employee) && !$moduleInstance->getPermission('view', $context->employee)) continue; @@ -418,7 +459,7 @@ class HookCore extends ObjectModel else if ($hook_retro_callable) $display = $moduleInstance->{'hook'.$retro_hook_name}($hook_args); // Live edit - if ($array_return && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad') && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee'))) + if (!$array_return && $array['live_edit'] && Tools::isSubmit('live_edit') && Tools::getValue('ad') && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee'))) { $live_edit = true; $output .= self::wrapLiveEdit($display, $moduleInstance, $array['id_hook']); @@ -432,7 +473,7 @@ class HookCore extends ObjectModel if ($array_return) return $output; else - return ($live_edit ? ' + return ($live_edit ? '
        ' : '').$output.($live_edit ? '
        ' : '');// Return html string } @@ -441,13 +482,13 @@ class HookCore extends ObjectModel return '
        - - ' + + ' .Tools::safeOutput($moduleInstance->displayName).' - + '.$display.'
        '; } diff --git a/classes/Image.php b/classes/Image.php index 0f56d1295..f2b749bf1 100644 --- a/classes/Image.php +++ b/classes/Image.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -367,6 +367,18 @@ class ImageCore extends ObjectModel '); return self::$_cacheGetSize[$type]; } + + public static function getWidth($params, &$smarty) + { + $result = self::getSize($params['type']); + return $result['width']; + } + + public static function getHeight($params, &$smarty) + { + $result = self::getSize($params['type']); + return $result['height']; + } /** * Clear all images in tmp dir @@ -409,9 +421,8 @@ class ImageCore extends ObjectModel // Delete auto-generated images $image_types = ImageType::getImagesTypes(); foreach ($image_types as $image_type) - { $files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-'.$image_type['name'].'.'.$this->image_format; - } + // Delete watermark image $files_to_delete[] = $this->image_dir.$this->getExistingImgPath().'-watermark.'.$this->image_format; // delete index.php @@ -533,11 +544,11 @@ class ImageCore extends ObjectModel if (!file_exists(_PS_PROD_IMG_DIR_.$this->getImgFolder())) { // Apparently sometimes mkdir cannot set the rights, and sometimes chmod can't. Trying both. - $success = @mkdir(_PS_PROD_IMG_DIR_.$this->getImgFolder(), self::$access_rights, true) - || @chmod(_PS_PROD_IMG_DIR_.$this->getImgFolder(), self::$access_rights); + $success = @mkdir(_PS_PROD_IMG_DIR_.$this->getImgFolder(), self::$access_rights, true); + $chmod = @chmod(_PS_PROD_IMG_DIR_.$this->getImgFolder(), self::$access_rights); // Create an index.php file in the new folder - if ($success + if (($success || $chmod) && !file_exists(_PS_PROD_IMG_DIR_.$this->getImgFolder().'index.php') && file_exists($this->source_index)) return @copy($this->source_index, _PS_PROD_IMG_DIR_.$this->getImgFolder().'index.php'); diff --git a/classes/ImageManager.php b/classes/ImageManager.php index 8ddb8e811..c7500c8fd 100644 --- a/classes/ImageManager.php +++ b/classes/ImageManager.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -119,6 +119,11 @@ class ImageManagerCore */ public static function resize($src_file, $dst_file, $dst_width = null, $dst_height = null, $file_type = 'jpg', $force_type = false) { + if (PHP_VERSION_ID < 50300) + clearstatcache(); + else + clearstatcache(true, $src_file); + if (!file_exists($src_file) || !filesize($src_file)) return false; list($src_width, $src_height, $type) = getimagesize($src_file); @@ -163,6 +168,9 @@ class ImageManagerCore } } + if (!ImageManager::checkImageMemoryLimit($src_file)) + return false; + $dest_image = imagecreatetruecolor($dst_width, $dst_height); // If image is a PNG and the output is PNG, fill with transparency. Else fill with white background. @@ -262,11 +270,7 @@ class ImageManagerCore public static function validateUpload($file, $max_file_size = 0) { if ((int)$max_file_size > 0 && $file['size'] > (int)$max_file_size) - return sprintf( - Tools::displayError('Image is too large (%1$d kB). Maximum allowed: %2$d kB'), - $file['size'] / 1000, - $max_file_size / 1000 - ); + return sprintf(Tools::displayError('Image is too large (%1$d kB). Maximum allowed: %2$d kB'), $file['size'] / 1024, $max_file_size / 1024); if (!ImageManager::isRealImage($file['tmp_name'], $file['type']) || !ImageManager::isCorrectImageFileExt($file['name'])) return Tools::displayError('Image format not recognized, allowed formats are: .gif, .jpg, .png'); if ($file['error']) @@ -410,4 +414,33 @@ class ImageManagerCore @chmod($filename, 0664); return $success; } + + /** + * Return the mime type by the file extension + * + * @param string $file_name + * @return string + */ + public static function getMimeTypeByExtension($file_name) + { + $types = array( + 'image/gif' => array('gif'), + 'image/jpeg' => array('jpg', 'jpeg'), + 'image/png' => array('png') + ); + $extension = substr($file_name, strrpos($file_name, '.') + 1); + + $mime_type = null; + foreach ($types as $mime => $exts) + if (in_array($extension, $exts)) + { + $mime_type = $mime; + break; + } + + if ($mime_type === null) + $mime_type = 'image/jpeg'; + + return $mime_type; + } } diff --git a/classes/ImageType.php b/classes/ImageType.php index 2c2d54e0c..8c4338cc1 100644 --- a/classes/ImageType.php +++ b/classes/ImageType.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -62,7 +62,7 @@ class ImageTypeCore extends ObjectModel 'table' => 'image_type', 'primary' => 'id_image_type', 'fields' => array( - 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isImageTypeName', 'required' => true, 'size' => 16), + 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isImageTypeName', 'required' => true, 'size' => 64), 'width' => array('type' => self::TYPE_INT, 'validate' => 'isImageSize', 'required' => true), 'height' => array('type' => self::TYPE_INT, 'validate' => 'isImageSize', 'required' => true), 'categories' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), @@ -78,6 +78,8 @@ class ImageTypeCore extends ObjectModel * @var array Image types cache */ protected static $images_types_cache = array(); + + protected static $images_types_name_cache = array(); protected $webserviceParameters = array(); @@ -87,20 +89,17 @@ class ImageTypeCore extends ObjectModel * @param string|null Image type * @return array Image type definitions */ - public static function getImagesTypes($type = null, $id_theme = false) + public static function getImagesTypes($type = null) { - if (!isset(self::$images_types_cache[$type.($id_theme ? '-'.$id_theme : '')])) + if (!isset(self::$images_types_cache[$type])) { $where = 'WHERE 1'; - if ($id_theme) - $where .= ' AND id_theme='.(int)$id_theme; if (!empty($type)) $where .= ' AND '.pSQL($type).' = 1 '; $query = 'SELECT * FROM `'._DB_PREFIX_.'image_type`'.$where.' ORDER BY `name` ASC'; self::$images_types_cache[$type] = Db::getInstance()->executeS($query); } - return self::$images_types_cache[$type]; } @@ -116,9 +115,9 @@ class ImageTypeCore extends ObjectModel die(Tools::displayError()); Db::getInstance()->executeS(' - SELECT `id_image_type` - FROM `'._DB_PREFIX_.'image_type` - WHERE `name` = \''.pSQL($typeName).'\''); + SELECT `id_image_type` + FROM `'._DB_PREFIX_.'image_type` + WHERE `name` = \''.pSQL($typeName).'\''); return Db::getInstance()->NumRows(); } @@ -128,9 +127,32 @@ class ImageTypeCore extends ObjectModel * @param string $name * @param string $type */ - public static function getByNameNType($name, $type) + public static function getByNameNType($name, $type = null) { - return Db::getInstance()->getRow('SELECT `id_image_type`, `name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`, `scenes` FROM `'._DB_PREFIX_.'image_type` WHERE `name` = \''.pSQL($name).'\' AND `'.pSQL($type).'` = 1'); + if (!isset(self::$images_types_name_cache[$name.'_'.$type])) + { + self::$images_types_name_cache[$name.'_'.$type] = Db::getInstance()->getRow(' + SELECT `id_image_type`, `name`, `width`, `height`, `products`, `categories`, `manufacturers`, `suppliers`, `scenes` + FROM `'._DB_PREFIX_.'image_type` + WHERE `name` = \''.pSQL($name).'\' '.(!is_null($type) ? 'AND `'.pSQL($type).'` = 1' : '')); + } + return self::$images_types_name_cache[$name.'_'.$type]; } + + public static function getFormatedName($name) + { + $theme_name = Context::getContext()->shop->theme_name; + $name_without_theme_name = str_replace(array('_'.$theme_name, $theme_name.'_'), '', $name); + //check if the theme name is already in $name if yes only return $name + if (strstr($name, $theme_name) && self::getByNameNType($name)) + return $name; + else if (self::getByNameNType($name_without_theme_name.'_'.$theme_name)) + return $name_without_theme_name.'_'.$theme_name; + else if (self::getByNameNType($theme_name.'_'.$name_without_theme_name)) + return $theme_name.'_'.$name_without_theme_name; + else + return $name_without_theme_name.'_default'; + } + } diff --git a/classes/Language.php b/classes/Language.php index 1a4c91a1e..0228a63ac 100644 --- a/classes/Language.php +++ b/classes/Language.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -190,19 +190,22 @@ class LanguageCore extends ObjectModel return $themes; } - public function add($autodate = true, $nullValues = false) + public function add($autodate = true, $nullValues = false, $only_add = false) { if (!parent::add($autodate)) return false; + if ($only_add) + return true; + // create empty files if they not exists $this->_generateFiles(); // @todo Since a lot of modules are not in right format with their primary keys name, just get true ... $resUpdateSQL = $this->loadUpdateSQL(); $resUpdateSQL = true; - - return $resUpdateSQL && Tools::generateHtaccess(); + Tools::generateHtaccess(); + return $resUpdateSQL; } public function toggleStatus() @@ -259,7 +262,7 @@ class LanguageCore extends ObjectModel $mPath_to = _PS_MAIL_DIR_.(string)$iso_to.'/'; } - $lFiles = array('admin.php', 'errors.php', 'fields.php', 'pdf.php', 'tabs.php', 'index.php'); + $lFiles = array('admin.php', 'errors.php', 'fields.php', 'pdf.php', 'tabs.php'); // Added natives mails files $mFiles = array( @@ -270,7 +273,7 @@ class LanguageCore extends ObjectModel 'contact.html', 'contact.txt', 'contact_form.html', 'contact_form.txt', 'credit_slip.html', 'credit_slip.txt', - 'download_product.html', 'download_product.txt', 'download-product.tpl', + 'download_product.html', 'download_product.txt', 'employee_password.html', 'employee_password.txt', 'forward_msg.html', 'forward_msg.txt', 'guest_to_customer.html', 'guest_to_customer.txt', @@ -294,7 +297,7 @@ class LanguageCore extends ObjectModel 'test.html', 'test.txt', 'voucher.html', 'voucher.txt', 'voucher_new.html', 'voucher_new.txt', - 'order_changed.html', 'order_changed.txt', 'index.php' + 'order_changed.html', 'order_changed.txt' ); $number = -1; @@ -463,7 +466,7 @@ class LanguageCore extends ObjectModel public function delete() { - if (!$this->hasMultishopEntries()) + if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) { if (empty($this->iso_code)) $this->iso_code = Language::getIsoById($this->id); @@ -511,16 +514,16 @@ class LanguageCore extends ObjectModel if (!parent::delete()) return false; - if (!$this->hasMultishopEntries()) + if (!$this->hasMultishopEntries() || Shop::getContext() == Shop::CONTEXT_ALL) { // delete images $files_copy = array( '/en.jpg', - '/en-default-thickbox_default.jpg', - '/en-default-home_default.jpg', - '/en-default-large_default.jpg', - '/en-default-medium_default.jpg', - '/en-default-small_default.jpg' + '/en-default-'.ImageType::getFormatedName('thickbox').'.jpg', + '/en-default-'.ImageType::getFormatedName('home').'.jpg', + '/en-default-'.ImageType::getFormatedName('large').'.jpg', + '/en-default-'.ImageType::getFormatedName('medium').'.jpg', + '/en-default-'.ImageType::getFormatedName('small').'.jpg' ); $tos = array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_); foreach ($tos as $to) @@ -577,7 +580,7 @@ class LanguageCore extends ObjectModel public static function getLanguage($id_lang) { - if (!array_key_exists((int)($id_lang), self::$_LANGUAGES)) + if (!array_key_exists((int)$id_lang, self::$_LANGUAGES)) return false; return self::$_LANGUAGES[(int)($id_lang)]; } @@ -681,66 +684,64 @@ class LanguageCore extends ObjectModel return Tools::generateHtaccess(); } - public static function checkAndAddLanguage($iso_code) + public static function checkAndAddLanguage($iso_code, $lang_pack = false, $only_add = false, $params_lang = null) { if (Language::getIdByIso($iso_code)) return true; - else + + $lang = new Language(); + $lang->iso_code = $iso_code; + $lang->active = true; + + if (!$lang_pack) + $lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code)); + + if ($lang_pack) { - if (@fsockopen('www.prestashop.com', 80)) + if (isset($lang_pack->name) + && isset($lang_pack->version) + && isset($lang_pack->iso_code)) + $lang->name = $lang_pack->name; + } + elseif ($params_lang !== null && is_array($params_lang)) + foreach ($params_lang as $key => $value) + $lang->$key = $value; + else + return false; + + if (!$lang->add(true, false, $only_add)) + return false; + + $flag = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg'); + if ($flag != null && !preg_match('//', $flag)) + { + $file = fopen(dirname(__FILE__).'/../img/l/'.(int)$lang->id.'.jpg', 'w'); + if ($file) { - $lang = new Language(); - $lang->iso_code = $iso_code; - $lang->active = true; - - if ($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$iso_code))) - { - if (isset($lang_pack->name) - && isset($lang_pack->version) - && isset($lang_pack->iso_code)) - $lang->name = $lang_pack->name; - } - if (!$lang->name || !$lang->add()) - return false; - $insert_id = (int)$lang->id; - - if ($lang_pack) - { - $flag = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/flags/jpeg/'.$iso_code.'.jpg'); - if ($flag != null && !preg_match('//', $flag)) - { - $file = fopen(dirname(__FILE__).'/../img/l/'.$insert_id.'.jpg', 'w'); - if ($file) - { - fwrite($file, $flag); - fclose($file); - } - else - Language::_copyNoneFlag($insert_id); - } - else - Language::_copyNoneFlag($insert_id); - } - else - Language::_copyNoneFlag($insert_id); - - $files_copy = array( - '/en.jpg', - '/en-default-thickbox_default.jpg', - '/en-default-home_default.jpg', - '/en-default-large_default.jpg', - '/en-default-medium_default.jpg', - '/en-default-small_default.jpg', - '/en-default-scene_default.jpg' - ); - foreach (array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_) as $to) - foreach ($files_copy as $file) - @copy(dirname(__FILE__).'/../img/l'.$file, $to.str_replace('/en', '/'.$iso_code, $file)); - return true; + fwrite($file, $flag); + fclose($file); } else - return false; + Language::_copyNoneFlag((int)$lang->id); } + else + Language::_copyNoneFlag((int)$lang->id); + + $files_copy = array( + '/en.jpg', + '/en-default-'.ImageType::getFormatedName('thickbox').'.jpg', + '/en-default-'.ImageType::getFormatedName('home').'.jpg', + '/en-default-'.ImageType::getFormatedName('large').'.jpg', + '/en-default-'.ImageType::getFormatedName('medium').'.jpg', + '/en-default-'.ImageType::getFormatedName('small').'.jpg', + '/en-default-'.ImageType::getFormatedName('scene').'.jpg' + ); + + foreach (array(_PS_CAT_IMG_DIR_, _PS_MANU_IMG_DIR_, _PS_PROD_IMG_DIR_, _PS_SUPP_IMG_DIR_) as $to) + foreach ($files_copy as $file) + @copy(dirname(__FILE__).'/../img/l'.$file, $to.str_replace('/en', '/'.$iso_code, $file)); + + return true; } protected static function _copyNoneFlag($id) @@ -772,6 +773,52 @@ class LanguageCore extends ObjectModel return self::$countActiveLanguages; } + public static function downloadAndInstallLanguagePack($iso, $version = null, $params = null) + { + require_once(_PS_TOOL_DIR_.'tar/Archive_Tar.php'); + + if (!Validate::isLanguageIsoCode($iso)) + return false; + + if ($version == null) + $version = _PS_VERSION_; + $lang_pack = false; + $lang_pack_ok = false; + $errors = array(); + $file = _PS_TRANSLATIONS_DIR_.$iso.'.gzip'; + if (!$lang_pack_link = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.$version.'&iso_lang='.Tools::strtolower($iso))) + $errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.'); + elseif (!$lang_pack = Tools::jsonDecode($lang_pack_link)) + $errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.'); + elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.Tools::strtolower($lang_pack->iso_code.'.gzip'))) + if (!@file_put_contents($file, $content)) + $errors[] = Tools::displayError('Server does not have permissions for writing.'); + if (file_exists($file)) + { + $gz = new Archive_Tar($file, true); + $files_list = $gz->listContent(); + if (!$gz->extract(_PS_TRANSLATIONS_DIR_.'../', false)) + $errors[] = Tools::displayError('Cannot decompress the translation file for the following language: ').(string)$iso; + // Clear smarty modules cache + Tools::clearCache(); + if (!Language::checkAndAddLanguage((string)$iso, $lang_pack, false, $params)) + $errors[] = Tools::displayError('An error occurred while creating the language: ').(string)$iso; + else + { + // Reset cache + Language::loadLanguages(); + + AdminTranslationsController::checkAndAddMailsFiles($iso, $files_list); + AdminTranslationsController::addNewTabs($iso, $files_list); + } + @unlink($file); + } + else + $errors[] = Tools::displayError('No language pack is available for your version.'); + + return count($errors) ? $errors : true; + } + /** * Check if more on than one language is activated * @@ -782,4 +829,4 @@ class LanguageCore extends ObjectModel { return (Language::countActiveLanguages() > 1); } -} +} \ No newline at end of file diff --git a/classes/Link.php b/classes/Link.php index 1671cbc76..e5019b07a 100644 --- a/classes/Link.php +++ b/classes/Link.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -35,6 +35,8 @@ class LinkCore public $protocol_content; protected $ssl_enable; + + protected static $category_disable_rewrite = null; /** * Constructor (initialization only) @@ -50,6 +52,9 @@ class LinkCore define('_PS_BASE_URL_', Tools::getShopDomain(true)); if (!defined('_PS_BASE_URL_SSL_')) define('_PS_BASE_URL_SSL_', Tools::getShopDomainSsl(true)); + + if (Link::$category_disable_rewrite === null) + Link::$category_disable_rewrite = array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY')); $this->ssl_enable = Configuration::get('PS_SSL_ENABLED'); } @@ -86,7 +91,7 @@ class LinkCore if (!$id_lang) $id_lang = Context::getContext()->language->id; - if (!$id_shop) + if ($id_shop === null) $shop = Context::getContext()->shop; else $shop = new Shop($id_shop); @@ -96,9 +101,9 @@ class LinkCore if (!is_object($product)) { if (is_array($product) && isset($product['id_product'])) - $product = new Product($product['id_product'], false, $id_lang); - else if (is_numeric($product) || !$product) - $product = new Product($product, false, $id_lang); + $product = new Product($product['id_product'], false, $id_lang); + elseif ((int)$product) + $product = new Product((int)$product, false, $id_lang); else throw new PrestaShopException('Invalid product vars'); } @@ -107,37 +112,41 @@ class LinkCore $params = array(); $params['id'] = $product->id; $params['rewrite'] = (!$alias) ? $product->getFieldByLang('link_rewrite') : $alias; + $params['ean13'] = (!$ean13) ? $product->ean13 : $ean13; $params['meta_keywords'] = Tools::str2url($product->getFieldByLang('meta_keywords')); $params['meta_title'] = Tools::str2url($product->getFieldByLang('meta_title')); - if ($dispatcher->hasKeyword('product_rule', $id_lang, 'manufacturer')) + if ($dispatcher->hasKeyword('product_rule', $id_lang, 'manufacturer', $id_shop)) $params['manufacturer'] = Tools::str2url($product->isFullyLoaded ? $product->manufacturer_name : Manufacturer::getNameById($product->id_manufacturer)); - if ($dispatcher->hasKeyword('product_rule', $id_lang, 'supplier')) + if ($dispatcher->hasKeyword('product_rule', $id_lang, 'supplier', $id_shop)) $params['supplier'] = Tools::str2url($product->isFullyLoaded ? $product->supplier_name : Supplier::getNameById($product->id_supplier)); - if ($dispatcher->hasKeyword('product_rule', $id_lang, 'price')) + if ($dispatcher->hasKeyword('product_rule', $id_lang, 'price', $id_shop)) $params['price'] = $product->isFullyLoaded ? $product->price : Product::getPriceStatic($product->id, false, null, 6, null, false, true, 1, false, null, null, null, $product->specificPrice); - if ($dispatcher->hasKeyword('product_rule', $id_lang, 'tags')) + if ($dispatcher->hasKeyword('product_rule', $id_lang, 'tags', $id_shop)) $params['tags'] = Tools::str2url($product->getTags($id_lang)); - if ($dispatcher->hasKeyword('product_rule', $id_lang, 'reference')) + if ($dispatcher->hasKeyword('product_rule', $id_lang, 'category', $id_shop)) + $params['category'] = (!is_null($product->category) && !empty($product->category)) ? Tools::str2url($product->category) : Tools::str2url($category); + + if ($dispatcher->hasKeyword('product_rule', $id_lang, 'reference', $id_shop)) $params['reference'] = Tools::str2url($product->reference); - if ($dispatcher->hasKeyword('product_rule', $id_lang, 'categories')) + if ($dispatcher->hasKeyword('product_rule', $id_lang, 'categories', $id_shop)) { $params['category'] = (!$category) ? $product->category : $category; $cats = array(); foreach ($product->getParentCategories() as $cat) - if (!in_array($cat['id_category'], array(1, 2)))//remove root and home category from the URL + if (!in_array($cat['id_category'], Link::$category_disable_rewrite))//remove root and home category from the URL $cats[] = $cat['link_rewrite']; $params['categories'] = implode('/', $cats); } $anchor = $ipa ? $product->getAnchor($ipa) : ''; - return $url.$dispatcher->createUrl('product_rule', $id_lang, $params, $force_routes, $anchor); + return $url.$dispatcher->createUrl('product_rule', $id_lang, $params, $force_routes, $anchor, $id_shop); } /** @@ -149,11 +158,16 @@ class LinkCore * @param string $selected_filters Url parameter to autocheck filters of the module blocklayered * @return string */ - public function getCategoryLink($category, $alias = null, $id_lang = null, $selected_filters = null) + public function getCategoryLink($category, $alias = null, $id_lang = null, $selected_filters = null, $id_shop = null) { if (!$id_lang) $id_lang = Context::getContext()->language->id; - $url = _PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink($id_lang); + + if ($id_shop === null) + $shop = Context::getContext()->shop; + else + $shop = new Shop($id_shop); + $url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang); if (!is_object($category)) $category = new Category($category, $id_lang); @@ -166,7 +180,7 @@ class LinkCore $params['meta_title'] = Tools::str2url($category->meta_title); // Selected filters is used by the module blocklayered - $selected_filters = is_null($selected_filters) ? Tools::getValue('selected_filters') : $selected_filters; + $selected_filters = is_null($selected_filters) ? '' : $selected_filters; if (empty($selected_filters)) $rule = 'category_rule'; @@ -176,7 +190,7 @@ class LinkCore $params['selected_filters'] = $selected_filters; } - return $url.Dispatcher::getInstance()->createUrl($rule, $id_lang, $params, $this->allow); + return $url.Dispatcher::getInstance()->createUrl($rule, $id_lang, $params, $this->allow, '', $id_shop); } /** @@ -187,23 +201,33 @@ class LinkCore * @param int $id_lang * @return string */ - public function getCMSCategoryLink($category, $alias = null, $id_lang = null) + public function getCMSCategoryLink($cms_category, $alias = null, $id_lang = null, $id_shop = null) { if (!$id_lang) $id_lang = Context::getContext()->language->id; - $url = _PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink($id_lang); - if (!is_object($category)) - $category = new CMSCategory($category, $id_lang); + if ($id_shop === null) + $shop = Context::getContext()->shop; + else + $shop = new Shop($id_shop); + $url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang); + + $dispatcher = Dispatcher::getInstance(); + if (!is_object($cms_category)) + { + if ($alias !== null && !$dispatcher->hasKeyword('cms_category_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('cms_category_rule', $id_lang, 'meta_title', $id_shop)) + return $url.$dispatcher->createUrl('cms_category_rule', $id_lang, array('id' => (int)$cms_category, 'rewrite' => (string)$alias), $this->allow, '', $id_shop); + $cms_category = new CMSCategory($cms_category, $id_lang); + } // Set available keywords $params = array(); - $params['id'] = $category->id; - $params['rewrite'] = (!$alias) ? $category->link_rewrite : $alias; - $params['meta_keywords'] = Tools::str2url($category->meta_keywords); - $params['meta_title'] = Tools::str2url($category->meta_title); + $params['id'] = $cms_category->id; + $params['rewrite'] = (!$alias) ? $cms_category->link_rewrite : $alias; + $params['meta_keywords'] = Tools::str2url($cms_category->meta_keywords); + $params['meta_title'] = Tools::str2url($cms_category->meta_title); - return $url.Dispatcher::getInstance()->createUrl('cms_category_rule', $id_lang, $params, $this->allow); + return $url.$dispatcher->createUrl('cms_category_rule', $id_lang, $params, $this->allow, '', $id_shop); } /** @@ -215,33 +239,42 @@ class LinkCore * @param int $id_lang * @return string */ - public function getCMSLink($cms, $alias = null, $ssl = false, $id_lang = null) + public function getCMSLink($cms, $alias = null, $ssl = false, $id_lang = null, $id_shop = null) { - $base = (($ssl && $this->ssl_enable) ? _PS_BASE_URL_SSL_ : _PS_BASE_URL_); + $base = (($ssl && $this->ssl_enable) ? 'https://' : 'http://'); if (!$id_lang) $id_lang = Context::getContext()->language->id; - $url = $base.__PS_BASE_URI__.$this->getLangLink($id_lang); + + if ($id_shop === null) + $shop = Context::getContext()->shop; + else + $shop = new Shop($id_shop); + $url = $base.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang); + + $dispatcher = Dispatcher::getInstance(); if (!is_object($cms)) + { + if ($alias !== null && !$dispatcher->hasKeyword('cms_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('cms_rule', $id_lang, 'meta_title', $id_shop)) + return $url.$dispatcher->createUrl('cms_rule', $id_lang, array('id' => (int)$cms, 'rewrite' => (string)$alias), $this->allow, '', $id_shop); $cms = new CMS($cms, $id_lang); + } // Set available keywords $params = array(); $params['id'] = $cms->id; $params['rewrite'] = (!$alias) ? (is_array($cms->link_rewrite) ? $cms->link_rewrite[(int)$id_lang] : $cms->link_rewrite) : $alias; + $params['meta_keywords'] = ''; if (isset($cms->meta_keywords) && !empty($cms->meta_keywords)) $params['meta_keywords'] = is_array($cms->meta_keywords) ? Tools::str2url($cms->meta_keywords[(int)$id_lang]) : Tools::str2url($cms->meta_keywords); - else - $params['meta_keywords'] = ''; + $params['meta_title'] = ''; if (isset($cms->meta_title) && !empty($cms->meta_title)) $params['meta_title'] = is_array($cms->meta_title) ? Tools::str2url($cms->meta_title[(int)$id_lang]) : Tools::str2url($cms->meta_title); - else - $params['meta_title'] = ''; - return $url.Dispatcher::getInstance()->createUrl('cms_rule', $id_lang, $params, $this->allow); + return $url.$dispatcher->createUrl('cms_rule', $id_lang, $params, $this->allow, '', $id_shop); } /** @@ -252,14 +285,24 @@ class LinkCore * @param int $id_lang * @return string */ - public function getSupplierLink($supplier, $alias = null, $id_lang = null) + public function getSupplierLink($supplier, $alias = null, $id_lang = null, $id_shop = null) { if (!$id_lang) $id_lang = Context::getContext()->language->id; - $url = _PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink($id_lang); + if ($id_shop === null) + $shop = Context::getContext()->shop; + else + $shop = new Shop($id_shop); + $url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang); + + $dispatcher = Dispatcher::getInstance(); if (!is_object($supplier)) + { + if ($alias !== null && !$dispatcher->hasKeyword('supplier_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('supplier_rule', $id_lang, 'meta_title', $id_shop)) + return $url.$dispatcher->createUrl('supplier_rule', $id_lang, array('id' => (int)$supplier, 'rewrite' => (string)$alias), $this->allow, '', $id_shop); $supplier = new Supplier($supplier, $id_lang); + } // Set available keywords $params = array(); @@ -268,7 +311,7 @@ class LinkCore $params['meta_keywords'] = Tools::str2url($supplier->meta_keywords); $params['meta_title'] = Tools::str2url($supplier->meta_title); - return $url.Dispatcher::getInstance()->createUrl('supplier_rule', $id_lang, $params, $this->allow); + return $url.$dispatcher->createUrl('supplier_rule', $id_lang, $params, $this->allow, '', $id_shop); } /** @@ -279,14 +322,24 @@ class LinkCore * @param int $id_lang * @return string */ - public function getManufacturerLink($manufacturer, $alias = null, $id_lang = null) + public function getManufacturerLink($manufacturer, $alias = null, $id_lang = null, $id_shop = null) { if (!$id_lang) $id_lang = Context::getContext()->language->id; - $url = _PS_BASE_URL_.__PS_BASE_URI__.$this->getLangLink($id_lang); + if ($id_shop === null) + $shop = Context::getContext()->shop; + else + $shop = new Shop($id_shop); + $url = 'http://'.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang); + + $dispatcher = Dispatcher::getInstance(); if (!is_object($manufacturer)) + { + if ($alias !== null && !$dispatcher->hasKeyword('manufacturer_rule', $id_lang, 'meta_keywords', $id_shop) && !$dispatcher->hasKeyword('manufacturer_rule', $id_lang, 'meta_title', $id_shop)) + return $url.$dispatcher->createUrl('manufacturer_rule', $id_lang, array('id' => (int)$manufacturer, 'rewrite' => (string)$alias), $this->allow, '', $id_shop); $manufacturer = new Manufacturer($manufacturer, $id_lang); + } // Set available keywords $params = array(); @@ -295,7 +348,7 @@ class LinkCore $params['meta_keywords'] = Tools::str2url($manufacturer->meta_keywords); $params['meta_title'] = Tools::str2url($manufacturer->meta_title); - return $url.Dispatcher::getInstance()->createUrl('manufacturer_rule', $id_lang, $params, $this->allow); + return $url.$dispatcher->createUrl('manufacturer_rule', $id_lang, $params, $this->allow, '', $id_shop); } /** @@ -307,23 +360,28 @@ class LinkCore * @param int $id_lang * @return string */ - public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = false, $id_lang = null) + public function getModuleLink($module, $controller = 'default', array $params = array(), $ssl = false, $id_lang = null, $id_shop = null) { - $base = (($ssl && $this->ssl_enable) ? _PS_BASE_URL_SSL_ : _PS_BASE_URL_); + $base = (($ssl && $this->ssl_enable) ? 'https://' : 'http://'); if (!$id_lang) $id_lang = Context::getContext()->language->id; - $url = $base.__PS_BASE_URI__.$this->getLangLink($id_lang); + + if ($id_shop === null) + $shop = Context::getContext()->shop; + else + $shop = new Shop($id_shop); + $url = $base.$shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang); // Set available keywords $params['module'] = $module; $params['controller'] = $controller ? $controller : 'default'; // If the module has its own route ... just use it ! - if (Dispatcher::getInstance()->hasRoute('module-'.$module.'-'.$controller, $id_lang)) + if (Dispatcher::getInstance()->hasRoute('module-'.$module.'-'.$controller, $id_lang, $id_shop)) return $this->getPageLink('module-'.$module.'-'.$controller, $ssl, $id_lang, $params); else - return $url.Dispatcher::getInstance()->createUrl('module', $id_lang, $params, $this->allow); + return $url.Dispatcher::getInstance()->createUrl('module', $id_lang, $params, $this->allow, '', $id_shop); } /** @@ -394,7 +452,7 @@ class LinkCore * * @return string Page link */ - public function getPageLink($controller, $ssl = false, $id_lang = null, $request = null, $request_url_encode = false) + public function getPageLink($controller, $ssl = false, $id_lang = null, $request = null, $request_url_encode = false, $id_shop = null) { $controller = Tools::strReplaceFirst('.php', '', $controller); @@ -410,16 +468,24 @@ class LinkCore parse_str($request, $request); } - $uri_path = Dispatcher::getInstance()->createUrl($controller, $id_lang, $request); - $url = ($ssl && $this->ssl_enable) ? Tools::getShopDomainSsl(true) : Tools::getShopDomain(true); - $url .= __PS_BASE_URI__.$this->getLangLink($id_lang).ltrim($uri_path, '/'); + if ($id_shop === null) + $shop = Context::getContext()->shop; + else + $shop = new Shop($id_shop); + + $uri_path = Dispatcher::getInstance()->createUrl($controller, $id_lang, $request, false, '', $id_shop); + $url = ($ssl && $this->ssl_enable) ? 'https://' : 'http://'; + $url .= $shop->domain.$shop->getBaseURI().$this->getLangLink($id_lang).ltrim($uri_path, '/'); return $url; } public function getCatImageLink($name, $id_category, $type = null) { - $uri_path = ($this->allow == 1) ? (__PS_BASE_URI__.'c/'.$id_category.($type ? '-'.$type : '').'/'.$name.'.jpg') : (_THEME_CAT_DIR_.$id_category.($type ? '-'.$type : '').'.jpg'); + if($this->allow == 1 && $type) + $uri_path = __PS_BASE_URI__.'c/'.$id_category.'-'.$type.'/'.$name.'.jpg'; + else + $uri_path = _THEME_CAT_DIR_.$id_category.($type ? '-'.$type : '').'.jpg'; return $this->protocol_content.Tools::getMediaServer($uri_path).$uri_path; } @@ -532,7 +598,11 @@ class LinkCore } if (!$array) - return $url.(($this->allow == 1 || $url == $this->url) ? '?' : '&').http_build_query($vars, '', '&'); + if (count($vars)) + return $url.(($this->allow == 1 || $url == $this->url) ? '?' : '&').http_build_query($vars, '', '&'); + else + return $url; + $vars['requestUrl'] = $url; if ($type && $id_object) diff --git a/classes/LocalizationPack.php b/classes/LocalizationPack.php index 24a94e56f..bfa03e301 100644 --- a/classes/LocalizationPack.php +++ b/classes/LocalizationPack.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* @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 */ @@ -51,7 +51,6 @@ class LocalizationPackCore $res &= $this->_installUnits($xml); $res &= $this->installConfiguration($xml); $res &= $this->installModules($xml); - $res &= $this->updateDefaultGroupDisplayMethod($xml); $res &= $this->_installLanguages($xml, $install_mode); if ($res && isset($this->iso_code_lang)) @@ -233,7 +232,7 @@ class LocalizationPackCore } } } - return true; + return $this->updateDefaultGroupDisplayMethod($xml); } protected function _installCurrencies($xml, $install_mode = false) @@ -292,59 +291,18 @@ class LocalizationPackCore foreach ($xml->languages->language as $data) { $attributes = $data->attributes(); - if (Language::getIdByIso($attributes['iso_code'])) - continue; - $native_lang = Language::getLanguages(); - $native_iso_code = array(); - foreach ($native_lang as $lang) - $native_iso_code[] = $lang['iso_code']; // if we are not in an installation context or if the pack is not available in the local directory - if (!$install_mode || !in_array((string)$attributes['iso_code'], $native_iso_code)) - { - $errno = 0; - $errstr = ''; - if (!@fsockopen('api.prestashop.com', 80, $errno, $errstr, 5)) - $this->_errors[] = Tools::displayError('Archive cannot be downloaded from prestashop.com.'); - elseif (!($lang_pack = Tools::jsonDecode(Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='._PS_VERSION_.'&iso_lang='.$attributes['iso_code'])))) - $this->_errors[] = Tools::displayError('Error occurred when language was checked according to your Prestashop version.'); - elseif ($content = Tools::file_get_contents('http://translations.prestashop.com/download/lang_packs/gzip/'.$lang_pack->version.'/'.$attributes['iso_code'].'.gzip')) - { - $file = _PS_TRANSLATIONS_DIR_.$attributes['iso_code'].'.gzip'; - if (file_put_contents($file, $content)) - { - $gz = new Archive_Tar($file, true); - $files_list = $gz->listContent(); - - if (!$gz->extract(_PS_TRANSLATIONS_DIR_.'../', false)) - { - $this->_errors[] = Tools::displayError('Cannot decompress the translation file for the following language: ').(string)$attributes['iso_code']; - return false; - } - else - { - AdminTranslationsController::checkAndAddMailsFiles($attributes['iso_code'], $files_list); - AdminTranslationsController::addNewTabs($attributes['iso_code'], $files_list); - } - - if (!Language::checkAndAddLanguage((string)$attributes['iso_code'])) - { - $this->_errors[] = Tools::displayError('An error occurred while creating the language: ').(string)$attributes['iso_code']; - return false; - } - - @unlink($file); - } - else - $this->_errors[] = Tools::displayError('Server does not have permissions for writing.'); - } - } + if (Language::getIdByIso($attributes['iso_code']) && !$install_mode) + continue; + $errors = Language::downloadAndInstallLanguagePack($attributes['iso_code'], $attributes['version'], $attributes); + if ($errors !== true && is_array($errors)) + $this->_errors = array_merge($this->_errors, $errors); } - // change the default language if there is only one language in the localization pack if (!count($this->_errors) && $install_mode && isset($attributes['iso_code']) && count($xml->languages->language) == 1) $this->iso_code_lang = $attributes['iso_code']; - return true; + return !count($this->_errors); } protected function _installUnits($xml) @@ -432,10 +390,13 @@ class LocalizationPackCore $attributes = $xml->group_default->attributes(); if (isset($attributes['price_display_method']) && in_array((int)$attributes['price_display_method'], array(0, 1))) { - $group = new Group((int)_PS_DEFAULT_CUSTOMER_GROUP_); - $group->price_display_method = (int)$attributes['price_display_method']; - if (!$group->save()) - $this->_errors[] = Tools::displayError('An error occurred during the default group update'); + foreach (array((int)Configuration::get('PS_CUSTOMER_GROUP'), (int)Configuration::get('PS_GUEST_GROUP'), (int)Configuration::get('PS_UNIDENTIFIED_GROUP')) as $id_group) + { + $group = new Group((int)$id_group); + $group->price_display_method = (int)$attributes['price_display_method']; + if (!$group->save()) + $this->_errors[] = Tools::displayError('An error occurred during the default group update'); + } } else $this->_errors[] = Tools::displayError('An error has occurred during the default group update'); diff --git a/classes/Logger.php b/classes/Logger.php index f5f6a0be1..0bc46bf16 100644 --- a/classes/Logger.php +++ b/classes/Logger.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -43,6 +43,9 @@ class LoggerCore extends ObjectModel /** @var integer Object ID */ public $object_id; + + /** @var integer Object ID */ + public $id_employee; /** @var string Object creation date */ public $date_add; @@ -61,6 +64,7 @@ class LoggerCore extends ObjectModel 'error_code' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage', 'required' => true), 'object_id' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), + 'id_employee' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'object_type' => array('type' => self::TYPE_STRING, 'validate' => 'isName'), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), @@ -98,7 +102,7 @@ class LoggerCore extends ObjectModel * @param boolean $allow_duplicate if set to true, can log several time the same information (not recommended) * @return boolean true if succeed */ - public static function addLog($message, $severity = 1, $error_code = null, $object_type = null, $object_id = null, $allow_duplicate = false) + public static function addLog($message, $severity = 1, $error_code = null, $object_type = null, $object_id = null, $allow_duplicate = false, $id_employee = null) { $log = new Logger(); $log->severity = intval($severity); @@ -106,6 +110,13 @@ class LoggerCore extends ObjectModel $log->message = pSQL($message); $log->date_add = date('Y-m-d H:i:s'); $log->date_upd = date('Y-m-d H:i:s'); + + if ($id_employee === null && isset(Context::getContext()->employee) && Validate::isLoadedObject(Context::getContext()->employee)) + $id_employee = Context::getContext()->employee->id; + + if ($id_employee !== null) + $log->id_employee = (int)$id_employee; + if (!empty($object_type) && !empty($object_id)) { $log->object_type = pSQL($object_type); diff --git a/classes/Mail.php b/classes/Mail.php index 5296db846..76a3de1d8 100644 --- a/classes/Mail.php +++ b/classes/Mail.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -54,6 +54,22 @@ class MailCore public static function Send($id_lang, $template, $subject, $template_vars, $to, $to_name = null, $from = null, $from_name = null, $file_attachment = null, $mode_smtp = null, $template_path = _PS_MAIL_DIR_, $die = false, $id_shop = null) { + $configuration = Configuration::getMultiple(array( + 'PS_SHOP_EMAIL', + 'PS_MAIL_METHOD', + 'PS_MAIL_SERVER', + 'PS_MAIL_USER', + 'PS_MAIL_PASSWD', + 'PS_SHOP_NAME', + 'PS_MAIL_SMTP_ENCRYPTION', + 'PS_MAIL_SMTP_PORT', + 'PS_MAIL_TYPE' + ), null, null, $id_shop); + + // Returns immediatly if emails are deactivated + if ($configuration['PS_MAIL_METHOD'] == 3) + return true; + $theme_path = _PS_THEME_DIR_; // Get the path of theme by id_shop if exist @@ -66,19 +82,6 @@ class MailCore $theme_path = _PS_ROOT_DIR_.'/themes/'.$theme_name.'/'; } - $configuration = Configuration::getMultiple(array( - 'PS_SHOP_EMAIL', - 'PS_MAIL_METHOD', - 'PS_MAIL_SERVER', - 'PS_MAIL_USER', - 'PS_MAIL_PASSWD', - 'PS_SHOP_NAME', - 'PS_MAIL_SMTP_ENCRYPTION', - 'PS_MAIL_SMTP_PORT', - 'PS_MAIL_METHOD', - 'PS_MAIL_TYPE' - )); - if (!isset($configuration['PS_MAIL_SMTP_ENCRYPTION'])) $configuration['PS_MAIL_SMTP_ENCRYPTION'] = 'off'; if (!isset($configuration['PS_MAIL_SMTP_PORT'])) @@ -179,7 +182,7 @@ class MailCore if (!$connection) return false; - $swift = new Swift($connection, Configuration::get('PS_MAIL_DOMAIN')); + $swift = new Swift($connection, Configuration::get('PS_MAIL_DOMAIN', null, null, $id_shop)); /* Get templates content */ $iso = Language::getIsoById((int)$id_lang); if (!$iso) @@ -193,49 +196,68 @@ class MailCore $override_mail = false; // get templatePath - if (preg_match('#'.__PS_BASE_URI__.'modules/#', $template_path) && preg_match('#modules/([a-z0-9_-]+)/#ui', $template_path, $res)) + if (preg_match('#'.__PS_BASE_URI__.'modules/#', str_replace(DIRECTORY_SEPARATOR, '/', $template_path)) && preg_match('#modules/([a-z0-9_-]+)/#ui', str_replace(DIRECTORY_SEPARATOR, '/',$template_path), $res)) $module_name = $res[1]; if ($module_name !== false && (file_exists($theme_path.'modules/'.$module_name.'/mails/'.$template.'.txt') || file_exists($theme_path.'modules/'.$module_name.'/mails/'.$template.'.html'))) $template_path = $theme_path.'modules/'.$module_name.'/mails/'; - else if (file_exists($theme_path.'mails/'.$template.'.txt') || file_exists($theme_path.'mails/'.$template.'.html')) + elseif (file_exists($theme_path.'mails/'.$template.'.txt') || file_exists($theme_path.'mails/'.$template.'.html')) { $template_path = $theme_path.'mails/'; $override_mail = true; } - else if (!file_exists($template_path.$template.'.txt') || !file_exists($template_path.$template.'.html')) + if (!file_exists($template_path.$template.'.txt') && ($configuration['PS_MAIL_TYPE'] == Mail::TYPE_BOTH || $configuration['PS_MAIL_TYPE'] == Mail::TYPE_TEXT)) { Tools::dieOrLog(Tools::displayError('Error - The following e-mail template is missing:').' '.$template_path.$template.'.txt', $die); return false; } + else if (!file_exists($template_path.$template.'.html') && ($configuration['PS_MAIL_TYPE'] == Mail::TYPE_BOTH || $configuration['PS_MAIL_TYPE'] == Mail::TYPE_HTML)) + { + Tools::dieOrLog(Tools::displayError('Error - The following e-mail template is missing:').' '.$template_path.$template.'.html', $die); + return false; + } $template_html = file_get_contents($template_path.$template.'.html'); $template_txt = strip_tags(html_entity_decode(file_get_contents($template_path.$template.'.txt'), null, 'utf-8')); if ($override_mail && file_exists($template_path.$iso.'/lang.php')) include_once($template_path.$iso.'/lang.php'); - else if ($module_name && file_exists($template_path.$iso.'/lang.php')) + else if ($module_name && file_exists($theme_path.'mails/'.$iso.'/lang.php')) include_once($theme_path.'mails/'.$iso.'/lang.php'); else - include_once(dirname(__FILE__).'/../mails/'.$iso.'/lang.php'); + include_once(_PS_MAIL_DIR_.$iso.'/lang.php'); /* Create mail and attach differents parts */ - $message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME').'] '.$subject); + $message = new Swift_Message('['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject); + + /* Set Message-ID - getmypid() is blocked on some hosting */ + $message->setId(Mail::generateId()); + $message->headers->setEncoding('Q'); - if (Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL'))) - $template_vars['{shop_logo}'] = $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL')))); + if (Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop))) + $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL', null, null, $id_shop); else - if (file_exists(_PS_IMG_DIR_.'logo.jpg')) - $template_vars['{shop_logo}'] = $message->attach(new Swift_Message_Image(new Swift_File(_PS_IMG_DIR_.Configuration::get('PS_LOGO')))); + { + if (file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop))) + $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, $id_shop); else $template_vars['{shop_logo}'] = ''; + } + ShopUrl::cacheMainDomainForShop((int)$id_shop); + /* don't attach the logo as */ + if (isset($logo)) + $template_vars['{shop_logo}'] = $message->attach(new Swift_Message_EmbeddedFile(new Swift_File($logo), null, ImageManager::getMimeTypeByExtension($logo))); - $template_vars['{shop_name}'] = Tools::safeOutput(Configuration::get('PS_SHOP_NAME')); - $template_vars['{shop_url}'] = Tools::getShopDomain(true, true).__PS_BASE_URI__.'index.php'; + if ((Context::getContext()->link instanceof Link) === false) + Context::getContext()->link = new Link(); + + $template_vars['{shop_name}'] = Tools::safeOutput(Configuration::get('PS_SHOP_NAME', null, null, $id_shop)); + $template_vars['{shop_url}'] = Context::getContext()->link->getPageLink('index', true, Context::getContext()->language->id); $template_vars['{my_account_url}'] = Context::getContext()->link->getPageLink('my-account', true, Context::getContext()->language->id); $template_vars['{guest_tracking_url}'] = Context::getContext()->link->getPageLink('guest-tracking', true, Context::getContext()->language->id); $template_vars['{history_url}'] = Context::getContext()->link->getPageLink('history', true, Context::getContext()->language->id); + $template_vars['{color}'] = Tools::safeOutput(Configuration::get('PS_MAIL_COLOR', null, null, $id_shop)); $swift->attachPlugin(new Swift_Plugin_Decorator(array($to_plugin => $template_vars)), 'decorator'); if ($configuration['PS_MAIL_TYPE'] == Mail::TYPE_BOTH || $configuration['PS_MAIL_TYPE'] == Mail::TYPE_TEXT) $message->attach(new Swift_Message_Part($template_txt, 'text/plain', '8bit', 'utf-8')); @@ -254,6 +276,9 @@ class MailCore /* Send mail */ $send = $swift->send($message, $to, new Swift_Address($from, $from_name)); $swift->disconnect(); + + ShopUrl::resetMainDomainCache(); + return $send; } catch (Swift_Exception $e) { @@ -334,4 +359,17 @@ class MailCore return str_replace('"', '"', stripslashes($str)); } + + /* Rewrite of Swift_Message::generateId() without getmypid() */ + protected static function generateId($idstring = null) + { + $midparams = array( + "utctime" => gmstrftime("%Y%m%d%H%M%S"), + "randint" => mt_rand(), + "customstr" => (preg_match("/^(? (isset($_SERVER["SERVER_NAME"]) ? $_SERVER["SERVER_NAME"] : php_uname("n")), + ); + return vsprintf("<%s.%d.%s@%s>", $midparams); + } + } diff --git a/classes/Manufacturer.php b/classes/Manufacturer.php index 5a688a0c6..8cc573bad 100644 --- a/classes/Manufacturer.php +++ b/classes/Manufacturer.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -78,8 +78,8 @@ class ManufacturerCore extends ObjectModel 'date_upd' => array('type' => self::TYPE_DATE), // Lang fields - 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString'), - 'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 254), + 'description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml'), + 'short_description' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isCleanHtml', 'size' => 254), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 128), 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName'), @@ -110,7 +110,7 @@ class ManufacturerCore extends ObjectModel { $address = new Address($this->id_address); - if (!$address->delete()) + if (Validate::isLoadedObject($address) AND !$address->delete()) return false; if (parent::delete()) @@ -198,6 +198,7 @@ class ManufacturerCore extends ObjectModel LEFT JOIN `'._DB_PREFIX_.'manufacturer` as m ON (m.`id_manufacturer`= p.`id_manufacturer`) WHERE m.`id_manufacturer` = '.(int)$manufacturer['id_manufacturer']. ($active ? ' AND product_shop.`active` = 1 ' : ''). + ' AND product_shop.`visibility` NOT IN ("none")'. ($all_group ? '' : ' AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg @@ -215,7 +216,7 @@ class ManufacturerCore extends ObjectModel for ($i = 0; $i < $total_manufacturers; $i++) if ($rewrite_settings) - $manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name'], false); + $manufacturers[$i]['link_rewrite'] = Tools::link_rewrite($manufacturers[$i]['name']); else $manufacturers[$i]['link_rewrite'] = 0; @@ -258,7 +259,7 @@ class ManufacturerCore extends ObjectModel public function getLink() { - return Tools::link_rewrite($this->name, false); + return Tools::link_rewrite($this->name); } public static function getProducts($id_manufacturer, $id_lang, $p, $n, $order_by = null, $order_way = null, @@ -316,13 +317,18 @@ class ManufacturerCore extends ObjectModel $alias = 'product_shop.'; elseif ($order_by == 'name') $alias = 'pl.'; + elseif ($order_by == 'manufacturer_name') + { + $order_by = 'name'; + $alias = 'm.'; + } elseif ($order_by == 'quantity') $alias = 'stock.'; else $alias = 'p.'; - $sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, pa.`id_product_attribute`, + $sql = 'SELECT p.*, product_shop.*, stock.out_of_stock, IFNULL(stock.quantity, 0) as quantity, MAX(product_attribute_shop.`id_product_attribute`) id_product_attribute, pl.`description`, pl.`description_short`, pl.`link_rewrite`, pl.`meta_description`, pl.`meta_keywords`, - pl.`meta_title`, pl.`name`, image_shop.`id_image`, il.`legend`, m.`name` AS manufacturer_name, + pl.`meta_title`, pl.`name`, MAX(image_shop.`id_image`) id_image, il.`legend`, m.`name` AS manufacturer_name, DATEDIFF( product_shop.`date_add`, DATE_SUB( @@ -334,7 +340,7 @@ class ManufacturerCore extends ObjectModel '.Shop::addSqlAssociation('product', 'p').' LEFT JOIN `'._DB_PREFIX_.'product_attribute` pa ON (p.`id_product` = pa.`id_product`) - '.Shop::addSqlAssociation('product_attribute', 'pa', false).' + '.Shop::addSqlAssociation('product_attribute', 'pa', false, 'product_attribute_shop.`default_on` = 1').' LEFT JOIN `'._DB_PREFIX_.'product_lang` pl ON (p.`id_product` = pl.`id_product` AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').') LEFT JOIN `'._DB_PREFIX_.'image` i @@ -348,7 +354,6 @@ class ManufacturerCore extends ObjectModel WHERE p.`id_manufacturer` = '.(int)$id_manufacturer.' '.($active ? ' AND product_shop.`active` = 1' : '').' '.($front ? ' AND product_shop.`visibility` IN ("both", "catalog")' : '').' - AND (product_attribute_shop.default_on = 1 OR product_attribute_shop.default_on IS NULL) AND p.`id_product` IN ( SELECT cp.`id_product` FROM `'._DB_PREFIX_.'category_group` cg @@ -357,8 +362,8 @@ class ManufacturerCore extends ObjectModel ($active_category ? ' INNER JOIN `'._DB_PREFIX_.'category` ca ON cp.`id_category` = ca.`id_category` AND ca.`active` = 1' : '').' WHERE cg.`id_group` '.$sql_groups.' ) - AND ((image_shop.id_image IS NOT NULL OR i.id_image IS NULL) OR (image_shop.id_image IS NULL AND i.cover=1)) - ORDER BY '.$alias.pSQL($order_by).' '.pSQL($order_way).' + GROUP BY product_shop.id_product + ORDER BY '.$alias.'`'.bqSQL($order_by).'` '.pSQL($order_way).' LIMIT '.(((int)$p - 1) * (int)$n).','.(int)$n; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($sql); diff --git a/classes/Media.php b/classes/Media.php index 8641821f0..31b960cf9 100755 --- a/classes/Media.php +++ b/classes/Media.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -30,36 +30,37 @@ class MediaCore 'ui.core' => array('fileName' => 'jquery.ui.core.min.js', 'dependencies' => array(), 'theme' => true), 'ui.widget' => array('fileName' => 'jquery.ui.widget.min.js', 'dependencies' => array(), 'theme' => false), 'ui.mouse' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => false), - 'ui.position' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array(), 'theme' => false), - 'ui.draggable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => false), - 'ui.droppable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('uicore', 'ui.widget', 'ui.mouse', 'ui.draggable'), 'theme' => false), - 'ui.resizable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.selectable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.sortable' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.accordion' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.autocomplete' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), - 'ui.button' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.dialog' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), - 'ui.slider' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), - 'ui.tabs' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'ui.datepicker' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core'), 'theme' => true), - 'ui.progressbar' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), - 'effects.core' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array(), 'theme' => false), - 'effects.blind' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.bounce' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.clip' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.drop' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.explode' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.fade' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.fold' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.highlight' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.pulsate' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.scale' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.shake' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.slide' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false), - 'effects.transfer' => array('fileName' => 'jquery.ui.mouse.min.js', 'dependencies' => array('effects.core'), 'theme' => false) + 'ui.position' => array('fileName' => 'jquery.ui.position.min.js', 'dependencies' => array(), 'theme' => false), + 'ui.draggable' => array('fileName' => 'jquery.ui.draggable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => false), + 'ui.droppable' => array('fileName' => 'jquery.ui.droppable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse', 'ui.draggable'), 'theme' => false), + 'ui.resizable' => array('fileName' => 'jquery.ui.resizable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.selectable' => array('fileName' => 'jquery.ui.selectable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.sortable' => array('fileName' => 'jquery.ui.sortable.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.accordion' => array('fileName' => 'jquery.ui.accordion.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.autocomplete' => array('fileName' => 'jquery.ui.autocomplete.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), + 'ui.button' => array('fileName' => 'jquery.ui.button.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.dialog' => array('fileName' => 'jquery.ui.dialog.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.position'), 'theme' => true), + 'ui.slider' => array('fileName' => 'jquery.ui.slider.min.js', 'dependencies' => array('ui.core', 'ui.widget', 'ui.mouse'), 'theme' => true), + 'ui.tabs' => array('fileName' => 'jquery.ui.tabs.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'ui.datepicker' => array('fileName' => 'jquery.ui.datepicker.min.js', 'dependencies' => array('ui.core'), 'theme' => true), + 'ui.progressbar' => array('fileName' => 'jquery.ui.progressbar.min.js', 'dependencies' => array('ui.core', 'ui.widget'), 'theme' => true), + 'effects.core' => array('fileName' => 'jquery.effects.core.min.js', 'dependencies' => array(), 'theme' => false), + 'effects.blind' => array('fileName' => 'jquery.effects.blind.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.bounce' => array('fileName' => 'jquery.effects.bounce.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.clip' => array('fileName' => 'jquery.effects.clip.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.drop' => array('fileName' => 'jquery.effects.drop.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.explode' => array('fileName' => 'jquery.effects.explode.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.fade' => array('fileName' => 'jquery.effects.fade.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.fold' => array('fileName' => 'jquery.effects.fold.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.highlight' => array('fileName' => 'jquery.effects.highlight.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.pulsate' => array('fileName' => 'jquery.effects.pulsate.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.scale' => array('fileName' => 'jquery.effects.scale.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.shake' => array('fileName' => 'jquery.effects.shake.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.slide' => array('fileName' => 'jquery.effects.slide.min.js', 'dependencies' => array('effects.core'), 'theme' => false), + 'effects.transfer' => array('fileName' => 'jquery.effects.transfer.min.js', 'dependencies' => array('effects.core'), 'theme' => false) ); + public static function minifyHTML($html_content) { if (strlen($html_content) > 0) @@ -68,30 +69,13 @@ class MediaCore $html_content = preg_replace_callback( '/(<[a-zA-Z0-9]+)((\s?[a-zA-Z0-9]+=[\"\\\'][^\"\\\']*[\"\\\']\s?)*)>/', array('Media', 'minifyHTMLpregCallback'), - $html_content); + $html_content, + Media::getBackTrackLimit()); require_once(_PS_TOOL_DIR_.'minify_html/minify_html.class.php'); $html_content = str_replace(chr(194).chr(160), ' ', $html_content); - $html_content = Minify_HTML::minify($html_content, array('xhtml', 'cssMinifier', 'jsMinifier')); - - if (Configuration::get('PS_HIGH_HTML_THEME_COMPRESSION')) - { - //$html_content = preg_replace('/"([^\>\s"]*)"/i', '$1', $html_content);//FIXME create a js bug - $html_content = preg_replace('/]*dtd\">/is', '', $html_content); - $html_content = preg_replace('/\s\>/is', '>', $html_content); - $html_content = str_replace('', '', $html_content); - $html_content = str_replace('', '', $html_content); - $html_content = str_replace('', '', $html_content); - $html_content = str_replace('', '', $html_content); - $html_content = str_replace('', '', $html_content); - $html_content = str_replace('', '', $html_content); - $html_content = str_replace('', '', $html_content); - //$html_content = str_replace('

        ', '', $html_content);//FIXME doesnt work... - $html_content = str_replace("\n", '', $html_content);//TODO with bellow - $html_content = str_replace('', '', $html_content); - $html_content = str_replace(' '; } @@ -953,11 +979,13 @@ class ToolsCore * Return the friendly url from the provided string * * @param string $str - * @param bool $utf8_decode => needs to be marked as deprecated + * @param bool $utf8_decode (deprecated) * @return string */ - public static function link_rewrite($str, $utf8_decode = false) + public static function link_rewrite($str, $utf8_decode = null) { + if ($utf8_decode !== null) + Tools::displayParameterAsDeprecated('utf8_decode'); return Tools::str2url($str); } @@ -970,19 +998,24 @@ class ToolsCore */ public static function str2url($str) { - if (function_exists('mb_strtolower')) - $str = mb_strtolower($str, 'utf-8'); + static $allow_accented_chars = null; + + if ($allow_accented_chars === null) + $allow_accented_chars = Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL'); $str = trim($str); - if (!function_exists('mb_strtolower') || !Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL')) + + if (function_exists('mb_strtolower')) + $str = mb_strtolower($str, 'utf-8'); + if (!$allow_accented_chars) $str = Tools::replaceAccentedChars($str); // Remove all non-whitelist chars. - if (Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL')) - $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str); + if ($allow_accented_chars) + $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-\pL]/u', '', $str); else $str = preg_replace('/[^a-zA-Z0-9\s\'\:\/\[\]-]/','', $str); - + $str = preg_replace('/[\s\'\:\/\[\]-]+/', ' ', $str); $str = str_replace(array(' ', '/'), '-', $str); @@ -1002,45 +1035,66 @@ class ToolsCore */ public static function replaceAccentedChars($str) { + /* One source among others: + http://www.tachyonsoft.com/uc0000.htm + http://www.tachyonsoft.com/uc0001.htm + */ $patterns = array( + /* Lowercase */ - '/[\x{0105}\x{00E0}\x{00E1}\x{00E2}\x{00E3}\x{00E4}\x{00E5}]/u', - '/[\x{00E7}\x{010D}\x{0107}]/u', - '/[\x{010F}]/u', - '/[\x{00E8}\x{00E9}\x{00EA}\x{00EB}\x{011B}\x{0119}]/u', - '/[\x{00EC}\x{00ED}\x{00EE}\x{00EF}]/u', - '/[\x{0142}\x{013E}\x{013A}]/u', - '/[\x{00F1}\x{0148}]/u', - '/[\x{00F2}\x{00F3}\x{00F4}\x{00F5}\x{00F6}\x{00F8}]/u', - '/[\x{0159}\x{0155}]/u', - '/[\x{015B}\x{0161}]/u', - '/[\x{00DF}]/u', - '/[\x{0165}]/u', - '/[\x{00F9}\x{00FA}\x{00FB}\x{00FC}\x{016F}]/u', - '/[\x{00FD}\x{00FF}]/u', - '/[\x{017C}\x{017A}\x{017E}]/u', - '/[\x{00E6}]/u', - '/[\x{0153}]/u', + /* a */ '/[\x{00E0}\x{00E1}\x{00E2}\x{00E3}\x{00E4}\x{00E5}\x{0101}\x{0103}\x{0105}]/u', + /* c */ '/[\x{00E7}\x{0107}\x{0109}\x{010D}]/u', + /* d */ '/[\x{010F}\x{0111}]/u', + /* e */ '/[\x{00E8}\x{00E9}\x{00EA}\x{00EB}\x{0113}\x{0115}\x{0117}\x{0119}\x{011B}]/u', + /* g */ '/[\x{011F}\x{0121}\x{0123}]/u', + /* h */ '/[\x{0125}\x{0127}]/u', + /* i */ '/[\x{00EC}\x{00ED}\x{00EE}\x{00EF}\x{0129}\x{012B}\x{012D}\x{012F}\x{0131}]/u', + /* j */ '/[\x{0135}]/u', + /* k */ '/[\x{0137}\x{0138}]/u', + /* l */ '/[\x{013A}\x{013C}\x{013E}\x{0140}\x{0142}]/u', + /* n */ '/[\x{00F1}\x{0144}\x{0146}\x{0148}\x{0149}\x{014B}]/u', + /* o */ '/[\x{00F2}\x{00F3}\x{00F4}\x{00F5}\x{00F6}\x{00F8}\x{014D}\x{014F}\x{0151}]/u', + /* r */ '/[\x{0155}\x{0157}\x{0159}]/u', + /* s */ '/[\x{015B}\x{015D}\x{015F}\x{0161}]/u', + /* ss*/ '/[\x{00DF}]/u', + /* t */ '/[\x{0163}\x{0165}\x{0167}]/u', + /* u */ '/[\x{00F9}\x{00FA}\x{00FB}\x{00FC}\x{0169}\x{016B}\x{016D}\x{016F}\x{0171}\x{0173}]/u', + /* w */ '/[\x{0175}]/u', + /* y */ '/[\x{00FF}\x{0177}\x{00FD}]/u', + /* z */ '/[\x{017A}\x{017C}\x{017E}]/u', + /* ae*/ '/[\x{00E6}]/u', + /* oe*/ '/[\x{0153}]/u', /* Uppercase */ - '/[\x{0104}\x{00C0}\x{00C1}\x{00C2}\x{00C3}\x{00C4}\x{00C5}]/u', - '/[\x{00C7}\x{010C}\x{0106}]/u', - '/[\x{010E}]/u', - '/[\x{00C8}\x{00C9}\x{00CA}\x{00CB}\x{011A}\x{0118}]/u', - '/[\x{0141}\x{013D}\x{0139}]/u', - '/[\x{00D1}\x{0147}]/u', - '/[\x{00D3}]/u', - '/[\x{0158}\x{0154}]/u', - '/[\x{015A}\x{0160}]/u', - '/[\x{0164}]/u', - '/[\x{00D9}\x{00DA}\x{00DB}\x{00DC}\x{016E}]/u', - '/[\x{017B}\x{0179}\x{017D}]/u', - '/[\x{00C6}]/u', - '/[\x{0152}]/u'); + /* A */ '/[\x{0100}\x{0102}\x{0104}\x{00C0}\x{00C1}\x{00C2}\x{00C3}\x{00C4}\x{00C5}]/u', + /* C */ '/[\x{00C7}\x{0106}\x{0108}\x{010A}\x{010C}]/u', + /* D */ '/[\x{010E}\x{0110}]/u', + /* E */ '/[\x{00C8}\x{00C9}\x{00CA}\x{00CB}\x{0112}\x{0114}\x{0116}\x{0118}\x{011A}]/u', + /* G */ '/[\x{011C}\x{011E}\x{0120}\x{0122}]/u', + /* H */ '/[\x{0124}\x{0126}]/u', + /* I */ '/[\x{0128}\x{012A}\x{012C}\x{012E}\x{0130}]/u', + /* J */ '/[\x{0134}]/u', + /* K */ '/[\x{0136}]/u', + /* L */ '/[\x{0139}\x{013B}\x{013D}\x{0139}\x{0141}]/u', + /* N */ '/[\x{00D1}\x{0143}\x{0145}\x{0147}\x{014A}]/u', + /* O */ '/[\x{00D3}\x{014C}\x{014E}\x{0150}]/u', + /* R */ '/[\x{0154}\x{0156}\x{0158}]/u', + /* S */ '/[\x{015A}\x{015C}\x{015E}\x{0160}]/u', + /* T */ '/[\x{0162}\x{0164}\x{0166}]/u', + /* U */ '/[\x{00D9}\x{00DA}\x{00DB}\x{00DC}\x{0168}\x{016A}\x{016C}\x{016E}\x{0170}\x{0172}]/u', + /* W */ '/[\x{0174}]/u', + /* Y */ '/[\x{0176}]/u', + /* Z */ '/[\x{0179}\x{017B}\x{017D}]/u', + /* AE*/ '/[\x{00C6}]/u', + /* OE*/ '/[\x{0152}]/u'); + + // ö to oe + // å to aa + // ä to ae $replacements = array( - 'a', 'c', 'd', 'e', 'i', 'l', 'n', 'o', 'r', 's', 'ss', 't', 'u', 'y', 'z', 'ae', 'oe', - 'A', 'C', 'D', 'E', 'L', 'N', 'O', 'R', 'S', 'T', 'U', 'Z', 'AE', 'OE' + 'a', 'c', 'd', 'e', 'g', 'h', 'i', 'j', 'k', 'l', 'n', 'o', 'r', 's', 'ss', 't', 'u', 'y', 'w', 'z', 'ae', 'oe', + 'A', 'C', 'D', 'E', 'G', 'H', 'I', 'J', 'K', 'L', 'N', 'O', 'R', 'S', 'T', 'U', 'Z', 'AE', 'OE' ); return preg_replace($patterns, $replacements, $str); @@ -1269,18 +1323,30 @@ class ToolsCore public static function file_get_contents($url, $use_include_path = false, $stream_context = null, $curl_timeout = 5) { - if ($stream_context == null) - $stream_context = @stream_context_create(array('http' => array('timeout' => 5))); - - if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) + if ($stream_context == null && preg_match('/^https?:\/\//', $url)) + $stream_context = @stream_context_create(array('http' => array('timeout' => $curl_timeout))); + if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1')) || !preg_match('/^https?:\/\//', $url)) return @file_get_contents($url, $use_include_path, $stream_context); elseif (function_exists('curl_init')) { $curl = curl_init(); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_URL, $url); - curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, $curl_timeout); + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); curl_setopt($curl, CURLOPT_TIMEOUT, $curl_timeout); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); + if ($stream_context != null) { + $opts = stream_context_get_options($stream_context); + if (isset($opts['http']['method']) && Tools::strtolower($opts['http']['method']) == 'post') + { + curl_setopt($curl, CURLOPT_POST, true); + if (isset($opts['http']['content'])) + { + parse_str($opts['http']['content'], $datas); + curl_setopt($curl, CURLOPT_POSTFIELDS, $datas); + } + } + } $content = curl_exec($curl); curl_close($curl); return $content; @@ -1291,15 +1357,33 @@ class ToolsCore public static function simplexml_load_file($url, $class_name = null) { - if (in_array(ini_get('allow_url_fopen'), array('On', 'on', '1'))) - return @simplexml_load_string(Tools::file_get_contents($url), $class_name); + return @simplexml_load_string(Tools::file_get_contents($url), $class_name); + } + + public static function copy($source, $destination, $stream_context = null) + { + if ($stream_context == null && preg_match('/^https?:\/\//', $source)) + $stream_context = @stream_context_create(array('http' => array('timeout' => 10))); + + if (in_array(@ini_get('allow_url_fopen'), array('On', 'on', '1')) || !preg_match('/^https?:\/\//', $source)) + return @copy($source, $destination, $stream_context); + elseif (function_exists('curl_init')) + { + $curl = curl_init(); + curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($curl, CURLOPT_URL, $source); + curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5); + curl_setopt($curl, CURLOPT_TIMEOUT, 10); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0); + $opts = stream_context_get_options($stream_context); + $content = curl_exec($curl); + curl_close($curl); + return file_put_contents($destination, $content); + } else return false; } - - public static $a = 0; - /** * @deprecated as of 1.5 use Media::minifyHTML() */ @@ -1403,13 +1487,11 @@ class ToolsCore public static function replaceByAbsoluteURL($matches) { global $current_css_file; - $protocol_link = Tools::getCurrentUrlProtocolPrefix(); - - if (array_key_exists(1, $matches)) + if (array_key_exists(1, $matches) && array_key_exists(2, $matches)) { - $tmp = dirname($current_css_file).'/'.$matches[1]; - return 'url(\''.$protocol_link.Tools::getMediaServer($tmp).$tmp.'\')'; + $tmp = dirname($current_css_file).'/'.$matches[2]; + return $matches[1].$protocol_link.Tools::getMediaServer($tmp).$tmp; } return false; } @@ -1475,10 +1557,10 @@ class ToolsCore if (self::$_cache_nb_media_servers && ($id_media_server = (abs(crc32($filename)) % self::$_cache_nb_media_servers + 1))) return constant('_MEDIA_SERVER_'.$id_media_server.'_'); - return Tools::getHttpHost(); + return Tools::getShopDomain(); } - public static function generateHtaccess($path = null, $rewrite_settings = null, $cache_control = null, $specific = '', $disable_multiviews = null, $medias = false) + public static function generateHtaccess($path = null, $rewrite_settings = null, $cache_control = null, $specific = '', $disable_multiviews = null, $medias = false, $disable_modsec = null) { if (defined('PS_INSTALLATION_IN_PROGRESS')) return true; @@ -1491,6 +1573,9 @@ class ToolsCore if (is_null($disable_multiviews)) $disable_multiviews = (int)Configuration::get('PS_HTACCESS_DISABLE_MULTIVIEWS'); + if ($disable_modsec === null) + $disable_modsec = (int)Configuration::get('PS_HTACCESS_DISABLE_MODSEC'); + // Check current content of .htaccess and save all code outside of prestashop comments $specific_before = $specific_after = ''; if (file_exists($path)) @@ -1512,7 +1597,7 @@ class ToolsCore } // Write .htaccess data - if (!$write_fd = @fopen($path, 'w')) + if (!$write_fd = fopen($path, 'w')) return false; fwrite($write_fd, trim($specific_before)."\n\n"); @@ -1527,6 +1612,18 @@ class ToolsCore 'virtual' => $shop_url->virtual_uri, 'id_shop' => $shop_url->id_shop ); + + if ($shop_url->domain == $shop_url->domain_ssl) + continue; + + if (!isset($domains[$shop_url->domain_ssl])) + $domains[$shop_url->domain_ssl] = array(); + + $domains[$shop_url->domain_ssl][] = array( + 'physical' => $shop_url->physical_uri, + 'virtual' => $shop_url->virtual_uri, + 'id_shop' => $shop_url->id_shop + ); } // Write data in .htaccess file @@ -1534,6 +1631,9 @@ class ToolsCore fwrite($write_fd, "# .htaccess automaticaly generated by PrestaShop e-commerce open-source solution\n"); fwrite($write_fd, "# http://www.prestashop.com - http://www.prestashop.com/forums\n\n"); + if ($disable_modsec) + fwrite($write_fd, "\nSecFilterEngine Off\nSecFilterScanPOST Off\n\n"); + // RewriteEngine fwrite($write_fd, "\n"); @@ -1567,8 +1667,10 @@ class ToolsCore // Webservice fwrite($write_fd, 'RewriteRule ^api/?(.*)$ %{ENV:REWRITEBASE}webservice/dispatcher.php?url=$1 [QSA,L]'."\n\n"); - - $rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS', null, null, (int)$uri['id_shop']); + + if (!$rewrite_settings) + $rewrite_settings = (int)Configuration::get('PS_REWRITING_SETTINGS', null, null, (int)$uri['id_shop']); + $domain_rewrite_cond = 'RewriteCond %{HTTP_HOST} ^'.$domain.'$'."\n"; // Rewrite virtual multishop uri if ($uri['virtual']) @@ -1588,7 +1690,7 @@ class ToolsCore fwrite($write_fd, $media_domains); fwrite($write_fd, $domain_rewrite_cond); fwrite($write_fd, 'RewriteRule ^'.ltrim($uri['virtual'], '/').'(.*) '.$uri['physical']."$1 [L]\n\n"); - } + } if ($rewrite_settings) { @@ -1598,10 +1700,10 @@ class ToolsCore { fwrite($write_fd, $media_domains); fwrite($write_fd, $domain_rewrite_cond); - fwrite($write_fd, 'RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}'._PS_PROD_IMG_.'$1-$2$3$4.jpg [L]'."\n"); + fwrite($write_fd, 'RewriteRule ^([a-z0-9]+)\-([a-z0-9]+)(\-[_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1-$2$3$4.jpg [L]'."\n"); fwrite($write_fd, $media_domains); fwrite($write_fd, $domain_rewrite_cond); - fwrite($write_fd, 'RewriteRule ^([0-9]+)\-([0-9]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}'._PS_PROD_IMG_.'$1-$2$3.jpg [L]'."\n"); + fwrite($write_fd, 'RewriteRule ^([0-9]+)\-([0-9]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/$1-$2$3.jpg [L]'."\n"); } // Rewrite product images < 100 millions @@ -1616,7 +1718,7 @@ class ToolsCore $img_name .= '$'.$j; fwrite($write_fd, $media_domains); fwrite($write_fd, $domain_rewrite_cond); - fwrite($write_fd, 'RewriteRule ^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}'._PS_PROD_IMG_.$img_path.$img_name.'$'.($j + 1).".jpg [L]\n"); + fwrite($write_fd, 'RewriteRule ^'.str_repeat('([0-9])', $i).'(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/p/'.$img_path.$img_name.'$'.($j + 1).".jpg [L]\n"); } fwrite($write_fd, $media_domains); fwrite($write_fd, $domain_rewrite_cond); @@ -1625,6 +1727,10 @@ class ToolsCore fwrite($write_fd, $domain_rewrite_cond); fwrite($write_fd, 'RewriteRule ^c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ %{ENV:REWRITEBASE}img/c/$1$2.jpg [L]'."\n"); } + + fwrite($write_fd, "# AlphaImageLoader for IE and fancybox\n"); + fwrite($write_fd, $domain_rewrite_cond); + fwrite($write_fd, 'RewriteRule ^images_ie/?([^/]+)\.(jpe?g|png|gif)$ js/jquery/plugins/fancybox/images/$1.$2 [L]'."\n"); } // Redirections to dispatcher if ($rewrite_settings) @@ -1659,11 +1765,9 @@ class ToolsCore FileETag INode MTime Size - AddOutputFilterByType DEFLATE text/html - AddOutputFilterByType DEFLATE text/css - AddOutputFilterByType DEFLATE text/javascript - AddOutputFilterByType DEFLATE application/javascript - AddOutputFilterByType DEFLATE application/x-javascript + + AddOutputFilterByType DEFLATE text/html text/css text/javascript application/javascript application/x-javascript + \n\n"; fwrite($write_fd, $cache_control); } @@ -1684,6 +1788,47 @@ FileETag INode MTime Size return true; } + + public static function getDefaultIndexContent() + { + return ' +* @copyright 2007-'.date('Y').' 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; +'; + + } /** * jsonDecode convert json string to php array / object @@ -1727,20 +1872,14 @@ FileETag INode MTime Size */ public static function displayAsDeprecated($message = null) { - if (_PS_DISPLAY_COMPATIBILITY_WARNING_) - { $backtrace = debug_backtrace(); $callee = next($backtrace); - if ($message) - trigger_error($message, E_USER_WARNING); - else - { - trigger_error('Function '.$callee['function'].'() is deprecated in '.$callee['file'].' on line '.$callee['line'].'
        ', E_USER_WARNING); - $message = 'The function '.$callee['function'].' (Line '.$callee['line'].') is deprecated and will be removed in the next major version.'; - } $class = isset($callee['class']) ? $callee['class'] : null; - Logger::addLog($message, 3, $class); - } + if ($message === null) + $message = 'The function '.$callee['function'].' (Line '.$callee['line'].') is deprecated and will be removed in the next major version.'; + $error = 'Function '.$callee['function'].'() is deprecated in '.$callee['file'].' on line '.$callee['line'].'
        '; + + Tools::throwDeprecated($error, $message, $class); } /** @@ -1750,11 +1889,10 @@ FileETag INode MTime Size { $backtrace = debug_backtrace(); $callee = next($backtrace); - $error = 'Parameter '.$parameter.' in function '.$callee['function'].'() is deprecated in '.$callee['file'].' on line '.$callee['Line'].'
        '; - $message = 'The parameter '.$parameter.' in function '.$callee['function'].' (Line '.$callee['Line'].') is deprecated and will be removed in the next major version.'; - - trigger_error($message, E_WARNING); + $error = 'Parameter '.$parameter.' in function '.(isset($callee['function']) ? $callee['function'] : '').'() is deprecated in '.$callee['file'].' on line '.(isset($callee['line']) ? $callee['line'] : '(undefined)').'
        '; + $message = 'The parameter '.$parameter.' in function '.$callee['function'].' (Line '.(isset($callee['line']) ? $callee['line'] : 'undefined').') is deprecated and will be removed in the next major version.'; $class = isset($callee['class']) ? $callee['class'] : null; + Tools::throwDeprecated($error, $message, $class); } @@ -1764,8 +1902,8 @@ FileETag INode MTime Size $callee = current($backtrace); $error = 'File '.$callee['file'].' is deprecated
        '; $message = 'The file '.$callee['file'].' is deprecated and will be removed in the next major version.'; - $class = isset($callee['class']) ? $callee['class'] : null; + Tools::throwDeprecated($error, $message, $class); } @@ -1773,7 +1911,7 @@ FileETag INode MTime Size { if (_PS_DISPLAY_COMPATIBILITY_WARNING_) { -// trigger_error($error, E_USER_WARNING); + trigger_error($error, E_USER_WARNING); Logger::addLog($message, 3, $class); } } @@ -1791,6 +1929,7 @@ FileETag INode MTime Size self::$_caching = (int)$smarty->caching; $smarty->force_compile = 0; $smarty->caching = (int)$level; + $smarty->cache_lifetime = 31536000; // 1 Year } public static function restoreCacheSettings(Context $context = null) @@ -1888,6 +2027,13 @@ FileETag INode MTime Size } } + public static function getSafeModeStatus() + { + if (!$safe_mode = @ini_get('safe_mode')) + $safe_mode = ''; + return in_array(Tools::strtolower($safe_mode), array(1, 'on')); + } + /** * @desc extract a zip file to the given directory * @return bool success @@ -1989,6 +2135,9 @@ FileETag INode MTime Size } } + /** + * @deprecated as of 1.5 use Controller::getController('PageNotFoundController')->run(); + */ public static function display404Error() { header('HTTP/1.1 404 Not Found'); @@ -2040,9 +2189,18 @@ FileETag INode MTime Size * * @param Smarty $smarty */ - public static function clearCache($smarty, $tpl = false, $cache_id = null, $compile_id = null) + public static function clearCache($smarty = null, $tpl = false, $cache_id = null, $compile_id = null) { - return $smarty->clearAllCache(); + if ($smarty === null) + $smarty = Context::getContext()->smarty; + + if ($smarty === null) + return; + + if (!$tpl && $cache_id === null && $compile_id === null) + return $smarty->clearAllCache(); + + return $smarty->clearCache($tpl, $cache_id, $compile_id); } /** @@ -2087,6 +2245,28 @@ FileETag INode MTime Size return (PHP_INT_MAX == '9223372036854775807'); } + /** + * + * @return bool true if php-cli is used + */ + public static function isPHPCLI() + { + return (defined('STDIN') || (Tools::strtolower(php_sapi_name()) == 'cli' && (!isset($_SERVER['REMOTE_ADDR']) || empty($_SERVER['REMOTE_ADDR'])))); + } + + public static function argvToGET($argc, $argv) + { + if ($argc <= 1) + return; + + // get the first argument and parse it like a query string + parse_str($argv[1], $args); + if (!is_array($args) || !count($args)) + return; + $_GET = array_merge($args, $_GET); + $_SERVER['QUERY_STRING'] = $argv[1]; + } + /** * Get max file upload size considering server settings and optional max value * @@ -2153,7 +2333,7 @@ FileETag INode MTime Size $filtered_files = array(); - $real_ext = ''; + $real_ext = false; if (!empty($ext)) $real_ext = '.'.$ext; $real_ext_length = strlen($real_ext); @@ -2161,7 +2341,7 @@ FileETag INode MTime Size $subdir = ($dir) ? $dir.'/' : ''; foreach ($files as $file) { - if (strpos($file, $real_ext) && strpos($file, $real_ext) == (strlen($file) - $real_ext_length)) + if (!$real_ext || (strpos($file, $real_ext) && strpos($file, $real_ext) == (strlen($file) - $real_ext_length))) $filtered_files[] = $subdir.$file; if ($recursive && $file[0] != '.' && is_dir($real_path.$file)) @@ -2258,6 +2438,107 @@ FileETag INode MTime Size return $pattern; return preg_replace('/\\\[px]\{[a-z]\}{1,2}|(\/[a-z]*)u([a-z]*)$/i', "$1$2", $pattern); } + + public static function addonsRequest($request, $params = array()) + { + $addons_url = 'api.addons.prestashop.com'; + $postData = ''; + $postDataArray = array( + 'version' => isset($params['version']) ? $params['version'] : _PS_VERSION_, + 'iso_lang' => Tools::strtolower(isset($params['iso_lang']) ? $params['iso_lang'] : Context::getContext()->language->iso_code), + 'iso_code' => Tools::strtolower(isset($params['iso_country']) ? $params['iso_country'] : Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))), + 'shop_url' => urlencode(isset($params['shop_url']) ? $params['shop_url'] : Tools::getShopDomain()), + 'mail' => urlencode(isset($params['email']) ? $params['email'] : Configuration::get('email')) + ); + foreach ($postDataArray as $postDataKey => $postDataValue) + $postData .= '&'.$postDataKey.'='.$postDataValue; + $postData = ltrim($postData, '&'); + + // Config for each request + if ($request == 'native') + { + // Define protocol accepted and post data values for this request + $protocolsList = array('https://' => 443, 'http://' => 80); + $postData .= '&method=listing&action=native'; + } + if ($request == 'must-have') + { + // Define protocol accepted and post data values for this request + $protocolsList = array('https://' => 443, 'http://' => 80); + $postData .= '&method=listing&action=must-have'; + } + if ($request == 'customer') + { + // Define protocol accepted and post data values for this request + $protocolsList = array('https://' => 443); + $postData .= '&method=listing&action=customer&username='.urlencode(trim(Context::getContext()->cookie->username_addons)).'&password='.urlencode(trim(Context::getContext()->cookie->password_addons)); + } + if ($request == 'check_customer') + { + // Define protocol accepted and post data values for this request + $protocolsList = array('https://' => 443); + $postData .= '&method=check_customer&username='.urlencode($params['username_addons']).'&password='.urlencode($params['password_addons']); + } + if ($request == 'module') + { + // Define protocol accepted and post data values for this request + if (isset($params['username_addons']) && isset($params['password_addons'])) + { + $protocolsList = array('https://' => 443); + $postData .= '&method=module&id_module='.urlencode($params['id_module']).'&username='.urlencode($params['username_addons']).'&password='.urlencode($params['password_addons']); + } + else + { + $protocolsList = array('https://' => 443, 'http://' => 80); + $postData .= '&method=module&id_module='.urlencode($params['id_module']); + } + } + + if ($request == 'install-modules') + { + // Define protocol accepted and post data values for this request + $protocolsList = array('https://' => 443, 'http://' => 80); + $postData .= '&method=listing&action=install-modules'; + + } + + // Make the request + $opts = array( + 'http'=>array( + 'method'=> 'POST', + 'content' => $postData, + 'header' => 'Content-type: application/x-www-form-urlencoded', + 'timeout' => 5, + ) + ); + $context = stream_context_create($opts); + foreach ($protocolsList as $protocol => $port) + { + $content = Tools::file_get_contents($protocol.$addons_url, false, $context); + + // If content returned, we cache it + if ($content) + return $content; + } + + // No content, return false + return false; + } + + public static function fileAttachment($input = 'fileUpload') + { + $fileAttachment = null; + if (isset($_FILES[$input]['name']) && !empty($_FILES[$input]['name']) && !empty($_FILES[$input]['tmp_name'])) + { + $fileAttachment['rename'] = uniqid(). self::strtolower(substr($_FILES[$input]['name'], -5)); + $fileAttachment['content'] = file_get_contents($_FILES[$input]['tmp_name']); + $fileAttachment['tmp_name'] = $_FILES[$input]['tmp_name']; + $fileAttachment['name'] = $_FILES[$input]['name']; + $fileAttachment['mime'] = $_FILES[$input]['type']; + $fileAttachment['error'] = $_FILES[$input]['error']; + } + return $fileAttachment; + } } /** @@ -2285,4 +2566,3 @@ function cmpPriceDesc($a, $b) return -1; return 0; } - diff --git a/classes/Translate.php b/classes/Translate.php index bfd852601..bbf4a5bdd 100644 --- a/classes/Translate.php +++ b/classes/Translate.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -51,7 +51,10 @@ class TranslateCore if ($_LANGADM == null) { $iso = Context::getContext()->language->iso_code; - include_once(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php'); + if (empty($iso)) + $iso = Language::getIsoById((int)(Configuration::get('PS_LANG_DEFAULT'))); + if (file_exists(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php')) + include_once(_PS_TRANSLATIONS_DIR_.$iso.'/admin.php'); } if (isset($modules_tabs[strtolower($class)])) @@ -116,7 +119,7 @@ class TranslateCore * @param string $source * @return string */ - public static function getModuleTranslation($module, $string, $source, $sprintf = null) + public static function getModuleTranslation($module, $string, $source, $sprintf = null, $js = false) { global $_MODULES, $_MODULE, $_LANGADM; @@ -126,8 +129,7 @@ class TranslateCore static $translations_merged = array(); $name = $module instanceof Module ? $module->name : $module; - - if (!isset($translations_merged[$name])) + if (!isset($translations_merged[$name]) && isset(Context::getContext()->language)) { $filesByPriority = array( // Translations in theme @@ -175,7 +177,16 @@ class TranslateCore if ($sprintf !== null) $ret = Translate::checkAndReplaceArgs($ret, $sprintf); - $lang_cache[$cache_key] = str_replace('"', '"', $ret); + if ($js) + $ret = addslashes($ret); + + $ret = str_replace('"', '"', $ret); + + if ($sprintf === null) + $lang_cache[$cache_key] = $ret; + else + return $ret; + } return $lang_cache[$cache_key]; } diff --git a/classes/TranslatedConfiguration.php b/classes/TranslatedConfiguration.php index 3f67682f8..27e873968 100755 --- a/classes/TranslatedConfiguration.php +++ b/classes/TranslatedConfiguration.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Upgrader.php b/classes/Upgrader.php index a1f7fa9ce..d6b1eb702 100644 --- a/classes/Upgrader.php +++ b/classes/Upgrader.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/Validate.php b/classes/Validate.php index 2aa05df0c..02fbe77d1 100644 --- a/classes/Validate.php +++ b/classes/Validate.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -229,7 +229,7 @@ class ValidateCore */ public static function isPrice($price) { - return preg_match('/^[0-9]{1,10}(\.[0-9]{1,9})?$/', $price); + return preg_match('/^[0-9]{1,10}(\.[0-9]{1,9})?$/', sprintf('%f', $price)); } /** @@ -240,7 +240,7 @@ class ValidateCore */ public static function isNegativePrice($price) { - return preg_match('/^[-]?[0-9]{1,10}(\.[0-9]{1,9})?$/', $price); + return preg_match('/^[-]?[0-9]{1,10}(\.[0-9]{1,9})?$/', sprintf('%f', $price)); } /** @@ -380,7 +380,7 @@ class ValidateCore */ public static function isGenericName($name) { - return empty($name) || preg_match('/^[^<>=#{}]*$/u', $name); + return empty($name) || preg_match('/^[^<>={}]*$/u', $name); } /** @@ -389,7 +389,7 @@ class ValidateCore * @param string $html HTML field to validate * @return boolean Validity is ok or not */ - public static function isCleanHtml($html) + public static function isCleanHtml($html, $allow_iframe = false) { $events = 'onmousedown|onmousemove|onmmouseup|onmouseover|onmouseout|onload|onunload|onfocus|onblur|onchange'; $events .= '|onsubmit|ondblclick|onclick|onkeydown|onkeyup|onkeypress|onmouseenter|onmouseleave|onerror|onselect|onreset|onabort|ondragdrop|onresize|onactivate|onafterprint|onmoveend'; @@ -398,7 +398,14 @@ class ValidateCore $events .= '|ondragleave|ondragover|ondragstart|ondrop|onerrorupdate|onfilterchange|onfinish|onfocusin|onfocusout|onhashchange|onhelp|oninput|onlosecapture|onmessage|onmouseup|onmovestart'; $events .= '|onoffline|ononline|onpaste|onpropertychange|onreadystatechange|onresizeend|onresizestart|onrowenter|onrowexit|onrowsdelete|onrowsinserted|onscroll|onsearch|onselectionchange'; $events .= '|onselectstart|onstart|onstop'; - return (!preg_match('/<[ \t\n]*script/ims', $html) && !preg_match('/('.$events.')[ \t\n]*=/ims', $html) && !preg_match('/.*script\:/ims', $html) && !preg_match('/<[ \t\n]*i?frame/ims', $html)); + + if (preg_match('/<[ \t\n]*script/ims', $html) || preg_match('/('.$events.')[ \t\n]*=/ims', $html) || preg_match('/.*script\:/ims', $html)) + return false; + + if (!$allow_iframe && preg_match('/<[ \t\n]*(i?frame|form|input|embed|object)/ims', $html)) + return false; + + return true; } /** @@ -472,9 +479,9 @@ class ValidateCore */ public static function isDate($date) { - if (!preg_match('/^([0-9]{4})-((0?[0-9])|(1[0-2]))-((0?[0-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $matches)) + if (!preg_match('/^([0-9]{4})-((?:0?[0-9])|(?:1[0-2]))-((?:0?[0-9])|(?:[1-2][0-9])|(?:3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $matches)) return false; - return checkdate((int)$matches[2], (int)$matches[5], (int)$matches[0]); + return checkdate((int)$matches[2], (int)$matches[3], (int)$matches[1]); } /** @@ -487,9 +494,9 @@ class ValidateCore { if (empty($date) || $date == '0000-00-00') return true; - if (preg_match('/^([0-9]{4})-((0?[1-9])|(1[0-2]))-((0?[1-9])|([1-2][0-9])|(3[01]))( [0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birth_date)) + if (preg_match('/^([0-9]{4})-((?:0?[1-9])|(?:1[0-2]))-((?:0?[1-9])|(?:[1-2][0-9])|(?:3[01]))([0-9]{2}:[0-9]{2}:[0-9]{2})?$/', $date, $birth_date)) { - if ($birth_date[1] > date('Y') || $birth_date[2] > date('m') || $birth_date[3] > date('d')) + if ($birth_date[1] > date('Y') && $birth_date[2] > date('m') && $birth_date[3] > date('d')) return false; return true; } @@ -724,7 +731,7 @@ class ValidateCore */ public static function isTrackingNumber($tracking_number) { - return preg_match('/^[~:#,%&_=\(\)\.\? \+\-@\/a-zA-Z0-9]+$/', $tracking_number); + return preg_match('/^[~:#,%&_=\(\)\[\]\.\? \+\-@\/a-zA-Z0-9]+$/', $tracking_number); } /** @@ -747,7 +754,7 @@ class ValidateCore public static function isAbsoluteUrl($url) { if (!empty($url)) - return preg_match('/^https?:\/\/[,:#%&_=\(\)\.\? \+\-@\/a-zA-Z0-9]+$/', $url); + return preg_match('/^https?:\/\/[~:#,%&_=\(\)\[\]\.\? \+\-@\/a-zA-Z0-9]+$/', $url); return true; } @@ -802,12 +809,12 @@ class ValidateCore public static function isWeightUnit($unit) { - return preg_match('/^[a-zA-Z]{1,3}$/', $unit); + return (Validate::isGenericName($unit) & (Tools::strlen($unit) < 5)); } public static function isDistanceUnit($unit) { - return preg_match('/^[a-zA-Z]{1,2}$/', $unit); + return (Validate::isGenericName($unit) & (Tools::strlen($unit) < 5)); } public static function isSubDomainName($domain) @@ -1055,6 +1062,9 @@ class ValidateCore { return (bool)(is_string($name) && preg_match('/^[0-9a-zA-Z-_]*$/u', $name)); } - -} - + + public static function isPrestaShopVersion($version) + { + return (preg_match('/^[0-1]\.[0-9]{1,2}(\.[0-9]{1,2}){0,2}$/', $version) && ip2long($version)); + } +} \ No newline at end of file diff --git a/classes/Zone.php b/classes/Zone.php index 38e41668c..699a90e52 100644 --- a/classes/Zone.php +++ b/classes/Zone.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/cache/Cache.php b/classes/cache/Cache.php index c32fc4e9b..994f06c31 100755 --- a/classes/cache/Cache.php +++ b/classes/cache/Cache.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -144,7 +144,7 @@ abstract class CacheCore */ public function set($key, $value, $ttl = 0) { - if ($this->_set($key, $value)) + if ($this->_set($key, $value, $ttl)) { if ($ttl < 0) $ttl = 0; @@ -205,7 +205,6 @@ abstract class CacheCore foreach ($this->keys as $k => $ttl) if (preg_match('#^'.$pattern.'$#', $k)) $keys[] = $k; - } // Delete keys @@ -235,13 +234,13 @@ abstract class CacheCore if (is_null($this->sql_tables_cached)) { - $this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME); + $this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME); if (!is_array($this->sql_tables_cached)) $this->sql_tables_cached = array(); } // Store query results in cache if this query is not already cached - $key = md5($query); + $key = md5(_COOKIE_IV_.$query); if ($this->exists($key)) return true; $this->set($key, $result); @@ -251,7 +250,7 @@ abstract class CacheCore foreach ($tables as $table) if (!isset($this->sql_tables_cached[$table][$key])) $this->sql_tables_cached[$table][$key] = true; - $this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached); + $this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached); } protected function getTables($string) @@ -271,7 +270,7 @@ abstract class CacheCore { if (is_null($this->sql_tables_cached)) { - $this->sql_tables_cached = $this->get(self::SQL_TABLES_NAME); + $this->sql_tables_cached = $this->get(_COOKIE_IV_.self::SQL_TABLES_NAME); if (!is_array($this->sql_tables_cached)) $this->sql_tables_cached = array(); } @@ -287,7 +286,7 @@ abstract class CacheCore } unset($this->sql_tables_cached[$table]); } - $this->set(self::SQL_TABLES_NAME, $this->sql_tables_cached); + $this->set(_COOKIE_IV_.self::SQL_TABLES_NAME, $this->sql_tables_cached); } /** @@ -326,7 +325,7 @@ abstract class CacheCore public static function clean($key) { - if (strpos($key, '*')) + if (strpos($key, '*') !== false) { $regexp = str_replace('\\*', '.*', preg_quote($key, '#')); foreach (array_keys(Cache::$local) as $key) diff --git a/classes/cache/CacheApc.php b/classes/cache/CacheApc.php index 4a6e5924c..e32c04ad6 100644 --- a/classes/cache/CacheApc.php +++ b/classes/cache/CacheApc.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/cache/CacheFs.php b/classes/cache/CacheFs.php index a573a5b5c..4b37b58a3 100755 --- a/classes/cache/CacheFs.php +++ b/classes/cache/CacheFs.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -149,6 +149,7 @@ class CacheFsCore extends Cache */ protected function getFilename($key) { + $key = md5($key); $path = _PS_CACHEFS_DIRECTORY_; for ($i = 0; $i < $this->depth; $i++) $path .= $key[$i].'/'; diff --git a/classes/cache/CacheMemcache.php b/classes/cache/CacheMemcache.php index 6a25787c1..0018683a2 100755 --- a/classes/cache/CacheMemcache.php +++ b/classes/cache/CacheMemcache.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -46,26 +46,34 @@ class CacheMemcacheCore extends Cache // Get keys (this code comes from Doctrine 2 project) $this->keys = array(); - $all_slabs = $this->memcache->getExtendedStats('slabs'); - - foreach ($all_slabs as $server => $slabs) - { - if (is_array($slabs)) - { - foreach (array_keys($slabs) as $slab_id) - { - $dump = $this->memcache->getExtendedStats('cachedump', (int)$slab_id); - if ($dump) - { - foreach ($dump as $entries) - { - if ($entries) - $this->keys = array_merge($this->keys, array_keys($entries)); - } - } - } - } - } + $servers = self::getMemcachedServers(); + + if(is_array($servers) && count($servers) > 0 && method_exists('Memcache', 'getStats')) + $all_slabs = $this->memcache->getStats('slabs'); + + if(isset($all_slabs) && is_array($all_slabs)) + foreach ($all_slabs as $server => $slabs) + { + if (is_array($slabs)) + { + foreach (array_keys($slabs) as $slab_id) + { + if(is_int($slab_id)) + { + $dump = $this->memcache->getStats('cachedump', (int)$slab_id); + if ($dump) + { + foreach ($dump as $entries) + { + if($entries) + foreach ($entries as $key => $data) + $this->keys[$key] = $data[1]; + } + } + } + } + } + } } public function __destruct() @@ -78,12 +86,16 @@ class CacheMemcacheCore extends Cache */ public function connect() { - $this->memcache = new Memcache(); - $servers = CacheMemcache::getMemcachedServers(); + if (class_exists('Memcache') && extension_loaded('memcache')) + $this->memcache = new Memcache(); + else + return false; + + $servers = self::getMemcachedServers(); if (!$servers) return false; foreach ($servers as $server) - $this->memcache->addServer($server['ip'], $server['port'], $server['weight']); + $this->memcache->addServer($server['ip'], $server['port'], true, (int) $server['weight']); $this->is_connected = true; } diff --git a/classes/cache/CacheXcache.php b/classes/cache/CacheXcache.php index 6cc0a3302..bae82d9f4 100644 --- a/classes/cache/CacheXcache.php +++ b/classes/cache/CacheXcache.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/cache/index.php b/classes/cache/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/cache/index.php +++ b/classes/cache/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index c91102bb6..f41c1c346 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,8 +34,6 @@ class AdminControllerCore extends Controller public $confirmations = array(); public $shopShareDatas = false; - protected $addons_url = 'api.addons.prestashop.com'; - public $_languages = array(); public $default_form_language; public $allow_employee_form_lang; @@ -96,7 +94,13 @@ class AdminControllerCore extends Controller /** @var array list to be generated */ protected $fields_list; - + + /** @var array modules list filters */ + protected $filter_modules_list = null; + + /** @var array modules list filters */ + protected $modules_list = array(); + /** @var array edit form to be generated */ protected $fields_form; @@ -164,11 +168,16 @@ class AdminControllerCore extends Controller /** @var bool boolean List content lines are clickable if true */ protected $list_no_link = false; + protected $allow_export = false; + /** @var array $cache_lang cache for traduction */ public static $cache_lang = array(); /** @var array required_fields to display in the Required Fields form */ public $required_fields = array(); + + /** @var Helper */ + protected $helper; /** * @var array actions to execute on multiple selections @@ -227,6 +236,7 @@ class AdminControllerCore extends Controller protected $action; protected $display; protected $_includeContainer = true; + protected $tab_modules_list = array('default_list' => array(), 'slider_list' => array()); public $tpl_folder; @@ -291,25 +301,25 @@ class AdminControllerCore extends Controller $token = $this->token; $this->_conf = array( - 1 => $this->l('Deletion successful'), 2 => $this->l('Selection successfully deleted'), + 1 => $this->l('Deletion successful'), 2 => $this->l('The selection has been successfully deleted.'), 3 => $this->l('Creation successful'), 4 => $this->l('Update successful'), - 5 => $this->l('Status update successful'), 6 => $this->l('Settings update successful'), - 7 => $this->l('Image successfully deleted'), 8 => $this->l('Module downloaded successfully'), - 9 => $this->l('Thumbnails successfully regenerated'), 10 => $this->l('Message sent to the customer'), - 11 => $this->l('Comment added'), 12 => $this->l('Module(s) installed successfully'), - 13 => $this->l('Module(s) uninstalled successfully'), 14 => $this->l('Language successfully copied'), - 15 => $this->l('Translations successfully added'), 16 => $this->l('Module transplanted successfully to hook'), - 17 => $this->l('Module removed successfully from hook'), 18 => $this->l('Upload successful'), - 19 => $this->l('Duplication completed successfully'), 20 => $this->l('Translation added successfully but the language has not been created'), - 21 => $this->l('Module reset successfully'), 22 => $this->l('Module deleted successfully'), - 23 => $this->l('Localization pack imported successfully'), 24 => $this->l('Localization pack imported successfully'), - 25 => $this->l('Images successfully moved'), - 26 => $this->l('Cover selection saved'), - 27 => $this->l('Image shop association modified'), - 28 => $this->l('Zone assigned to the selection successfully'), + 5 => $this->l('The status has been updated successfully.'), 6 => $this->l('The settings have been updated successfully.'), + 7 => $this->l('The image was successfully deleted.'), 8 => $this->l('The module was downloaded successfully.'), + 9 => $this->l('The thumbnails were successfully regenerated.'), 10 => $this->l('Message sent to the customer.'), + 11 => $this->l('Comment added'), 12 => $this->l('Module(s) installed successfully.'), + 13 => $this->l('Module(s) uninstalled successfully.'), 14 => $this->l('The translation was successfully copied.'), + 15 => $this->l('The translations have been successfully added.'), 16 => $this->l('The module transplanted successfully to the hook.'), + 17 => $this->l('The module was successfully removed from the hook.'), 18 => $this->l('Upload successful'), + 19 => $this->l('Duplication was completed successfully.'), 20 => $this->l('The translation was added successfully, but the language has not been created.'), + 21 => $this->l('Module reset successfully.'), 22 => $this->l('Module deleted successfully.'), + 23 => $this->l('Localization pack imported successfully.'), 24 => $this->l('Localization pack imported successfully.'), + 25 => $this->l('The selected images have successfully been moved.'), + 26 => $this->l('Your cover selection has been saved.'), + 27 => $this->l('The image shop association has been modified.'), + 28 => $this->l('A zone has been assigned to the selection successfully.'), 29 => $this->l('Upgrade successful'), - 30 => $this->l('Partial refund successfully created'), - 31 => $this->l('The discount successfully generated') + 30 => $this->l('A partial refund was successfully created.'), + 31 => $this->l('The discount was successfully generated.') ); if (!$this->identifier) $this->identifier = 'id_'.$this->table; @@ -419,41 +429,29 @@ class AdminControllerCore extends Controller */ public function processFilter() { + $prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this))); // Filter memorization if (isset($_POST) && !empty($_POST) && isset($this->table)) foreach ($_POST as $key => $value) { - if (is_array($this->table)) - { - foreach ($this->table as $table) - if (stripos($key, $table.'Filter_') === 0 || stripos($key, 'submitFilter') === 0) - $this->context->cookie->$key = !is_array($value) ? $value : serialize($value); - } - elseif (stripos($key, $this->table.'Filter_') === 0 || stripos($key, 'submitFilter') === 0) + if (stripos($key, $this->table.'Filter_') === 0) + $this->context->cookie->{$prefix.$key} = !is_array($value) ? $value : serialize($value); + elseif(stripos($key, 'submitFilter') === 0) $this->context->cookie->$key = !is_array($value) ? $value : serialize($value); } if (isset($_GET) && !empty($_GET) && isset($this->table)) foreach ($_GET as $key => $value) - { - if (is_array($this->table)) - { - foreach ($this->table as $table) - if (stripos($key, $table.'OrderBy') === 0 || stripos($key, $table.'Orderway') === 0) - $this->context->cookie->$key = $value; - } - elseif (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0) - $this->context->cookie->$key = $value; - } - - $filters = $this->context->cookie->getFamily($this->table.'Filter_'); + if (stripos($key, $this->table.'OrderBy') === 0 || stripos($key, $this->table.'Orderway') === 0) + $this->context->cookie->{$prefix.$key} = $value; + $filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_'); foreach ($filters as $key => $value) { /* Extracting filters from $_POST on key filter_ */ - if ($value != null && !strncmp($key, $this->table.'Filter_', 7 + Tools::strlen($this->table))) + if ($value != null && !strncmp($key, $prefix.$this->table.'Filter_', 7 + Tools::strlen($prefix.$this->table))) { - $key = Tools::substr($key, 7 + Tools::strlen($this->table)); + $key = Tools::substr($key, 7 + Tools::strlen($prefix.$this->table)); /* Table alias could be specified using a ! eg. alias!field */ $tmp_tab = explode('!', $key); $filter = count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]; @@ -478,7 +476,7 @@ class AdminControllerCore extends Controller if (isset($value[0]) && !empty($value[0])) { if (!Validate::isDate($value[0])) - $this->errors[] = Tools::displayError('\'From:\' date format is invalid (YYYY-MM-DD)'); + $this->errors[] = Tools::displayError('The \'From\' date format is invalid (YYYY-MM-DD)'); else $sql_filter .= ' AND '.pSQL($key).' >= \''.pSQL(Tools::dateFrom($value[0])).'\''; } @@ -486,7 +484,7 @@ class AdminControllerCore extends Controller if (isset($value[1]) && !empty($value[1])) { if (!Validate::isDate($value[1])) - $this->errors[] = Tools::displayError('\'To:\' date format is invalid (YYYY-MM-DD)'); + $this->errors[] = Tools::displayError('The \'To\' date format is invalid (YYYY-MM-DD)'); else $sql_filter .= ' AND '.pSQL($key).' <= \''.pSQL(Tools::dateTo($value[1])).'\''; } @@ -515,37 +513,42 @@ class AdminControllerCore extends Controller */ public function postProcess() { - if ($this->ajax) - { - // from ajax-tab.php - $action = Tools::getValue('action'); - // no need to use displayConf() here - if (!empty($action) && method_exists($this, 'ajaxProcess'.Tools::toCamelCase($action))) - return $this->{'ajaxProcess'.Tools::toCamelCase($action)}(); - elseif (method_exists($this, 'ajaxProcess')) - return $this->ajaxProcess(); - } - else - { - // Process list filtering - if ($this->filter) - $this->processFilter(); - - // If the method named after the action exists, call "before" hooks, then call action method, then call "after" hooks - if (!empty($this->action) && method_exists($this, 'process'.ucfirst(Tools::toCamelCase($this->action)))) + try { + if ($this->ajax) { - // Hook before action - Hook::exec('actionAdmin'.ucfirst($this->action).'Before', array('controller' => $this)); - Hook::exec('action'.get_class($this).ucfirst($this->action).'Before', array('controller' => $this)); - // Call process - $return = $this->{'process'.Tools::toCamelCase($this->action)}(); - // Hook After Action - Hook::exec('actionAdmin'.ucfirst($this->action).'After', array('controller' => $this, 'return' => $return)); - Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => $return)); - - return $return; + // from ajax-tab.php + $action = Tools::getValue('action'); + // no need to use displayConf() here + if (!empty($action) && method_exists($this, 'ajaxProcess'.Tools::toCamelCase($action))) + return $this->{'ajaxProcess'.Tools::toCamelCase($action)}(); + elseif (method_exists($this, 'ajaxProcess')) + return $this->ajaxProcess(); } - } + else + { + // Process list filtering + if ($this->filter) + $this->processFilter(); + + // If the method named after the action exists, call "before" hooks, then call action method, then call "after" hooks + if (!empty($this->action) && method_exists($this, 'process'.ucfirst(Tools::toCamelCase($this->action)))) + { + // Hook before action + Hook::exec('actionAdmin'.ucfirst($this->action).'Before', array('controller' => $this)); + Hook::exec('action'.get_class($this).ucfirst($this->action).'Before', array('controller' => $this)); + // Call process + $return = $this->{'process'.Tools::toCamelCase($this->action)}(); + // Hook After Action + Hook::exec('actionAdmin'.ucfirst($this->action).'After', array('controller' => $this, 'return' => $return)); + Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => $return)); + + return $return; + } + } + } catch (PrestaShopException $e) { + $this->errors[] = $e->getMessage(); + }; + return false; } /** @@ -564,9 +567,57 @@ class AdminControllerCore extends Controller $this->content = 'ok'; } } - $this->errors[] = Tools::displayError('An error occurred during image deletion (cannot load object).'); + $this->errors[] = Tools::displayError('An error occurred while attempting to delet the image. (cannot load object).'); return $object; } + + public function processExport() + { + // clean buffer + if (ob_get_level() && ob_get_length() > 0) + ob_clean(); + $this->getList($this->context->language->id); + if (!count($this->_list)) + return; + + header('Content-type: text/csv'); + header('Content-Type: application/force-download; charset=UTF-8'); + header('Cache-Control: no-store, no-cache'); + header('Content-disposition: attachment; filename="'.$this->table.'_'.date('Y-m-d_His').'.csv"'); + + $headers = array(); + foreach ($this->fields_list as $datas) + $headers[] = Tools::htmlentitiesDecodeUTF8($datas['title']); + $content = array(); + foreach ($this->_list as $i => $row) + { + $content[$i] = array(); + $path_to_image = false; + foreach ($this->fields_list as $key => $params) + { + $field_value = isset($row[$key]) ? Tools::htmlentitiesDecodeUTF8($row[$key]) : ''; + if ($key == 'image') + { + if ($params['image'] != 'p' || Configuration::get('PS_LEGACY_IMAGES')) + $path_to_image = Tools::getShopDomain(true)._PS_IMG_.$params['image'].'/'.$row['id_'.$this->table].(isset($row['id_image']) ? '-'.(int)$row['id_image'] : '').'.'.$this->imageType; + else + $path_to_image = Tools::getShopDomain(true)._PS_IMG_.$params['image'].'/'.Image::getImgFolderStatic($row['id_image']).(int)$row['id_image'].'.'.$this->imageType; + if ($path_to_image) + $field_value = $path_to_image; + } + $content[$i][] = $field_value; + } + } + + $this->context->smarty->assign(array( + 'export_precontent' => "\xEF\xBB\xBF", + 'export_headers' => $headers, + 'export_content' => $content + ) + ); + + $this->layout = 'layout-export.tpl'; + } /** * Object Delete @@ -593,20 +644,22 @@ class AdminControllerCore extends Controller $res = $object->deleteImage(); if (!$res) - $this->errors[] = Tools::displayError('Unable to delete associated images'); + $this->errors[] = Tools::displayError('Unable to delete associated images.'); $object->deleted = 1; - if ($object->update()) + if ($res = $object->update()) $this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token; } - elseif ($object->delete()) + elseif ($res = $object->delete()) $this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token; $this->errors[] = Tools::displayError('An error occurred during deletion.'); + if ($res) + Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); } } else { - $this->errors[] = Tools::displayError('An error occurred while deleting object.'). + $this->errors[] = Tools::displayError('An error occurred while deleting the object.'). ' '.$this->table.' '. Tools::displayError('(cannot load object)'); } @@ -644,12 +697,13 @@ class AdminControllerCore extends Controller $this->beforeAdd($this->object); if (method_exists($this->object, 'add') && !$this->object->add()) { - $this->errors[] = Tools::displayError('An error occurred while creating object.'). + $this->errors[] = Tools::displayError('An error occurred while creating an object.'). ' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; } /* voluntary do affectation here */ elseif (($_POST[$this->identifier] = $this->object->id) && $this->postImage($this->object->id) && !count($this->errors) && $this->_redirect) { + Logger::addLog(sprintf($this->l('%s addition'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); $parent_id = (int)Tools::getValue('id_parent', 1); $this->afterAdd($this->object); $this->updateAssoShop($this->object->id); @@ -684,7 +738,6 @@ class AdminControllerCore extends Controller { /* Checking fields validity */ $this->validateRules(); - if (empty($this->errors)) { $id = (int)Tools::getValue($this->identifier); @@ -725,7 +778,7 @@ class AdminControllerCore extends Controller if (!$result) { - $this->errors[] = Tools::displayError('An error occurred while updating object.'). + $this->errors[] = Tools::displayError('An error occurred while updating an object.'). ' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; } elseif ($this->postImage($object->id) && !count($this->errors) && $this->_redirect) @@ -750,9 +803,10 @@ class AdminControllerCore extends Controller if (empty($this->redirect_after)) $this->redirect_after = self::$currentIndex.($parent_id ? '&'.$this->identifier.'='.$object->id : '').'&conf=4&token='.$this->token; } + Logger::addLog(sprintf($this->l('%s edition'), $this->className), 1, null, $this->className, (int)$object->id, true, (int)$this->context->employee->id); } else - $this->errors[] = Tools::displayError('An error occurred while updating object.'). + $this->errors[] = Tools::displayError('An error occurred while updating an object.'). ' '.$this->table.' '.Tools::displayError('(cannot load object)'); } } @@ -779,7 +833,7 @@ class AdminControllerCore extends Controller $object = new $this->className(); if (!$object->addFieldsRequiredDatabase($fields)) - $this->errors[] = Tools::displayError('Error in updating required fields'); + $this->errors[] = Tools::displayError('An error occurred when attempting to update the required fields.'); else $this->redirect_after = self::$currentIndex.'&conf=4&token='.$this->token; @@ -799,10 +853,10 @@ class AdminControllerCore extends Controller $this->redirect_after = self::$currentIndex.'&conf=5'.$id_category.'&token='.$this->token; } else - $this->errors[] = Tools::displayError('An error occurred while updating status.'); + $this->errors[] = Tools::displayError('An error occurred while updating the status.'); } else - $this->errors[] = Tools::displayError('An error occurred while updating status for object.'). + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.'). ' '.$this->table.' '. Tools::displayError('(cannot load object)'); @@ -816,7 +870,7 @@ class AdminControllerCore extends Controller { if (!Validate::isLoadedObject($object = $this->loadObject())) { - $this->errors[] = Tools::displayError('An error occurred while updating status for object.'). + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.'). ' '.$this->table.' '.Tools::displayError('(cannot load object)'); } elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) @@ -835,11 +889,12 @@ class AdminControllerCore extends Controller */ public function processResetFilters() { - $filters = $this->context->cookie->getFamily($this->table.'Filter_'); + $prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this))); + $filters = $this->context->cookie->getFamily($prefix.$this->table.'Filter_'); foreach ($filters as $cookie_key => $filter) - if (strncmp($cookie_key, $this->table.'Filter_', 7 + Tools::strlen($this->table)) == 0) + if (strncmp($cookie_key, $prefix.$this->table.'Filter_', 7 + Tools::strlen($prefix.$this->table)) == 0) { - $key = substr($cookie_key, 7 + Tools::strlen($this->table)); + $key = substr($cookie_key, 7 + Tools::strlen($prefix.$this->table)); /* Table alias could be specified using a ! eg. alias!field */ $tmp_tab = explode('!', $key); $key = (count($tmp_tab) > 1 ? $tmp_tab[1] : $tmp_tab[0]); @@ -851,11 +906,11 @@ class AdminControllerCore extends Controller if (isset($this->context->cookie->{'submitFilter'.$this->table})) unset($this->context->cookie->{'submitFilter'.$this->table}); - if (isset($this->context->cookie->{$this->table.'Orderby'})) - unset($this->context->cookie->{$this->table.'Orderby'}); + if (isset($this->context->cookie->{$prefix.$this->table.'Orderby'})) + unset($this->context->cookie->{$prefix.$this->table.'Orderby'}); - if (isset($this->context->cookie->{$this->table.'Orderway'})) - unset($this->context->cookie->{$this->table.'Orderway'}); + if (isset($this->context->cookie->{$prefix.$this->table.'Orderway'})) + unset($this->context->cookie->{$prefix.$this->table.'Orderway'}); unset($_POST); $this->_filter = false; @@ -903,7 +958,8 @@ class AdminControllerCore extends Controller continue; // Check if field is required - if (isset($values['required']) && $values['required'] && !empty($_POST['multishopOverrideOption'][$field])) + if ((!Shop::isFeatureActive() && isset($values['required']) && $values['required']) + || (Shop::isFeatureActive() && isset($_POST['multishopOverrideOption'][$field]) && isset($values['required']) && $values['required'])) if (isset($values['type']) && $values['type'] == 'textLang') { foreach ($languages as $language) @@ -1027,8 +1083,13 @@ class AdminControllerCore extends Controller 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token, 'desc' => $this->l('Add new') ); + if ($this->allow_export) + $this->toolbar_btn['export'] = array( + 'href' => self::$currentIndex.'&export'.$this->table.'&token='.$this->token, + 'desc' => $this->l('Export') + ); } - + $this->addToolBarModulesListButton(); } /** @@ -1048,7 +1109,7 @@ class AdminControllerCore extends Controller if (Validate::isLoadedObject($this->object)) return $this->object; // throw exception - $this->errors[] = Tools::displayError('Object cannot be loaded (not found)'); + $this->errors[] = Tools::displayError('The object cannot be loaded (or found)'); return false; } elseif ($opt) @@ -1059,7 +1120,7 @@ class AdminControllerCore extends Controller } else { - $this->errors[] = Tools::displayError('Object cannot be loaded (identifier missing or invalid)'); + $this->errors[] = Tools::displayError('The object cannot be loaded (the dentifier is missing or invalid)'); return false; } @@ -1120,10 +1181,14 @@ class AdminControllerCore extends Controller header('Location: '.$this->redirect_after); exit; } + public function display() { - $this->context->smarty->assign('display_header', $this->display_header); - $this->context->smarty->assign('display_footer', $this->display_footer); + $this->context->smarty->assign(array( + 'display_header' => $this->display_header, + 'display_footer' => $this->display_footer, + ) + ); // Use page title from meta_title if it has been set else from the breadcrumbs array if (!$this->meta_title) @@ -1132,8 +1197,7 @@ class AdminControllerCore extends Controller $tpl_action = $this->tpl_folder.$this->display.'.tpl'; - // Check if action template has been override - + // Check if action template has been overriden foreach ($this->context->smarty->getTemplateDir() as $template_dir) if (file_exists($template_dir.DIRECTORY_SEPARATOR.$tpl_action) && $this->display != 'view' && $this->display != 'options') { @@ -1152,41 +1216,15 @@ class AdminControllerCore extends Controller $page = $this->content; if ($conf = Tools::getValue('conf')) - if ($this->json) - $this->context->smarty->assign('conf', Tools::jsonEncode($this->_conf[(int)$conf])); - else - $this->context->smarty->assign('conf', $this->_conf[(int)$conf]); + $this->context->smarty->assign('conf', $this->json ? Tools::jsonEncode($this->_conf[(int)$conf]) : $this->_conf[(int)$conf]); + foreach (array('errors', 'warnings', 'informations', 'confirmations') as $type) + $this->context->smarty->assign($type, $this->json ? Tools::jsonEncode(array_unique($this->$type)) : array_unique($this->$type)); - if ($this->json) - $this->context->smarty->assign('errors', Tools::jsonEncode($this->errors)); - else - $this->context->smarty->assign('errors', $this->errors); - - if ($this->json) - $this->context->smarty->assign('warnings', Tools::jsonEncode($this->warnings)); - else - $this->context->smarty->assign('warnings', $this->warnings); - - - if ($this->json) - $this->context->smarty->assign('informations', Tools::jsonEncode($this->informations)); - else - $this->context->smarty->assign('informations', $this->informations); - - if ($this->json) - $this->context->smarty->assign('confirmations', Tools::jsonEncode($this->confirmations)); - else - $this->context->smarty->assign('confirmations', $this->confirmations); - - if ($this->json) - $this->context->smarty->assign('page', Tools::jsonEncode($page)); - else - $this->context->smarty->assign('page', $page); + $this->context->smarty->assign('page', $this->json ? Tools::jsonEncode($page) : $page); $this->smartyOutputContent($this->layout); } - /** * add a warning message to display at the top of the page * @@ -1248,7 +1286,7 @@ class AdminControllerCore extends Controller $current_id = Tab::getCurrentParentId(); foreach ($tabs as $index => $tab) { - if ($tab['class_name'] == 'AdminStock' && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 0) + if (($tab['class_name'] == 'AdminStock' && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 0) || $tab['class_name'] == 'AdminCarrierWizard') { unset($tabs[$index]); continue; @@ -1288,11 +1326,13 @@ class AdminControllerCore extends Controller foreach ($sub_tabs as $index2 => $sub_tab) { // class_name is the name of the class controller - if (Tab::checkTabRights($sub_tab['id_tab']) === true - && (bool)$sub_tab['active']) + if (Tab::checkTabRights($sub_tab['id_tab']) === true && (bool)$sub_tab['active'] && $sub_tab['class_name'] != 'AdminCarrierWizard') + { $sub_tabs[$index2]['href'] = $this->context->link->getAdminLink($sub_tab['class_name']); + $sub_tabs[$index2]['current'] = ($sub_tab['class_name'].'Controller' == get_class($this)); + } else - unset($sub_tabs[$index2]); + unset($sub_tabs[$index2]); } $tabs[$index]['sub_tabs'] = $sub_tabs; @@ -1384,13 +1424,14 @@ class AdminControllerCore extends Controller { if (!$this->viewAccess()) { - $this->errors[] = Tools::displayError('You do not have permission to view here.'); + $this->errors[] = Tools::displayError('You do not have permission to view this.'); return; } $this->getLanguages(); // toolbar (save, cancel, new, ..) $this->initToolbar(); + $this->initTabModuleList(); if ($this->display == 'edit' || $this->display == 'add') { if (!$this->loadObject(true)) @@ -1407,7 +1448,7 @@ class AdminControllerCore extends Controller } elseif (!$this->ajax) { - + $this->content .= $this->renderModulesList(); $this->content .= $this->renderList(); $this->content .= $this->renderOptions(); @@ -1421,6 +1462,39 @@ class AdminControllerCore extends Controller 'url_post' => self::$currentIndex.'&token='.$this->token, )); } + + /** + * init tab modules list and add button in toolbar + */ + protected function initTabModuleList() + { + if (!$this->isFresh(Module::CACHE_FILE_TAB_MODULES_LIST, 604800)) + $this->refresh(Module::CACHE_FILE_TAB_MODULES_LIST, 'http://'.Tab::TAB_MODULE_LIST_URL); + + $this->tab_modules_list = Tab::getTabModulesList($this->id); + + if (is_array($this->tab_modules_list['default_list']) && count($this->tab_modules_list['default_list'])) + $this->filter_modules_list = $this->tab_modules_list['default_list']; + elseif (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list'])) + { + $this->addToolBarModulesListButton(); + $this->context->smarty->assign(array( + 'tab_modules_list' => implode(',', $this->tab_modules_list['slider_list']), + 'admin_module_ajax_url' => $this->context->link->getAdminLink('AdminModules'), + 'back_tab_modules_list' => $this->context->link->getAdminLink(Tools::getValue('controller')), + 'tab_modules_open' => (int)Tools::getValue('tab_modules_open') + )); + } + } + + protected function addToolBarModulesListButton() + { + if (is_array($this->tab_modules_list['slider_list']) && count($this->tab_modules_list['slider_list'])) + $this->toolbar_btn['modules-list'] = array( + 'href' => '#', + 'desc' => $this->l('Modules List') + ); + } /** * initialize the invalid doom page of death @@ -1447,7 +1521,17 @@ class AdminControllerCore extends Controller 'iso_is_fr' => strtoupper($this->context->language->iso_code) == 'FR', )); } - + + public function renderModulesList() + { + if ($this->getModulesList($this->filter_modules_list)) + { + $helper = new Helper(); + return $helper->renderModulesList($this->modules_list); + } + } + + /** * Function used to render the list to display for this controller */ @@ -1457,11 +1541,14 @@ class AdminControllerCore extends Controller return false; $this->getList($this->context->language->id); + $helper = new HelperList(); + // Empty list is ok if (!is_array($this->_list)) + { + $this->displayWarning($this->l('Bad SQL query', 'Helper').'
        '.htmlspecialchars($this->_list_error)); return false; - - $helper = new HelperList(); + } $this->setHelperDisplay($helper); $helper->tpl_vars = $this->tpl_list_vars; @@ -1473,7 +1560,7 @@ class AdminControllerCore extends Controller if (!in_array($action, $this->actions) && isset($this->$action) && $this->$action) $this->actions[] = $action; } - + $helper->is_cms = $this->is_cms; $list = $helper->generateList($this->_list, $this->fields_list); return $list; @@ -1600,9 +1687,12 @@ class AdminControllerCore extends Controller $helper->multiple_fieldsets = $this->multiple_fieldsets; $helper->row_hover = $this->row_hover; $helper->position_identifier = $this->position_identifier; + $helper->controller_name = $this->controller_name; // For each action, try to add the corresponding skip elements list $helper->list_skip_actions = $this->list_skip_actions; + + $this->helper = $helper; } public function setMedia() @@ -1670,15 +1760,16 @@ class AdminControllerCore extends Controller $this->ajax = '1'; /* Server Params */ - $protocol_link = (Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; - $protocol_content = (isset($useSSL) && $useSSL && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; + $protocol_link = (Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; + $protocol_content = (Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; + $this->context->link = new Link($protocol_link, $protocol_content); if (isset($_GET['logout'])) $this->context->employee->logout(); if ($this->controller_name != 'AdminLogin' && (!isset($this->context->employee) || !$this->context->employee->isLoggedBack())) - Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').(!isset($_GET['logout']) ? '&redirect='.$this->controller_name : '')); + Tools::redirectAdmin($this->context->link->getAdminLink('AdminLogin').((!isset($_GET['logout']) && $this->controller_name != 'AdminNotFound') ? '&redirect='.$this->controller_name : '')); // Set current index $current_index = 'index.php'.(($controller = Tools::getValue('controller')) ? '?controller='.$controller : ''); @@ -1702,6 +1793,7 @@ class AdminControllerCore extends Controller 'table' => $this->table, 'current' => self::$currentIndex, 'token' => $this->token, + 'stock_management' => (int)Configuration::get('PS_STOCK_MANAGEMENT') )); if ($this->display_header) @@ -1805,7 +1897,7 @@ class AdminControllerCore extends Controller if ($this->tabAccess['delete'] === '1') $this->action = 'delete_image'; else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } /* Delete object */ elseif (isset($_GET['delete'.$this->table])) @@ -1813,7 +1905,7 @@ class AdminControllerCore extends Controller if ($this->tabAccess['delete'] === '1') $this->action = 'delete'; else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } /* Change object statuts (active, inactive) */ elseif ((isset($_GET['status'.$this->table]) || isset($_GET['status'])) && Tools::getValue($this->identifier)) @@ -1821,7 +1913,7 @@ class AdminControllerCore extends Controller if ($this->tabAccess['edit'] === '1') $this->action = 'status'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } /* Move an object */ elseif (isset($_GET['position'])) @@ -1829,7 +1921,7 @@ class AdminControllerCore extends Controller if ($this->tabAccess['edit'] == '1') $this->action = 'position'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::getValue('submitAdd'.$this->table) || Tools::getValue('submitAdd'.$this->table.'AndStay') @@ -1847,7 +1939,7 @@ class AdminControllerCore extends Controller $this->display = 'list'; } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } // case 2: creating new entry else @@ -1861,7 +1953,7 @@ class AdminControllerCore extends Controller $this->display = 'list'; } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } elseif (isset($_GET['add'.$this->table])) @@ -1872,13 +1964,13 @@ class AdminControllerCore extends Controller $this->display = 'add'; } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } elseif (isset($_GET['update'.$this->table]) && isset($_GET[$this->identifier])) { $this->display = 'edit'; if ($this->tabAccess['edit'] !== '1') - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (isset($_GET['view'.$this->table])) { @@ -1888,7 +1980,12 @@ class AdminControllerCore extends Controller $this->action = 'view'; } else - $this->errors[] = Tools::displayError('You do not have permission to view here.'); + $this->errors[] = Tools::displayError('You do not have permission to view this.'); + } + elseif (isset($_GET['export'.$this->table])) + { + if ($this->tabAccess['view'] === '1') + $this->action = 'export'; } /* Cancel all filters for this tab */ elseif (isset($_POST['submitReset'.$this->table])) @@ -1900,7 +1997,7 @@ class AdminControllerCore extends Controller if ($this->tabAccess['edit'] === '1') $this->action = 'update_options'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::isSubmit('submitFields') && $this->required_database && $this->tabAccess['add'] === '1' && $this->tabAccess['delete'] === '1') $this->action = 'update_fields'; @@ -1915,7 +2012,7 @@ class AdminControllerCore extends Controller $this->boxes = Tools::getValue($this->table.'Box'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); break; } elseif (Tools::isSubmit('submitBulk')) @@ -1926,7 +2023,7 @@ class AdminControllerCore extends Controller $this->boxes = Tools::getValue($this->table.'Box'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); break; } } @@ -1959,11 +2056,11 @@ class AdminControllerCore extends Controller if (!Validate::isTableOrIdentifier($this->table)) throw new PrestaShopException(sprintf('Table name %s is invalid:', $this->table)); - + $prefix = str_replace(array('admin', 'controller'), '', Tools::strtolower(get_class($this))); if (empty($order_by)) { - if ($this->context->cookie->{$this->table.'Orderby'}) - $order_by = $this->context->cookie->{$this->table.'Orderby'}; + if ($this->context->cookie->{$prefix.$this->table.'Orderby'}) + $order_by = $this->context->cookie->{$prefix.$this->table.'Orderby'}; elseif ($this->_orderBy) $order_by = $this->_orderBy; else @@ -1972,8 +2069,8 @@ class AdminControllerCore extends Controller if (empty($order_way)) { - if ($this->context->cookie->{$this->table.'Orderway'}) - $order_way = $this->context->cookie->{$this->table.'Orderway'}; + if ($this->context->cookie->{$prefix.$this->table.'Orderway'}) + $order_way = $this->context->cookie->{$prefix.$this->table.'Orderway'}; elseif ($this->_orderWay) $order_way = $this->_orderWay; else @@ -1989,6 +2086,9 @@ class AdminControllerCore extends Controller || !Validate::isUnsignedId($id_lang)) throw new PrestaShopException('get list params is not valid'); + if (isset($this->fields_list[$order_by]) && isset($this->fields_list[$order_by]['filter_key'])) + $order_by = $this->fields_list[$order_by]['filter_key']; + /* Determine offset from current page */ if ((isset($_POST['submitFilter'.$this->table]) || isset($_POST['submitFilter'.$this->table.'_x']) || @@ -1999,7 +2099,15 @@ class AdminControllerCore extends Controller /* Cache */ $this->_lang = (int)$id_lang; - $this->_orderBy = (strpos($order_by, '.') !== false) ? substr($order_by, strpos($order_by, '.') + 1) : $order_by; + + if (preg_match('/[.!]/', $order_by)) + { + $order_by_split = preg_split('/[.!]/', $order_by); + $order_by = pSQL($order_by_split[0]).'.`'.pSQL($order_by_split[1]).'`'; + $this->_orderBy = (isset($order_by_split) && isset($order_by_split[1])) ? $order_by_split[1] : $order_by; + } + else + $this->_orderBy = $order_by; $this->_orderWay = Tools::strtoupper($order_way); /* SQL table : orders, but class name is Order */ @@ -2058,11 +2166,7 @@ class AdminControllerCore extends Controller $having_clause .= $this->_having.' '; } - if (strpos($order_by, '.') > 0) - { - $order_by = explode('.', $order_by); - $order_by = pSQL($order_by[0]).'.`'.pSQL($order_by[1]).'`'; - } + $this->_listsql = ' SELECT SQL_CALC_FOUND_ROWS @@ -2087,9 +2191,9 @@ class AdminControllerCore extends Controller } else $this->_listsql .= ($this->lang ? 'b.*,' : '').' a.*'; - + $this->_listsql .= ' - '.(isset($this->_select) ? ', '.$this->_select : '').$select_shop.' + '.(isset($this->_select) ? ', '.rtrim($this->_select, ', ') : '').$select_shop.' FROM `'._DB_PREFIX_.$sql_table.'` a '.$lang_join.' '.(isset($this->_join) ? $this->_join.' ' : '').' @@ -2102,8 +2206,48 @@ class AdminControllerCore extends Controller ($this->_tmpTableFilter ? ') tmpTable WHERE 1'.$this->_tmpTableFilter : ''). (($use_limit === true) ? ' LIMIT '.(int)$start.','.(int)$limit : ''); - $this->_list = Db::getInstance()->executeS($this->_listsql); - $this->_listTotal = Db::getInstance()->getValue('SELECT FOUND_ROWS() AS `'._DB_PREFIX_.$this->table.'`'); + if (!($this->_list = Db::getInstance()->executeS($this->_listsql))) + $this->_list_error = Db::getInstance()->getMsgError(); + else + $this->_listTotal = Db::getInstance()->getValue('SELECT FOUND_ROWS() AS `'._DB_PREFIX_.$this->table.'`'); + } + + public function getModulesList($filter_modules_list) + { + if (!is_array($filter_modules_list) && !is_null($filter_modules_list)) + $filter_modules_list = array($filter_modules_list); + + if (!count($filter_modules_list)) + return false; //if there is no modules to display just return false; + + $all_modules = Module::getModulesOnDisk(true); + $this->modules_list = array(); + foreach ($all_modules as $module) + { + $perm = true; + if ($module->id) + $perm &= Module::getPermissionStatic($module->id, 'configure'); + else + { + $id_admin_module = Tab::getIdFromClassName('AdminModules'); + $access = Profile::getProfileAccess($this->context->employee->id_profile, $id_admin_module); + if (!$access['edit']) + $perm &= false; + } + + if (in_array($module->name, $filter_modules_list) && $perm) + { + $this->fillModuleData($module, 'select'); + $this->modules_list[array_search($module->name, $filter_modules_list)] = $module; + } + } + ksort($this->modules_list); + + if (count($this->modules_list)) + return true; + + return false; //no module found on disk just return false; + } public function getLanguages() @@ -2167,7 +2311,7 @@ class AdminControllerCore extends Controller else { $fieldValue = $this->getFieldValue($obj, $input['name']); - if (empty($fieldValue) && isset($input['default_value'])) + if ($fieldValue === false && isset($input['default_value'])) $fieldValue = $input['default_value']; $this->fields_value[$input['name']] = $fieldValue; } @@ -2189,9 +2333,9 @@ class AdminControllerCore extends Controller public function getFieldValue($obj, $key, $id_lang = null) { if ($id_lang) - $default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : ''; + $default_value = ($obj->id && isset($obj->{$key}[$id_lang])) ? $obj->{$key}[$id_lang] : false; else - $default_value = isset($obj->{$key}) ? $obj->{$key} : ''; + $default_value = isset($obj->{$key}) ? $obj->{$key} : false; return Tools::getValue($key.($id_lang ? '_'.$id_lang : ''), $default_value); } @@ -2207,9 +2351,10 @@ class AdminControllerCore extends Controller $class_name = $this->className; /* Class specific validation rules */ - $rules = call_user_func(array($class_name, 'getValidationRules'), $class_name); + if (!empty($class_name)) + $rules = call_user_func(array($class_name, 'getValidationRules'), $class_name); - if ((count($rules['requiredLang']) || count($rules['sizeLang']) || count($rules['validateLang']))) + if (isset($rules) && count($rules) && (count($rules['requiredLang']) || count($rules['sizeLang']) || count($rules['validateLang']))) { /* Language() instance determined by default language */ $default_language = new Language((int)Configuration::get('PS_LANG_DEFAULT')); @@ -2219,82 +2364,88 @@ class AdminControllerCore extends Controller } /* Checking for required fields */ - foreach ($rules['required'] as $field) - if (($value = Tools::getValue($field)) == false && (string)$value != '0') - if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture')) - $this->errors[] = sprintf( - Tools::displayError('The field %s is required.'), - call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) - ); + if (isset($rules['required']) && is_array($rules['required'])) + foreach ($rules['required'] as $field) + if (($value = Tools::getValue($field)) == false && (string)$value != '0') + if (!Tools::getValue($this->identifier) || ($field != 'passwd' && $field != 'no-picture')) + $this->errors[] = sprintf( + Tools::displayError('The %s field is required.'), + call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) + ); /* Checking for multilingual required fields */ - foreach ($rules['requiredLang'] as $field_lang) - if (($empty = Tools::getValue($field_lang.'_'.$default_language->id)) === false || $empty !== '0' && empty($empty)) - $this->errors[] = sprintf( - Tools::displayError('The field %1$s is required at least in %2$s.'), - call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), - $default_language->name - ); + if (isset($rules['requiredLang']) && is_array($rules['requiredLang'])) + foreach ($rules['requiredLang'] as $field_lang) + if (($empty = Tools::getValue($field_lang.'_'.$default_language->id)) === false || $empty !== '0' && empty($empty)) + $this->errors[] = sprintf( + Tools::displayError('The field %1$s is required at least in %2$s.'), + call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), + $default_language->name + ); /* Checking for maximum fields sizes */ - foreach ($rules['size'] as $field => $max_length) - if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length) - $this->errors[] = sprintf( - Tools::displayError('The field %1$s is too long (%2$d chars max).'), - call_user_func(array($class_name, 'displayFieldName'), $field, $class_name), - $max_length - ); - - /* Checking for maximum multilingual fields size */ - foreach ($rules['sizeLang'] as $field_lang => $max_length) - foreach ($languages as $language) - { - $field_lang_value = Tools::getValue($field_lang.'_'.$language['id_lang']); - if ($field_lang_value !== false && Tools::strlen($field_lang_value) > $max_length) + if (isset($rules['size']) && is_array($rules['size'])) + foreach ($rules['size'] as $field => $max_length) + if (Tools::getValue($field) !== false && Tools::strlen(Tools::getValue($field)) > $max_length) $this->errors[] = sprintf( - Tools::displayError('The field %1$s (%2$s) is too long (%3$d chars max, html chars including).'), - call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), - $language['name'], + Tools::displayError('The %1$s field is too long (%2$d chars max).'), + call_user_func(array($class_name, 'displayFieldName'), $field, $class_name), $max_length ); - } + + /* Checking for maximum multilingual fields size */ + if (isset($rules['sizeLang']) && is_array($rules['sizeLang'])) + foreach ($rules['sizeLang'] as $field_lang => $max_length) + foreach ($languages as $language) + { + $field_lang_value = Tools::getValue($field_lang.'_'.$language['id_lang']); + if ($field_lang_value !== false && Tools::strlen($field_lang_value) > $max_length) + $this->errors[] = sprintf( + Tools::displayError('The field %1$s (%2$s) is too long (%3$d chars max, html chars including).'), + call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), + $language['name'], + $max_length + ); + } /* Overload this method for custom checking */ $this->_childValidation(); /* Checking for fields validity */ - foreach ($rules['validate'] as $field => $function) - if (($value = Tools::getValue($field)) !== false && ($field != 'passwd')) - if (!Validate::$function($value) && !empty($value)) - $this->errors[] = sprintf( - Tools::displayError('The field %s is invalid.'), - call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) - ); + if (isset($rules['validate']) && is_array($rules['validate'])) + foreach ($rules['validate'] as $field => $function) + if (($value = Tools::getValue($field)) !== false && ($field != 'passwd')) + if (!Validate::$function($value) && !empty($value)) + $this->errors[] = sprintf( + Tools::displayError('The %s field is invalid.'), + call_user_func(array($class_name, 'displayFieldName'), $field, $class_name) + ); /* Checking for passwd_old validity */ if (($value = Tools::getValue('passwd')) != false) { if ($class_name == 'Employee' && !Validate::isPasswdAdmin($value)) $this->errors[] = sprintf( - Tools::displayError('The field %s is invalid.'), + Tools::displayError('The %s field is invalid.'), call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name) ); elseif ($class_name == 'Customer' && !Validate::isPasswd($value)) $this->errors[] = sprintf( - Tools::displayError('The field %s is invalid.'), + Tools::displayError('The %s field is invalid.'), call_user_func(array($class_name, 'displayFieldName'), 'passwd', $class_name) ); } /* Checking for multilingual fields validity */ - foreach ($rules['validateLang'] as $field_lang => $function) - foreach ($languages as $language) - if (($value = Tools::getValue($field_lang.'_'.$language['id_lang'])) !== false && !empty($value)) - if (!Validate::$function($value)) - $this->errors[] = sprintf( - Tools::displayError('The field %1$s (%2$s) is invalid.'), - call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), - $language['name'] - ); + if (isset($rules['validateLang']) && is_array($rules['validateLang'])) + foreach ($rules['validateLang'] as $field_lang => $function) + foreach ($languages as $language) + if (($value = Tools::getValue($field_lang.'_'.$language['id_lang'])) !== false && !empty($value)) + if (!Validate::$function($value)) + $this->errors[] = sprintf( + Tools::displayError('The %1$s field (%2$s) is invalid.'), + call_user_func(array($class_name, 'displayFieldName'), $field_lang, $class_name), + $language['name'] + ); } /** @@ -2508,11 +2659,11 @@ class AdminControllerCore extends Controller // Evaluate the memory required to resize the image: if it's too much, you can't resize it. if (!ImageManager::checkImageMemoryLimit($tmp_name)) - $this->errors[] = Tools::displayError('This image cannot be loaded due to memory limit restrictions, please increase your memory_limit value on your server configuration.'); + $this->errors[] = Tools::displayError('Due to memory limit restrictions, this image cannot be loaded. Please increase your memory_limit value via your server\'s configuration settings. '); // Copy new image if (empty($this->errors) && !ImageManager::resize($tmp_name, _PS_IMG_DIR_.$dir.$id.'.'.$this->imageType, (int)$width, (int)$height, ($ext ? $ext : $this->imageType))) - $this->errors[] = Tools::displayError('An error occurred while uploading image.'); + $this->errors[] = Tools::displayError('An error occurred while uploading the image.'); if (count($this->errors)) return false; @@ -2550,21 +2701,34 @@ class AdminControllerCore extends Controller else { $result = true; - if ($this->deleted) + foreach ($this->boxes as $id) { - foreach ($this->boxes as $id) + $to_delete = new $this->className($id); + $delete_ok = true; + if ($this->deleted) { - $to_delete = new $this->className($id); $to_delete->deleted = 1; - $result = $result && $to_delete->update(); + if (!$to_delete->update()) + { + $result = false; + $delete_ok = false; + } } + else + if (!$to_delete->delete()) + { + $result = false; + $delete_ok = false; + } + + if ($delete_ok) + Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$to_delete->id, true, (int)$this->context->employee->id); + else + $this->errors[] = sprintf(Tools::displayError('Can\'t delete #%d'), $id); } - else - $result = $object->deleteSelection(Tools::getValue($this->table.'Box')); - if ($result) $this->redirect_after = self::$currentIndex.'&conf=2&token='.$this->token; - $this->errors[] = Tools::displayError('An error occurred while deleting selection.'); + $this->errors[] = Tools::displayError('An error occurred while deleting this selection.'); } } else @@ -2722,72 +2886,118 @@ class AdminControllerCore extends Controller { $content = Tools::file_get_contents($external_file); if ($content) - return file_put_contents(_PS_ROOT_DIR_.$file_to_refresh, $content); + return (bool)file_put_contents(_PS_ROOT_DIR_.$file_to_refresh, $content); return false; } - - public function addonsRequest($request, $params = array()) + + public function fillModuleData(&$module, $output_type = 'link', $back = null) { - // Config for each request - if ($request == 'native') - { - // Define protocol accepted and post data values for this request - $protocolsList = array('https://' => 443, 'http://' => 80); - $postData = 'version='._PS_VERSION_.'&method=listing&action=native&iso_code='.strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))).'&iso_lang='.strtolower(Context::getContext()->language->iso_code); - } - if ($request == 'must-have') - { - // Define protocol accepted and post data values for this request - $protocolsList = array('https://' => 443, 'http://' => 80); - $postData = 'version='._PS_VERSION_.'&method=listing&action=must-have&iso_code='.strtolower(Country::getIsoById(Configuration::get('PS_COUNTRY_DEFAULT'))).'&iso_lang='.strtolower(Context::getContext()->language->iso_code); - } - if ($request == 'customer') - { - // Define protocol accepted and post data values for this request - $protocolsList = array('https://' => 443); - $postData = 'version='._PS_VERSION_.'&method=listing&action=customer&username='.pSQL(trim($this->context->cookie->username_addons)).'&password='.pSQL(trim($this->context->cookie->password_addons)).'&iso_lang='.strtolower(Context::getContext()->language->iso_code); - } - if ($request == 'check_customer') - { - // Define protocol accepted and post data values for this request - $protocolsList = array('https://' => 443); - $postData = 'version='._PS_VERSION_.'&method=check_customer&username='.pSQL($params['username_addons']).'&password='.pSQL($params['password_addons']); - } - if ($request == 'module') - { - // Define protocol accepted and post data values for this request - if (isset($params['username_addons']) && isset($params['password_addons'])) - { - $protocolsList = array('https://' => 443); - $postData = 'version='._PS_VERSION_.'&method=module&id_module='.pSQL($params['id_module']).'&username='.pSQL($params['username_addons']).'&password='.pSQL($params['password_addons']); - } - else - { - $protocolsList = array('https://' => 443, 'http://' => 80); - $postData = 'version='._PS_VERSION_.'&method=module&id_module='.pSQL($params['id_module']); - } - } + $obj = null; + if ($module->onclick_option) + $obj = new $module->name(); + // Fill module data + $module->logo = '../../img/questionmark.png'; + if (file_exists('../modules/'.$module->name.'/logo.gif')) + $module->logo = 'logo.gif'; + if (file_exists('../modules/'.$module->name.'/logo.png')) + $module->logo = 'logo.png'; + $module->optionsHtml = $this->displayModuleOptions($module, $output_type); + $link_admin_modules = $this->context->link->getAdminLink('AdminModules', true); + + $module->options['install_url'] = $link_admin_modules.'&install='.urlencode($module->name).'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name); + $module->options['update_url'] = $link_admin_modules.'&update='.urlencode($module->name).'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name); + $module->options['uninstall_url'] = $link_admin_modules.'&uninstall='.urlencode($module->name).'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name); - // Make the request - $opts = array( - 'http'=>array( - 'method'=> 'POST', - 'content' => $postData, - 'header' => 'Content-type: application/x-www-form-urlencoded', - 'timeout' => 5, - ) - ); - $context = stream_context_create($opts); - foreach ($protocolsList as $protocol => $port) - { - $content = Tools::file_get_contents($protocol.$this->addons_url, false, $context); + $module->options['uninstall_onclick'] = ((!$module->onclick_option) ? + ((empty($module->confirmUninstall)) ? '' : 'return confirm(\''.addslashes($module->confirmUninstall).'\');') : + $obj->onclickOption('uninstall', $module->options['uninstall_url'])); - // If content returned, we cache it - if ($content) - return $content; - } + if ((Tools::getValue('module_name') == $module->name || in_array($module->name, explode('|', Tools::getValue('modules_list')))) && (int)Tools::getValue('conf') > 0) + $module->message = $this->_conf[(int)Tools::getValue('conf')]; - // No content, return false - return false; + if ((Tools::getValue('module_name') == $module->name || in_array($module->name, explode('|', Tools::getValue('modules_list')))) && (int)Tools::getValue('conf') > 0) + unset($obj); } -} \ No newline at end of file + + /** + * Display modules list + * + * @param $module + * @param $output_type (link or select) + * @param $back + * + * @return string + */ + protected $translationsTab = array(); + public function displayModuleOptions($module, $output_type = 'link', $back = null) + { + if (!isset($this->translationsTab['Disable this module'])) + { + $this->translationsTab['Disable this module'] = $this->l('Disable this module'); + $this->translationsTab['Enable this module for all shops'] = $this->l('Enable this module for all shops'); + $this->translationsTab['Disable'] = $this->l('Disable'); + $this->translationsTab['Enable'] = $this->l('Enable'); + $this->translationsTab['Reset'] = $this->l('Reset'); + $this->translationsTab['Configure'] = $this->l('Configure'); + $this->translationsTab['Delete'] = $this->l('Delete'); + $this->translationsTab['Install'] = $this->l('Install'); + $this->translationsTab['Uninstall'] = $this->l('Uninstall'); + $this->translationsTab['This action will permanently remove the module from the server. Are you sure you want to do this?'] = $this->l('This action will permanently remove the module from the server. Are you sure you want to do this?'); + } + $link_admin_modules = $this->context->link->getAdminLink('AdminModules', true); + $modules_options = array( + 'configure-module' => array( + 'href' => $link_admin_modules.'&configure='.urlencode($module->name).'&tab_module='.$module->tab.'&module_name='.urlencode($module->name), + 'onclick' => $module->onclick_option && isset($module->onclick_option_content['configure']) ? $module->onclick_option_content['configure'] : '', + 'title' => '', + 'text' => $this->translationsTab['Configure'], + 'cond' => $module->id && isset($module->is_configurable) && $module->is_configurable, + ), + 'desactive-module' => array( + 'href' => $link_admin_modules.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab, + 'onclick' => $module->active && $module->onclick_option && isset($module->onclick_option_content['desactive']) ? $module->onclick_option_content['desactive'] : '' , + 'title' => Shop::isFeatureActive() ? htmlspecialchars($module->active ? $this->translationsTab['Disable this module'] : $this->translationsTab['Enable this module for all shops']) : '', + 'text' => $module->active ? $this->translationsTab['Disable'] : $this->translationsTab['Enable'], + 'cond' => $module->id, + ), + 'reset-module' => array( + 'href' => $link_admin_modules.'&module_name='.urlencode($module->name).'&reset&tab_module='.$module->tab, + 'onclick' => $module->onclick_option && isset($module->onclick_option_content['reset']) ? $module->onclick_option_content['reset'] : '', + 'title' => '', + 'text' => $this->translationsTab['Reset'], + 'cond' => $module->id && $module->active, + ), + 'delete-module' => array( + 'href' => $link_admin_modules.'&delete='.urlencode($module->name).'&tab_module='.$module->tab.'&module_name='.urlencode($module->name), + 'onclick' => $module->onclick_option && isset($module->onclick_option_content['delete']) ? $module->onclick_option_content['delete'] : 'return confirm(\''.$this->translationsTab['This action will permanently remove the module from the server. Are you sure you want to do this?'].'\');', + 'title' => '', + 'text' => $this->translationsTab['Delete'], + 'cond' => true, + ), + ); + + $return = ''; + foreach ($modules_options as $option_name => $option) + { + if ($option['cond']) + { + if ($output_type == 'link') + $return .= ' + '.$option['text'].' + '; + elseif ($output_type == 'select') + $return .= ''; + } + } + if ($output_type == 'select') + { + if (!$module->id) + $return = ''.$return; + else + $return .= ''; + $return = ''; + } + + return $return; + } +} diff --git a/classes/controller/Controller.php b/classes/controller/Controller.php index 06551ff51..27ebaf040 100644 --- a/classes/controller/Controller.php +++ b/classes/controller/Controller.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -176,7 +176,7 @@ abstract class ControllerCore if ($this->ajax) { $action = Tools::getValue('action'); - if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action, true))) + if (!empty($action) && method_exists($this, 'displayAjax'.Tools::toCamelCase($action, true))) $this->{'displayAjax'.$action}(); elseif (method_exists($this, 'displayAjax')) $this->displayAjax(); @@ -187,7 +187,7 @@ abstract class ControllerCore else { $this->initCursedPage(); - $this->display(); + $this->smartyOutputContent($this->layout); } } @@ -327,15 +327,19 @@ abstract class ControllerCore foreach ($name as $plugin) { $plugin_path = Media::getJqueryPluginPath($plugin, $folder); - $this->addJS($plugin_path['js']); - $this->addCSS($plugin_path['css']); + if(!empty($plugin_path['js'])) + $this->addJS($plugin_path['js']); + if(!empty($plugin_path['css'])) + $this->addCSS($plugin_path['css']); } } else $plugin_path = Media::getJqueryPluginPath($name, $folder); - $this->addCSS($plugin_path['css']); - $this->addJS($plugin_path['js']); + if(!empty($plugin_path['css'])) + $this->addCSS($plugin_path['css']); + if(!empty($plugin_path['js'])) + $this->addJS($plugin_path['js']); } /** diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index 1b02797d6..52c090097 100755 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -108,7 +108,7 @@ class FrontControllerCore extends Controller // If current URL use SSL, set it true (used a lot for module redirect) if (Tools::usingSecureMode()) - $useSSL = $this->ssl = true; + $useSSL = true; // For compatibility with globals, DEPRECATED as of version 1.5 $css_files = $this->css_files; @@ -165,7 +165,7 @@ class FrontControllerCore extends Controller /* Theme is missing */ if (!is_dir(_PS_THEME_DIR_)) die(sprintf(Tools::displayError('Current theme unavailable "%s". Please check your theme directory name and permissions.'), basename(rtrim(_PS_THEME_DIR_, '/\\')))); - + if (Configuration::get('PS_GEOLOCATION_ENABLED')) if (($newDefault = $this->geolocationManagement($this->context->country)) && Validate::isLoadedObject($newDefault)) $this->context->country = $newDefault; @@ -252,12 +252,6 @@ class FrontControllerCore extends Controller CartRule::autoAddToCart($this->context); } - $locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8'); - setlocale(LC_COLLATE, $locale); - setlocale(LC_CTYPE, $locale); - setlocale(LC_TIME, $locale); - setlocale(LC_NUMERIC, 'en_US.UTF-8'); - /* get page name to display it in body id */ // Are we in a payment module @@ -269,7 +263,7 @@ class FrontControllerCore extends Controller $page_name = $this->page_name; elseif (!empty($this->php_self)) $page_name = $this->php_self; - elseif (Tools::getValue('fc') == 'module' && $module_name != '' && is_a($module_name, 'PaymentModule')) + elseif (Tools::getValue('fc') == 'module' && $module_name != '' && (Module::getInstanceByName($module_name) instanceof PaymentModule)) $page_name = 'module-payment-submit'; // @retrocompatibility Are we in a module ? elseif (preg_match('#^'.preg_quote($this->context->shop->physical_uri, '#').'modules/([a-zA-Z0-9_-]+?)/(.*)$#', $_SERVER['REQUEST_URI'], $m)) @@ -298,6 +292,7 @@ class FrontControllerCore extends Controller { $infos = Address::getCountryAndState((int)($cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')})); $country = new Country((int)$infos['id_country']); + $this->context->country = $country; if (Validate::isLoadedObject($country)) $display_tax_label = $country->display_tax_label; } @@ -335,6 +330,7 @@ class FrontControllerCore extends Controller 'shop_name' => Configuration::get('PS_SHOP_NAME'), 'roundMode' => (int)Configuration::get('PS_PRICE_ROUND_MODE'), 'use_taxes' => (int)Configuration::get('PS_TAX'), + 'show_taxes' => (int)(Configuration::get('PS_TAX_DISPLAY') == 1 && (int)Configuration::get('PS_TAX')), 'display_tax_label' => (bool)$display_tax_label, 'vat_management' => (int)Configuration::get('VATNUMBER_MANAGEMENT'), 'opc' => (bool)Configuration::get('PS_ORDER_PROCESS_TYPE'), @@ -401,35 +397,16 @@ class FrontControllerCore extends Controller if ($this->restrictedCountry) $this->displayRestrictedCountryPage(); - //live edit - if (Tools::isSubmit('live_edit') && ($ad = Tools::getValue('ad')) && Tools::getValue('liveToken') == Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee'))) - if (!is_dir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.$ad)) - die(Tools::displayError()); + if (Tools::isSubmit('live_edit') && !$this->checkLiveEditAccess()) + Tools::redirect('index.php?controller=404'); $this->iso = $iso; - $this->setMedia(); $this->context->cart = $cart; $this->context->currency = $currency; } - + public function postProcess() - { - /*// For retrocompatibility with versions before 1.5, preProcess support will be removed on next release - if (method_exists(get_class($this), 'preProcess')) - { - $reflection = new ReflectionClass($this); - if (!in_array($reflection->getMethod('preProcess')->class, array('FrontController', 'FrontControllerCore'))) - { - Tools::displayAsDeprecated('Method preProcess() is deprecated in controllers, use method postProcess() instead'); - $this->preProcess(); - } - }*/ - - //$this->preProcess(); - } - - public function preProcess() { } @@ -548,23 +525,24 @@ class FrontControllerCore extends Controller 'display_header' => $this->display_header, 'display_footer' => $this->display_footer, )); - + + $live_edit_content = ''; // Don't use live edit if on mobile device - if ($this->context->getMobileDevice() == false && Tools::isSubmit('live_edit')) - $this->context->smarty->assign('live_edit', $this->getLiveEditFooter()); - + if (!$this->context->getMobileDevice() && $this->checkLiveEditAccess()) + $live_edit_content = $this->getLiveEditFooter(); + $layout = $this->getLayout(); if ($layout) { if ($this->template) - $this->context->smarty->assign('template', $this->context->smarty->fetch($this->template)); + $this->context->smarty->assign('template', $this->context->smarty->fetch($this->template).$live_edit_content); else // For retrocompatibility with 1.4 controller { ob_start(); $this->displayContent(); $template = ob_get_contents(); ob_clean(); - $this->context->smarty->assign('template', $template); + $this->context->smarty->assign('template', $template.$live_edit_content); } $this->smartyOutputContent($layout); } @@ -582,34 +560,23 @@ class FrontControllerCore extends Controller if ($this->display_footer) $this->smartyOutputContent(_PS_THEME_DIR_.'footer.tpl'); - - // live edit - if (Tools::isSubmit('live_edit') && ($ad = Tools::getValue('ad')) && Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee'))) - { - $this->context->smarty->assign(array('ad' => $ad, 'live_edit' => true)); - $this->smartyOutputContent(_PS_ALL_THEMES_DIR_.'live_edit.tpl'); - } // END - 1.4 retrocompatibility - will be removed in 1.6 } - + return true; } /* Display a maintenance page if shop is closed */ protected function displayMaintenancePage() { - if ($this->maintenance == true || (basename($_SERVER['PHP_SELF']) != 'disabled.php' && !(int)(Configuration::get('PS_SHOP_ENABLE')))) + if ($this->maintenance == true || !(int)Configuration::get('PS_SHOP_ENABLE')) { $this->maintenance = true; if (!in_array(Tools::getRemoteAddr(), explode(',', Configuration::get('PS_MAINTENANCE_IP')))) { header('HTTP/1.1 503 temporarily overloaded'); - $this->context->smarty->assign(array( - 'favicon_url' => _PS_IMG_.Configuration::get('PS_FAVICON'), - 'logo_image_width' => Configuration::get('SHOP_LOGO_WIDTH'), - 'logo_image_height' => Configuration::get('SHOP_LOGO_HEIGHT'), - 'logo_url' => _PS_IMG_.Configuration::get('PS_LOGO').'?'.Configuration::get('PS_IMG_UPDATE_TIME') - )); + + $this->context->smarty->assign($this->initLogoAndFavicon()); $template_dir = ($this->context->getMobileDevice() == true ? _PS_THEME_MOBILE_DIR_ : _PS_THEME_DIR_); $this->smartyOutputContent($template_dir.'maintenance.tpl'); @@ -734,13 +701,13 @@ class FrontControllerCore extends Controller public function setMobileMedia() { $this->addjquery(); - $this->addJS(_THEME_MOBILE_JS_DIR_.'jquery.mobile-1.1.1.min.js'); + $this->addJS(_THEME_MOBILE_JS_DIR_.'jquery.mobile-1.3.0.min.js'); $this->addJS(_THEME_MOBILE_JS_DIR_.'jqm-docs.js'); $this->addJS(_PS_JS_DIR_.'tools.js'); $this->addJS(_THEME_MOBILE_JS_DIR_.'global.js'); - $this->addjqueryPlugin('fancybox'); + $this->addjqueryPlugin('fancybox'); - $this->addCSS(_THEME_MOBILE_CSS_DIR_.'jquery.mobile-1.1.1.min.css', 'all'); + $this->addCSS(_THEME_MOBILE_CSS_DIR_.'jquery.mobile-1.3.0.min.css', 'all'); $this->addCSS(_THEME_MOBILE_CSS_DIR_.'jqm-docs.css', 'all'); $this->addCSS(_THEME_MOBILE_CSS_DIR_.'global.css', 'all'); } @@ -754,6 +721,9 @@ class FrontControllerCore extends Controller $this->setMobileMedia(); return true; } + + if (Tools::file_exists_cache(_PS_ROOT_DIR_.Tools::str_replace_once(__PS_BASE_URI__, DIRECTORY_SEPARATOR, _THEME_CSS_DIR_.'grid_prestashop.css'))) + $this->addCSS(_THEME_CSS_DIR_.'grid_prestashop.css', 'all'); $this->addCSS(_THEME_CSS_DIR_.'global.css', 'all'); $this->addjquery(); $this->addjqueryPlugin('easing'); @@ -784,13 +754,11 @@ class FrontControllerCore extends Controller 'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'), 'static_token' => Tools::getToken(false), 'token' => Tools::getToken(), - 'logo_image_width' => Configuration::get('SHOP_LOGO_WIDTH'), - 'logo_image_height' => Configuration::get('SHOP_LOGO_HEIGHT'), 'priceDisplayPrecision' => _PS_PRICE_DISPLAY_PRECISION_, 'content_only' => (int)Tools::getValue('content_only'), - 'logo_url' => _PS_IMG_.Configuration::get('PS_LOGO').'?'.Configuration::get('PS_IMG_UPDATE_TIME'), - 'favicon_url' => _PS_IMG_.Configuration::get('PS_FAVICON'), )); + + $this->context->smarty->assign($this->initLogoAndFavicon()); } public function initFooter() @@ -804,16 +772,23 @@ class FrontControllerCore extends Controller )); } - + + public function checkLiveEditAccess() + { + if (!Tools::isSubmit('live_edit') || !Tools::getValue('ad') || !Tools::getValue('liveToken')) + return false; + if (Tools::getValue('liveToken') != Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee'))) + return false; + return is_dir(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.Tools::getValue('ad')); + } + public function getLiveEditFooter() { - if (Tools::isSubmit('live_edit') - && ($ad = Tools::getValue('ad')) - && Tools::getAdminToken('AdminModulesPositions'.(int)Tab::getIdFromClassName('AdminModulesPositions').(int)Tools::getValue('id_employee'))) + if ($this->checkLiveEditAccess()) { $data = $this->context->smarty->createData(); $data->assign(array( - 'ad' => $ad, + 'ad' => Tools::getValue('ad'), 'live_edit' => true, 'hook_list' => Hook::$executed_hooks, 'id_shop' => $this->context->shop->id @@ -874,14 +849,14 @@ class FrontControllerCore extends Controller $range = 2; /* how many pages around page selected */ - if ($this->p < 0) - $this->p = 0; + if ($this->p < 1) + $this->p = 1; if (isset($this->context->cookie->nb_item_per_page) && $this->n != $this->context->cookie->nb_item_per_page && in_array($this->n, $nArray)) $this->context->cookie->nb_item_per_page = $this->n; $pages_nb = ceil($nbProducts / (int)$this->n); - if ($this->p > $pages_nb) + if ($this->p > $pages_nb && $nbProducts <> 0) Tools::redirect(self::$link->getPaginationLink(false, false, $this->n, false, $pages_nb, false)); $start = (int)($this->p - $range); @@ -1140,4 +1115,29 @@ class FrontControllerCore extends Controller $this->context->smarty->assign($assign); $this->template = $template; } + + /** + * Return an array with specific logo and favicon, + * if mobile device + * + * @since 1.5 + * @return array + */ + public function initLogoAndFavicon() + { + $mobile_device = $this->context->getMobileDevice(); + $logo = _PS_IMG_.Configuration::get('PS_LOGO').'?'.Configuration::get('PS_IMG_UPDATE_TIME'); + + if ($mobile_device && Configuration::get('PS_LOGO_MOBILE')) + $logo = _PS_IMG_.Configuration::get('PS_LOGO_MOBILE').'?'.Configuration::get('PS_IMG_UPDATE_TIME'); + else + $logo = _PS_IMG_.Configuration::get('PS_LOGO').'?'.Configuration::get('PS_IMG_UPDATE_TIME'); + + return array( + 'favicon_url' => _PS_IMG_.Configuration::get('PS_FAVICON'), + 'logo_image_width' => ($mobile_device == false ? Configuration::get('SHOP_LOGO_WIDTH') : Configuration::get('SHOP_LOGO_MOBILE_WIDTH')), + 'logo_image_height' => ($mobile_device == false ? Configuration::get('SHOP_LOGO_HEIGHT') : Configuration::get('SHOP_LOGO_MOBILE_HEIGHT')), + 'logo_url' => $logo + ); + } } diff --git a/classes/controller/ModuleAdminController.php b/classes/controller/ModuleAdminController.php index a65c1bb9f..ba0ac7c11 100644 --- a/classes/controller/ModuleAdminController.php +++ b/classes/controller/ModuleAdminController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/controller/ModuleFrontController.php b/classes/controller/ModuleFrontController.php index 5b53494b5..0ab4932a5 100644 --- a/classes/controller/ModuleFrontController.php +++ b/classes/controller/ModuleFrontController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/controller/index.php b/classes/controller/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/controller/index.php +++ b/classes/controller/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/db/Db.php b/classes/db/Db.php old mode 100644 new mode 100755 index 2fb5b04bd..be9f1530a --- a/classes/db/Db.php +++ b/classes/db/Db.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -79,12 +79,7 @@ abstract class DbCore /** * @var array Object instance for singleton */ - protected static $_servers = array( - array('server' => _DB_SERVER_, 'user' => _DB_USER_, 'password' => _DB_PASSWD_, 'database' => _DB_NAME_), /* MySQL Master server */ - // Add here your slave(s) server(s) - // array('server' => '192.168.0.15', 'user' => 'rep', 'password' => '123456', 'database' => 'rep'), - // array('server' => '192.168.0.3', 'user' => 'myuser', 'password' => 'mypassword', 'database' => 'mydatabase'), - ); + protected static $_servers = array(); /** * Store last executed query @@ -169,6 +164,8 @@ abstract class DbCore /* do not remove, useful for some modules */ abstract public function set_db($db_name); + + abstract public function getBestEngine(); /** * Get Db object instance @@ -180,6 +177,15 @@ abstract class DbCore { static $id = 0; + // This MUST not be declared with the class members because some defines (like _DB_SERVER_) may not exist yet (the constructor can be called directly with params) + if (!self::$_servers) + self::$_servers = array( + array('server' => _DB_SERVER_, 'user' => _DB_USER_, 'password' => _DB_PASSWD_, 'database' => _DB_NAME_), /* MySQL Master server */ + // Add here your slave(s) server(s) + // array('server' => '192.168.0.15', 'user' => 'rep', 'password' => '123456', 'database' => 'rep'), + // array('server' => '192.168.0.3', 'user' => 'myuser', 'password' => 'mypassword', 'database' => 'mydatabase'), + ); + $total_servers = count(self::$_servers); if ($master || $total_servers == 1) $id_server = 0; @@ -211,7 +217,7 @@ abstract class DbCore public static function getClass() { $class = 'MySQL'; - if (extension_loaded('pdo_mysql')) + if (PHP_VERSION_ID >= 50200 && extension_loaded('pdo_mysql')) $class = 'DbPDO'; else if (extension_loaded('mysqli')) $class = 'DbMySQLi'; @@ -581,6 +587,8 @@ abstract class DbCore $result = $this->query($sql); if ($use_cache && $this->is_cache_enabled) Cache::getInstance()->deleteQuery($sql); + if (_PS_DEBUG_SQL_) + $this->displayError($sql); return $result; } @@ -672,6 +680,11 @@ abstract class DbCore return call_user_func_array(array(Db::getClass(), 'hasTableWithSamePrefix'), array($server, $user, $pwd, $db, $prefix)); } + public static function checkCreatePrivilege($server, $user, $pwd, $db, $prefix, $engine = null) + { + return call_user_func_array(array(Db::getClass(), 'checkCreatePrivilege'), array($server, $user, $pwd, $db, $prefix, $engine)); + } + /** * @deprecated 1.5.0 */ diff --git a/classes/db/DbMySQLi.php b/classes/db/DbMySQLi.php index af060a9a3..41d1d5a35 100644 --- a/classes/db/DbMySQLi.php +++ b/classes/db/DbMySQLi.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -52,6 +52,21 @@ class DbMySQLiCore extends Db return $this->link; } + + public static function createDatabase($host, $user, $password, $dbname, $dropit = false) + { + if (strpos($host, ':') !== false) + { + list($host, $port) = explode(':', $host); + $link = @new mysqli($host, $this->user, $this->password, null, $port); + } + else + $link = @new mysqli($host, $user, $password); + $success = $link->query('CREATE DATABASE `'.str_replace('`', '\\`', $dbname).'`'); + if ($dropit && ($link->query('DROP DATABASE `'.str_replace('`', '\\`', $dbname).'`') !== false)) + return true; + return $success; + } /** * @see DbCore::disconnect() @@ -169,22 +184,57 @@ class DbMySQLiCore extends Db if (!$link->options(MYSQLI_OPT_CONNECT_TIMEOUT, $timeout)) return 1; - if (!$link->real_connect($server, $user, $pwd, $db)) + // There is an @ because mysqli throw a warning when the database does not exists + if (!@$link->real_connect($server, $user, $pwd, $db)) return (mysqli_connect_errno() == 1049) ? 2 : 1; - if (strtolower($engine) == 'innodb') - { - $sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\''; - $result = $link->query($sql); - if (!$result) - return 4; - $row = $result->fetch_assoc(); - if (!$row || strtolower($row['Value']) != 'yes') - return 4; - } $link->close(); return 0; } + + public function getBestEngine() + { + $value = 'InnoDB'; + + $sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\''; + $result = $this->link->query($sql); + if (!$result) + $value = 'MyISAM'; + $row = $result->fetch_assoc(); + if (!$row || strtolower($row['Value']) != 'yes') + $value = 'MyISAM'; + + /* MySQL >= 5.6 */ + $sql = 'SHOW ENGINES'; + $result = $this->link->query($sql); + while ($row = $result->fetch_assoc()) + if ($row['Engine'] == 'InnoDB') + { + if (in_array($row['Support'], array('DEFAULT', 'YES'))) + $value = 'InnoDB'; + break; + } + return $value; + } + + public static function checkCreatePrivilege($server, $user, $pwd, $db, $prefix, $engine = null) + { + $link = @new mysqli($server, $user, $pwd, $db); + if (mysqli_connect_error()) + return false; + + $sql = ' + CREATE TABLE `'.$prefix.'test` ( + `test` tinyint(1) unsigned NOT NULL + ) ENGINE=MyISAM'; + $result = $link->query($sql); + + if (!$result) + return $link->error; + + $link->query('DROP TABLE `'.$prefix.'test`'); + return true; + } /** * @see Db::checkEncoding() diff --git a/classes/db/DbPDO.php b/classes/db/DbPDO.php index 79c3c0688..ab5d1ede8 100644 --- a/classes/db/DbPDO.php +++ b/classes/db/DbPDO.php @@ -1,217 +1,264 @@ - -* @copyright 2007-2012 PrestaShop SA -* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*/ - -/** - * This class is currently only here for tests - * - * @since 1.5.0 - */ -class DbPDOCore extends Db -{ - protected static function _getPDO($host, $user, $password, $dbname, $timeout = 5) - { - $dsn = 'mysql:'; - if ($dbname) - $dsn .= 'dbname='.$dbname.';'; - if (preg_match('/^(.*):([0-9]+)$/', $host, $matches)) - $dsn .= 'host='.$matches[1].';port='.$matches[2]; - elseif (preg_match('#^.*:(/.*)$#', $host, $matches)) - $dsn .= 'unix_socket='.$matches[1]; - else - $dsn .= 'host='.$host; - - return new PDO($dsn, $user, $password, array(PDO::ATTR_TIMEOUT => $timeout, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true)); - } - - /** - * @see DbCore::connect() - */ - public function connect() - { - try { - $this->link = $this->_getPDO($this->server, $this->user, $this->password, $this->database, 5); - } catch (PDOException $e) { - throw new PrestaShopDatabaseException(sprintf(Tools::displayError('Link to database cannot be established: %s'), $e->getMessage())); - } - - // UTF-8 support - if ($this->link->exec('SET NAMES \'utf8\'') === false) - throw new PrestaShopDatabaseException(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.')); - - return $this->link; - } - - /** - * @see DbCore::disconnect() - */ - public function disconnect() - { - unset($this->link); - } - - /** - * @see DbCore::_query() - */ - protected function _query($sql) - { - return $this->link->query($sql); - } - - /** - * @see DbCore::nextRow() - */ - public function nextRow($result = false) - { - if (!$result) - $result = $this->result; - return $result->fetch(PDO::FETCH_ASSOC); - } - - /** - * @see DbCore::_numRows() - */ - protected function _numRows($result) - { - return $result->rowCount(); - } - - /** - * @see DbCore::Insert_ID() - */ - public function Insert_ID() - { - return $this->link->lastInsertId(); - } - - /** - * @see DbCore::Affected_Rows() - */ - public function Affected_Rows() - { - return $this->result->rowCount(); - } - - /** - * @see DbCore::getMsgError() - */ - public function getMsgError($query = false) - { - $error = $this->link->errorInfo(); - return ($error[0] == '00000') ? '' : $error[2]; - } - - /** - * @see DbCore::getNumberError() - */ - public function getNumberError() - { - $error = $this->link->errorInfo(); - return isset($error[1]) ? $error[1] : 0; - } - - /** - * @see DbCore::getVersion() - */ - public function getVersion() - { - return $this->getValue('SELECT VERSION()'); - } - - /** - * @see DbCore::_escape() - */ - public function _escape($str) - { - $search = array("\\", "\0", "\n", "\r", "\x1a", "'", '"'); - $replace = array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"'); - return str_replace($search, $replace, $str); - } - - /** - * @see DbCore::set_db() - */ - public function set_db($db_name) - { - return $this->link->exec('USE '.pSQL($db_name)); - } - - /** - * @see Db::hasTableWithSamePrefix() - */ - public static function hasTableWithSamePrefix($server, $user, $pwd, $db, $prefix) - { - try { - $link = DbPDO::_getPDO($server, $user, $pwd, $db, 5); - } catch (PDOException $e) { - return false; - } - - $sql = 'SHOW TABLES LIKE \''.$prefix.'%\''; - $result = $link->query($sql); - return (bool)$result->fetch(); - } - - /** - * @see Db::checkConnection() - */ - public static function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null, $timeout = 5) - { - try { - $link = DbPDO::_getPDO($server, $user, $pwd, $db, $timeout); - } catch (PDOException $e) { - return ($e->getCode() == 1049) ? 2 : 1; - } - - if (strtolower($engine) == 'innodb') - { - $sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\''; - $result = $link->query($sql); - if (!$result) - return 4; - $row = $result->fetch(); - if (!$row || strtolower($row['Value']) != 'yes') - return 4; - } - unset($link); - return 0; - } - - /** - * @see Db::checkEncoding() - */ - public static function tryUTF8($server, $user, $pwd) - { - try { - $link = DbPDO::_getPDO($server, $user, $pwd, false, 5); - } catch (PDOException $e) { - return false; - } - $result = $link->exec('SET NAMES \'utf8\''); - unset($link); - - return ($result === false) ? false : true; - } -} + +* @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 +*/ + +/** + * @since 1.5.0 + */ +class DbPDOCore extends Db +{ + protected static function _getPDO($host, $user, $password, $dbname, $timeout = 5) + { + $dsn = 'mysql:'; + if ($dbname) + $dsn .= 'dbname='.$dbname.';'; + if (preg_match('/^(.*):([0-9]+)$/', $host, $matches)) + $dsn .= 'host='.$matches[1].';port='.$matches[2]; + elseif (preg_match('#^.*:(/.*)$#', $host, $matches)) + $dsn .= 'unix_socket='.$matches[1]; + else + $dsn .= 'host='.$host; + + return new PDO($dsn, $user, $password, array(PDO::ATTR_TIMEOUT => $timeout, PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true)); + } + + public static function createDatabase($host, $user, $password, $dbname, $dropit = false) + { + try { + $link = DbPDO::_getPDO($host, $user, $password, false); + $success = $link->exec('CREATE DATABASE `'.str_replace('`', '\\`', $dbname).'`'); + if ($dropit && ($link->exec('DROP DATABASE `'.str_replace('`', '\\`', $dbname).'`') !== false)) + return true; + } catch (PDOException $e) { + return false; + } + return $success; + } + + /** + * @see DbCore::connect() + */ + public function connect() + { + try { + $this->link = $this->_getPDO($this->server, $this->user, $this->password, $this->database, 5); + } catch (PDOException $e) { + die(sprintf(Tools::displayError('Link to database cannot be established: %s'), utf8_encode($e->getMessage()))); + } + + // UTF-8 support + if ($this->link->exec('SET NAMES \'utf8\'') === false) + die(Tools::displayError('PrestaShop Fatal error: no utf-8 support. Please check your server configuration.')); + + return $this->link; + } + + /** + * @see DbCore::disconnect() + */ + public function disconnect() + { + unset($this->link); + } + + /** + * @see DbCore::_query() + */ + protected function _query($sql) + { + return $this->link->query($sql); + } + + /** + * @see DbCore::nextRow() + */ + public function nextRow($result = false) + { + if (!$result) + $result = $this->result; + return $result->fetch(PDO::FETCH_ASSOC); + } + + /** + * @see DbCore::_numRows() + */ + protected function _numRows($result) + { + return $result->rowCount(); + } + + /** + * @see DbCore::Insert_ID() + */ + public function Insert_ID() + { + return $this->link->lastInsertId(); + } + + /** + * @see DbCore::Affected_Rows() + */ + public function Affected_Rows() + { + return $this->result->rowCount(); + } + + /** + * @see DbCore::getMsgError() + */ + public function getMsgError($query = false) + { + $error = $this->link->errorInfo(); + return ($error[0] == '00000') ? '' : $error[2]; + } + + /** + * @see DbCore::getNumberError() + */ + public function getNumberError() + { + $error = $this->link->errorInfo(); + return isset($error[1]) ? $error[1] : 0; + } + + /** + * @see DbCore::getVersion() + */ + public function getVersion() + { + return $this->getValue('SELECT VERSION()'); + } + + /** + * @see DbCore::_escape() + */ + public function _escape($str) + { + $search = array("\\", "\0", "\n", "\r", "\x1a", "'", '"'); + $replace = array("\\\\", "\\0", "\\n", "\\r", "\Z", "\'", '\"'); + return str_replace($search, $replace, $str); + } + + /** + * @see DbCore::set_db() + */ + public function set_db($db_name) + { + return $this->link->exec('USE '.pSQL($db_name)); + } + + /** + * @see Db::hasTableWithSamePrefix() + */ + public static function hasTableWithSamePrefix($server, $user, $pwd, $db, $prefix) + { + try { + $link = DbPDO::_getPDO($server, $user, $pwd, $db, 5); + } catch (PDOException $e) { + return false; + } + + $sql = 'SHOW TABLES LIKE \''.$prefix.'%\''; + $result = $link->query($sql); + return (bool)$result->fetch(); + } + + public static function checkCreatePrivilege($server, $user, $pwd, $db, $prefix, $engine = null) + { + try { + $link = DbPDO::_getPDO($server, $user, $pwd, $db, 5); + } catch (PDOException $e) { + return false; + } + + $sql = ' + CREATE TABLE `'.$prefix.'test` ( + `test` tinyint(1) unsigned NOT NULL + ) ENGINE=MyISAM'; + $result = $link->query($sql); + if (!$result) + { + $error = $link->errorInfo(); + return $error[2]; + } + $link->query('DROP TABLE `'.$prefix.'test`'); + return true; + } + + /** + * @see Db::checkConnection() + */ + public static function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null, $timeout = 5) + { + try { + $link = DbPDO::_getPDO($server, $user, $pwd, $db, $timeout); + } catch (PDOException $e) { + return ($e->getCode() == 1049) ? 2 : 1; + } + unset($link); + return 0; + } + + public function getBestEngine() + { + $value = 'InnoDB'; + + $sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\''; + $result = $this->link->query($sql); + if (!$result) + $value = 'MyISAM'; + $row = $result->fetch(); + if (!$row || strtolower($row['Value']) != 'yes') + $value = 'MyISAM'; + + /* MySQL >= 5.6 */ + $sql = 'SHOW ENGINES'; + $result = $this->link->query($sql); + while ($row = $result->fetch()) + if ($row['Engine'] == 'InnoDB') + { + if (in_array($row['Support'], array('DEFAULT', 'YES'))) + $value = 'InnoDB'; + break; + } + return $value; + } + + /** + * @see Db::checkEncoding() + */ + public static function tryUTF8($server, $user, $pwd) + { + try { + $link = DbPDO::_getPDO($server, $user, $pwd, false, 5); + } catch (PDOException $e) { + return false; + } + $result = $link->exec('SET NAMES \'utf8\''); + unset($link); + + return ($result === false) ? false : true; + } +} diff --git a/classes/db/DbQuery.php b/classes/db/DbQuery.php index 24f8ab1ef..33f199d1a 100644 --- a/classes/db/DbQuery.php +++ b/classes/db/DbQuery.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -67,7 +67,7 @@ class DbQueryCore public function from($table, $alias = null) { if (!empty($table)) - $this->query['from'] = '`'._DB_PREFIX_.$table.'`'.($alias ? ' '.$alias : ''); + $this->query['from'][] = '`'._DB_PREFIX_.$table.'`'.($alias ? ' '.$alias : ''); return $this; } @@ -220,7 +220,7 @@ class DbQueryCore if (!$this->query['from']) die('DbQuery->build() missing from clause'); - $sql .= 'FROM '.$this->query['from']."\n"; + $sql .= 'FROM '.implode(', ', $this->query['from'])."\n"; if ($this->query['join']) $sql .= implode("\n", $this->query['join'])."\n"; diff --git a/classes/db/MySQL.php b/classes/db/MySQL.php index 182872dc4..062f2608e 100644 --- a/classes/db/MySQL.php +++ b/classes/db/MySQL.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -46,6 +46,15 @@ class MySQLCore extends Db return $this->link; } + + public static function createDatabase($host, $user, $password, $dbname, $dropit = false) + { + $link = mysql_connect($host, $user, $password); + $success = mysql_query('CREATE DATABASE `'.str_replace('`', '\\`', $dbname).'`', $link); + if ($dropit && (mysql_query('DROP DATABASE `'.str_replace('`', '\\`', $dbname).'`', $link) !== false)) + return true; + return $success; + } /** * @see DbCore::disconnect() @@ -68,7 +77,12 @@ class MySQLCore extends Db */ public function nextRow($result = false) { - return mysql_fetch_assoc($result ? $result : $this->result); + $return = false; + if(is_resource($result) && $result) + $return = mysql_fetch_assoc($result); + elseif(is_resource($this->_result) && $this->_result) + $return = mysql_fetch_assoc($this->_result); + return $return; } /** @@ -160,20 +174,56 @@ class MySQLCore extends Db return 1; if (!@mysql_select_db($db, $link)) return 2; - - if (strtolower($engine) == 'innodb') - { - $sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\''; - $result = mysql_query($sql); - if (!$result) - return 4; - $row = mysql_fetch_assoc($result); - if (!$row || strtolower($row['Value']) != 'yes') - return 4; - } @mysql_close($link); return 0; } + + public function getBestEngine() + { + $value = 'InnoDB'; + + $sql = 'SHOW VARIABLES WHERE Variable_name = \'have_innodb\''; + $result = mysql_query($sql); + if (!$result) + $value = 'MyISAM'; + $row = mysql_fetch_assoc($result); + if (!$row || strtolower($row['Value']) != 'yes') + $value = 'MyISAM'; + + /* MySQL >= 5.6 */ + $sql = 'SHOW ENGINES'; + $result = mysql_query($sql); + while ($row = mysql_fetch_assoc($result)) + if ($row['Engine'] == 'InnoDB') + { + if (in_array($row['Support'], array('DEFAULT', 'YES'))) + $value = 'InnoDB'; + break; + } + return $value; + } + + public static function checkCreatePrivilege($server, $user, $pwd, $db, $prefix, $engine = null) + { + ini_set('mysql.connect_timeout', 5); + if (!$link = @mysql_connect($server, $user, $pwd, true)) + return false; + if (!@mysql_select_db($db, $link)) + return false; + + $sql = ' + CREATE TABLE `'.$prefix.'test` ( + `test` tinyint(1) unsigned NOT NULL + ) ENGINE=MyISAM'; + + $result = mysql_query($sql, $link); + + if (!$result) + return mysql_error($link); + + mysql_query('DROP TABLE `'.$prefix.'test`', $link); + return true; + } /** * @see Db::checkEncoding() diff --git a/classes/db/index.php b/classes/db/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/db/index.php +++ b/classes/db/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/exception/PrestaShopDatabaseException.php b/classes/exception/PrestaShopDatabaseException.php index 8cba0f5d6..a92faca46 100644 --- a/classes/exception/PrestaShopDatabaseException.php +++ b/classes/exception/PrestaShopDatabaseException.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/exception/PrestaShopException.php b/classes/exception/PrestaShopException.php index 4db08c4cd..1476cd612 100644 --- a/classes/exception/PrestaShopException.php +++ b/classes/exception/PrestaShopException.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,7 +34,8 @@ class PrestaShopExceptionCore extends Exception */ public function displayMessage() { - if (_PS_MODE_DEV_) + header('HTTP/1.1 500 Internal Server Error'); + if (_PS_MODE_DEV_ || defined('_PS_ADMIN_DIR_')) { // Display error message echo ''; echo '
        '; echo '

        ['.get_class($this).']

        '; - printf( - '

        %s
        at line %d in file %s

        ', - $this->getMessage(), - $this->getLine(), - ltrim(str_replace(array(_PS_ROOT_DIR_, '\\'), array('', '/'), $this->getFile()), '/') - ); + echo $this->getExentedMessage(); $this->displayFileDebug($this->getFile(), $this->getLine()); @@ -85,11 +81,12 @@ class PrestaShopExceptionCore extends Exception } else { - // If not in mode dev, launch a http 500 error - header('HTTP/1.1 500 Internal Server Error'); + // If not in mode dev, display an error page if (file_exists(_PS_ROOT_DIR_.'/error500.html')) echo file_get_contents(_PS_ROOT_DIR_.'/error500.html'); } + // Log the error in the disk + $this->logError(); exit; } @@ -140,4 +137,33 @@ class PrestaShopExceptionCore extends Exception } echo ''; } -} \ No newline at end of file + + /** + * Log the error on the disk + */ + protected function logError() + { + $logger = new FileLogger(); + $logger->setFilename(_PS_ROOT_DIR_.'/log/'.date('Ymd').'_exception.log'); + $logger->logError($this->getExentedMessage(false)); + } + + /** + * Return the content of the Exception + * @return string content of the exception + */ + protected function getExentedMessage($html = true) + { + $format = '

        %s
        at line %d in file %s

        '; + if (!$html) + $format = strip_tags(str_replace('
        ', ' ', $format)); + + return sprintf( + $format, + $this->getMessage(), + $this->getLine(), + ltrim(str_replace(array(_PS_ROOT_DIR_, '\\'), array('', '/'), $this->getFile()), '/') + ); + } + +} diff --git a/classes/exception/PrestaShopModuleException.php b/classes/exception/PrestaShopModuleException.php index f454bb35d..b050f1268 100644 --- a/classes/exception/PrestaShopModuleException.php +++ b/classes/exception/PrestaShopModuleException.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/exception/PrestaShopPaymentException.php b/classes/exception/PrestaShopPaymentException.php index dc0595aa7..2ffac6233 100644 --- a/classes/exception/PrestaShopPaymentException.php +++ b/classes/exception/PrestaShopPaymentException.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/exception/index.php b/classes/exception/index.php index ec45b2dfe..f42f03e4d 100644 --- a/classes/exception/index.php +++ b/classes/exception/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/helper/Helper.php b/classes/helper/Helper.php index f33c2cbf7..826502bc0 100755 --- a/classes/helper/Helper.php +++ b/classes/helper/Helper.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -174,7 +174,7 @@ class HelperCore $use_shop_context = false) { $translations = array( - 'selected' => $this->l('selected'), + 'selected' => $this->l('Selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All'), 'Check All' => $this->l('Check All'), @@ -239,17 +239,14 @@ class HelperCore $html .= ' - '; + '.$translations['Check All'].' + '.$translations['Uncheck All'].'' : '') + .($use_search ? ' + '.$translations['search'].': ' : '') + .'
        '; $home_is_selected = false; foreach ($selected_cat as $cat) @@ -350,6 +347,15 @@ class HelperCore return $tpl->fetch(); } + + public function renderModulesList($modules_list) + { + $this->tpl_vars = array('modules_list' => $modules_list); + $tpl = $this->createTemplate('helpers/modules_list/list.tpl'); + $tpl->assign($this->tpl_vars); + + return $tpl->fetch(); + } public static function renderShopList() { diff --git a/classes/helper/HelperForm.php b/classes/helper/HelperForm.php index 3f4340625..ff9810baf 100644 --- a/classes/helper/HelperForm.php +++ b/classes/helper/HelperForm.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/helper/HelperHelpAccess.php b/classes/helper/HelperHelpAccess.php index bdda9c415..179a3569f 100644 --- a/classes/helper/HelperHelpAccess.php +++ b/classes/helper/HelperHelpAccess.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/helper/HelperList.php b/classes/helper/HelperList.php index 1df950daa..8cbab8b4c 100644 --- a/classes/helper/HelperList.php +++ b/classes/helper/HelperList.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -60,7 +60,7 @@ class HelperListCore extends Helper /** @var array $cache_lang use to cache texts in current language */ public static $cache_lang = array(); - protected $is_cms = false; + public $is_cms = false; public $position_identifier; @@ -124,7 +124,7 @@ class HelperListCore extends Helper // Append when we get a syntax error in SQL query if ($list === false) { - $this->displayWarning($this->l('Bad SQL query', 'Helper')); + $this->context->controller->warnings[] = $this->l('Bad SQL query', 'Helper'); return false; } @@ -173,13 +173,13 @@ class HelperListCore extends Helper public function displayListContent() { - if ($this->position_identifier) - $id_category = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category', '1'); - else - $id_category = Category::getRootCategory()->id; - if (isset($this->fields_list['position'])) { + if ($this->position_identifier) + $id_category = (int)Tools::getValue('id_'.($this->is_cms ? 'cms_' : '').'category', ($this->is_cms ? '1' : Category::getRootCategory()->id )); + else + $id_category = Category::getRootCategory()->id; + $positions = array_map(create_function('$elem', 'return (int)($elem[\'position\']);'), $this->_list); sort($positions); } @@ -282,9 +282,9 @@ class HelperListCore extends Helper $this->_list[$index][$key] = Tools::displayPrice($tr[$key], $currency, false); } elseif (isset($params['type']) && $params['type'] == 'date') - $this->_list[$index][$key] = Tools::displayDate($tr[$key], $this->context->language->id); + $this->_list[$index][$key] = Tools::displayDate($tr[$key]); elseif (isset($params['type']) && $params['type'] == 'datetime') - $this->_list[$index][$key] = Tools::displayDate($tr[$key], $this->context->language->id, true); + $this->_list[$index][$key] = Tools::displayDate($tr[$key],null , true); elseif (isset($tr[$key])) { $echo = $tr[$key]; @@ -307,7 +307,7 @@ class HelperListCore extends Helper 'table' => $this->table, 'token' => $this->token, 'color_on_bg' => $this->colorOnBackground, - 'id_category' => $id_category, + 'id_category' => isset($id_category) ? $id_category : false, 'bulk_actions' => $this->bulk_actions, 'positions' => isset($positions) ? $positions : null, 'order_by' => $this->orderBy, @@ -456,7 +456,7 @@ class HelperListCore extends Helper ); if ($this->specificConfirmDelete !== false) - $data['confirm'] = !is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : self::$cache_lang['DeleteItem'].$name; + $data['confirm'] = !is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : addcslashes(Tools::htmlentitiesDecodeUTF8(self::$cache_lang['DeleteItem'].$name), '\''); $tpl->assign(array_merge($this->tpl_delete_link_vars, $data)); @@ -530,11 +530,12 @@ class HelperListCore extends Helper if ($this->position_identifier && ($this->orderBy == 'position' && $this->orderWay != 'DESC')) $table_dnd = true; + $prefix = isset($this->controller_name) ? str_replace(array('admin', 'controller'), '', Tools::strtolower($this->controller_name)) : ''; foreach ($this->fields_list as $key => $params) { if (!isset($params['type'])) $params['type'] = 'text'; - $value = Context::getContext()->cookie->{$this->table.'Filter_'.(array_key_exists('filter_key', $params) ? $params['filter_key'] : $key)}; + $value = Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.(array_key_exists('filter_key', $params) && $key != 'active' ? $params['filter_key'] : $key)}; switch ($params['type']) { case 'bool': @@ -558,9 +559,9 @@ class HelperListCore extends Helper case 'select': foreach ($params['list'] as $option_value => $option_display) { - if (isset(Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']}) - && Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']} == $option_value - && Context::getContext()->cookie->{$this->table.'Filter_'.$params['filter_key']} != '') + if (isset(Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']}) + && Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']} == $option_value + && Context::getContext()->cookie->{$prefix.$this->table.'Filter_'.$params['filter_key']} != '') $this->fields_list[$key]['select'][$option_value]['selected'] = 'selected'; } break; diff --git a/classes/helper/HelperOptions.php b/classes/helper/HelperOptions.php index a8900c36c..61010b381 100644 --- a/classes/helper/HelperOptions.php +++ b/classes/helper/HelperOptions.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -90,6 +90,9 @@ class HelperOptionsCore extends Helper $field['required'] = isset($field['required']) ? $field['required'] : $this->required; + if ($field['type'] == 'color') + $this->context->controller->addJS(_PS_JS_DIR_.'jquery/plugins/jquery.colorpicker.js'); + // Cast options values if specified if ($field['type'] == 'select' && isset($field['cast'])) foreach ($field['list'] as $option_key => $option) diff --git a/classes/helper/HelperView.php b/classes/helper/HelperView.php index 9766eb006..68d51e981 100644 --- a/classes/helper/HelperView.php +++ b/classes/helper/HelperView.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/helper/index.php b/classes/helper/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/helper/index.php +++ b/classes/helper/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/index.php b/classes/index.php index 88e934d59..195fab225 100644 --- a/classes/index.php +++ b/classes/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/log/AbstractLogger.php b/classes/log/AbstractLogger.php index c040dfbd0..e3f8e6593 100644 --- a/classes/log/AbstractLogger.php +++ b/classes/log/AbstractLogger.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/log/FileLogger.php b/classes/log/FileLogger.php index af8e1d37c..1f68df9b6 100644 --- a/classes/log/FileLogger.php +++ b/classes/log/FileLogger.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ + class FileLoggerCore extends AbstractLogger { protected $filename = ''; @@ -36,7 +37,7 @@ class FileLoggerCore extends AbstractLogger protected function logMessage($message, $level) { $formatted_message = '*'.$this->level_value[$level].'* '."\t".date('Y/m/d - H:i:s').': '.$message."\r\n"; - return file_put_contents($this->getFilename(), $formatted_message, FILE_APPEND); + return (bool)file_put_contents($this->getFilename(), $formatted_message, FILE_APPEND); } /** diff --git a/classes/log/index.php b/classes/log/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/log/index.php +++ b/classes/log/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/module/CarrierModule.php b/classes/module/CarrierModule.php index 5e6d6eb3d..5a86f2d72 100644 --- a/classes/module/CarrierModule.php +++ b/classes/module/CarrierModule.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/module/ImportModule.php b/classes/module/ImportModule.php index 6086af13f..e21e15b9c 100644 --- a/classes/module/ImportModule.php +++ b/classes/module/ImportModule.php @@ -1,15 +1,34 @@ +* @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 +*/ /** * ImportModule class, ImportModule.php * Import module management * @category classes * - * @author PrestaShop - * @copyright PrestaShop - * @license http://www.opensource.org/licenses/osl-3.0.php Open-source licence 3.0 - * @version 1.4 - * */ abstract class ImportModuleCore extends Module diff --git a/classes/module/Module.php b/classes/module/Module.php index 0d02d66ba..06d31c8e9 100644 --- a/classes/module/Module.php +++ b/classes/module/Module.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -31,6 +31,7 @@ abstract class ModuleCore /** @var float Version */ public $version; + public $database_version; /** * @since 1.5.0.1 @@ -59,7 +60,7 @@ abstract class ModuleCore /** @var int need_instance */ public $need_instance = 1; - /** @var string Admin tab correponding to the module */ + /** @var string Admin tab corresponding to the module */ public $tab = null; /** @var boolean Status */ @@ -121,6 +122,8 @@ abstract class ModuleCore const CACHE_FILE_MODULES_LIST = '/config/xml/modules_list.xml'; + const CACHE_FILE_TAB_MODULES_LIST = '/config/xml/tab_modules_list.xml'; + const CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST = '/config/xml/default_country_modules_list.xml'; const CACHE_FILE_CUSTOMER_MODULES_LIST = '/config/xml/customer_modules_list.xml'; @@ -136,8 +139,9 @@ abstract class ModuleCore public function __construct($name = null, Context $context = null) { // Load context and smarty - $this->context = $context ? $context : Context::getContext(); - $this->smarty = $this->context->smarty->createData($this->context->smarty); + $this->context = $context ? $context : Context::getContext(); + if (is_object($this->context->smarty)) + $this->smarty = $this->context->smarty->createData($this->context->smarty); // If the module has no name we gave him its id as name if ($this->name == null) @@ -149,17 +153,22 @@ abstract class ModuleCore // If cache is not generated, we generate it if (self::$modules_cache == null && !is_array(self::$modules_cache)) { - // Join clause is done to check if the module is activated in current shop context - $sql_limit_shop = 'SELECT COUNT(*) FROM `'._DB_PREFIX_.'module_shop` ms WHERE m.`id_module` = ms.`id_module` AND ms.`id_shop` = '.(int)Context::getContext()->shop->id; - $sql = 'SELECT m.`id_module`, m.`name`, ('.$sql_limit_shop.') as total FROM `'._DB_PREFIX_.'module` m'; - - // Result is cached + $id_shop = (Validate::isLoadedObject($this->context->shop) ? $this->context->shop->id : 1); self::$modules_cache = array(); - $result = Db::getInstance()->executeS($sql); + // Join clause is done to check if the module is activated in current shop context + $result = Db::getInstance()->executeS(' + SELECT m.`id_module`, m.`name`, ( + SELECT id_module + FROM `'._DB_PREFIX_.'module_shop` ms + WHERE m.`id_module` = ms.`id_module` + AND ms.`id_shop` = '.(int)$id_shop.' + LIMIT 1 + ) as mshop + FROM `'._DB_PREFIX_.'module` m'); foreach ($result as $row) { self::$modules_cache[$row['name']] = $row; - self::$modules_cache[$row['name']]['active'] = ($row['total'] > 0) ? 1 : 0; + self::$modules_cache[$row['name']]['active'] = ($row['mshop'] > 0) ? 1 : 0; } } @@ -182,9 +191,13 @@ abstract class ModuleCore */ public function install() { + Hook::exec('actionModuleInstallBefore', array('object' => $this)); // Check module name validation if (!Validate::isModuleName($this->name)) - die(Tools::displayError()); + { + $this->_errors[] = $this->l('Unable to install the module (Module name is not valid).'); + return false; + } // Check PS version compliancy if (version_compare(_PS_VERSION_, $this->ps_versions_compliancy['min']) < 0 || version_compare(_PS_VERSION_, $this->ps_versions_compliancy['max']) >= 0) @@ -206,7 +219,7 @@ abstract class ModuleCore } // Check if module is installed - $result = Db::getInstance()->getRow('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($this->name).'\''); + $result = Module::isInstalled($this->name); if ($result) { $this->_errors[] = $this->l('This module has already been installed.'); @@ -257,7 +270,7 @@ abstract class ModuleCore // Adding Restrictions for client groups Group::addRestrictionsForModule($this->id, Shop::getShops(true, null, true)); - + Hook::exec('actionModuleInstallAfter', array('object' => $this)); return true; } @@ -302,6 +315,12 @@ abstract class ModuleCore */ public static function initUpgradeModule($module) { + if (((int)$module->installed == 1) & (empty($module->database_version) === true)) + { + Module::upgradeModuleVersion($module->name, $module->version); + $module->database_version = $module->version; + } + // Init cache upgrade details self::$modules_cache[$module->name]['upgrade'] = array( 'success' => false, // bool to know if upgrade succeed or not @@ -395,8 +414,14 @@ abstract class ModuleCore { self::$modules_cache[$module->name]['upgrade']['upgraded_from'] = $module->database_version; // Check the version of the module with the registered one and look if any upgrade file exist - return Tools::version_compare($module->version, $module->database_version, '>') - && Module::loadUpgradeVersionList($module->name, $module->version, $module->database_version); + if (Tools::version_compare($module->version, $module->database_version, '>')) + { + $old_version = $module->database_version; + $module = Module::getInstanceByName($module->name); + if ($module instanceof Module) + return $module->loadUpgradeVersionList($module->name, $module->version, $old_version); + } + return null; } /** @@ -488,9 +513,8 @@ abstract class ModuleCore $result = Db::getInstance()->executeS($sql); foreach ($result as $row) { - $sql = 'DELETE FROM `'._DB_PREFIX_.'hook_module` WHERE `id_module` = '.(int)$this->id.' AND `id_hook` = '.(int)$row['id_hook']; - Db::getInstance()->execute($sql); - $this->cleanPositions($row['id_hook']); + $this->unregisterHook((int)$row['id_hook']); + $this->unregisterExceptions((int)$row['id_hook']); } // Disable the module for all shops @@ -511,7 +535,7 @@ abstract class ModuleCore return false; } - + /** * This function enable module $name. If an $name is an array, * this will enable all of them @@ -525,10 +549,12 @@ abstract class ModuleCore // If $name is not an array, we set it as an array if (!is_array($name)) $name = array($name); - + $res = true; // Enable each module - foreach ($name as $k => $v) - Module::getInstanceByName($name)->enable(); + foreach ($name as $n) + if (Validate::isModuleName($n)) + $res &= Module::getInstanceByName($n)->enable(); + return $res; } /** @@ -574,12 +600,12 @@ abstract class ModuleCore // If $name is not an array, we set it as an array if (!is_array($name)) $name = array($name); - + $res = true; // Disable each module - foreach ($name as $k => $v) - Module::getInstanceByName($name)->disable(); - - return true; + foreach ($name as $n) + if (Validate::isModuleName($n)) + $res &= Module::getInstanceByName($n)->disable(); + return $res; } /** @@ -643,11 +669,14 @@ abstract class ModuleCore return false; // Retrocompatibility + $hook_name_bak = $hook_name; if ($alias = Hook::getRetroHookName($hook_name)) $hook_name = $alias; + Hook::exec('actionModuleRegisterHookBefore', array('object' => $this, 'hook_name' => $hook_name)); // Get hook id $id_hook = Hook::getIdByName($hook_name); + $live_edit = Hook::getLiveEditById((int)Hook::getIdByName($hook_name_bak)); // If hook does not exist, we create it if (!$id_hook) @@ -655,6 +684,7 @@ abstract class ModuleCore $new_hook = new Hook(); $new_hook->name = pSQL($hook_name); $new_hook->title = pSQL($hook_name); + $new_hook->live_edit = pSQL($live_edit); $new_hook->add(); $id_hook = $new_hook->id; if (!$id_hook) @@ -692,6 +722,7 @@ abstract class ModuleCore )); } + Hook::exec('actionModuleRegisterHookAfter', array('object' => $this, 'hook_name' => $hook_name)); return $return; } @@ -707,11 +738,16 @@ abstract class ModuleCore // Get hook id if a name is given as argument if (!is_numeric($hook_id)) { + $hook_name = (int)$hook_id; // Retrocompatibility $hook_id = Hook::getIdByName($hook_id); if (!$hook_id) return false; } + else + $hook_name = Hook::getNameById((int)$hook_id); + + Hook::exec('actionModuleUnRegisterHookBefore', array('object' => $this, 'hook_name' => $hook_name)); // Unregister module on hook by id $sql = 'DELETE FROM `'._DB_PREFIX_.'hook_module` @@ -722,6 +758,8 @@ abstract class ModuleCore // Clean modules position $this->cleanPositions($hook_id, $shop_list); + Hook::exec('actionModuleUnRegisterHookAfter', array('object' => $this, 'hook_name' => $hook_name)); + return $result; } @@ -845,7 +883,12 @@ abstract class ModuleCore public static function getInstanceByName($module_name) { if (!Validate::isModuleName($module_name)) - die(Tools::displayError()); + { + if (_PS_MODE_DEV_) + die(Tools::displayError($module_name.' is not a valid module name.')); + return false; + } + if (!isset(self::$_INSTANCE[$module_name])) { if (Tools::file_exists_cache(_PS_MODULE_DIR_.$module_name.'/'.$module_name.'.php')) @@ -1053,10 +1096,19 @@ abstract class ModuleCore $item->active = $tmp_module->active; $item->currencies = isset($tmp_module->currencies) ? $tmp_module->currencies : null; $item->currencies_mode = isset($tmp_module->currencies_mode) ? $tmp_module->currencies_mode : null; - - // Method pointer to get dynamically the onclick content + $item->confirmUninstall = isset($tmp_module->confirmUninstall) ? $tmp_module->confirmUninstall : null; + $item->onclick_option = method_exists($module, 'onclickOption') ? true : false; - + if ($item->onclick_option) + { + $href = Context::getContext()->link->getAdminLink('Module', true).'&module_name='.$tmp_module->name.'&tab_module='.$tmp_module->tab; + $item->onclick_option_content = array(); + $option_tab = array('desactive', 'reset', 'configure', 'delete'); + foreach ($option_tab as $opt) + $item->onclick_option_content[$opt] = $tmp_module->onclickOption($opt, $href); + } + + $module_list[] = $item; if (!$xml_exist || $needNewConfigFile) { @@ -1135,10 +1187,10 @@ abstract class ModuleCore $item->active = 0; if (isset($modaddons->img)) { - if (!file_exists('../img/tmp/'.md5($modaddons->name).'.jpg')) - if (!@copy($modaddons->img, '../img/tmp/'.md5($modaddons->name).'.jpg')) - @copy('../img/404.gif', '../img/tmp/'.md5($modaddons->name).'.jpg'); - if (file_exists('../img/tmp/'.md5($modaddons->name).'.jpg')) + if (!file_exists(_PS_TMP_IMG_DIR_.md5($modaddons->name).'.jpg')) + if (!file_put_contents(_PS_TMP_IMG_DIR_.md5($modaddons->name).'.jpg', Tools::file_get_contents($modaddons->img))) + copy(_PS_IMG_DIR_.'404.gif', _PS_TMP_IMG_DIR_.md5($modaddons->name).'.jpg'); + if (file_exists(_PS_TMP_IMG_DIR_.md5($modaddons->name).'.jpg')) $item->image = '../img/tmp/'.md5($modaddons->name).'.jpg'; } if ($item->type == 'addonsMustHave') @@ -1148,12 +1200,12 @@ abstract class ModuleCore $id_default_currency = Configuration::get('PS_CURRENCY_DEFAULT'); foreach ($prices as $currency => $price) if ($id_currency = Currency::getIdByIsoCode($currency)) + { + $item->price = (float)$price; + $item->id_currency = (int)$id_currency; if ($id_default_currency == $id_currency) - { - $item->price = (float)$price; - $item->id_currency = (int)$id_currency; - } - + break; + } } $module_list[] = $item; } @@ -1277,6 +1329,14 @@ abstract class ModuleCore { return true; } + + public static function getPaypalIgnore() + { + $iso_code = Country::getIsoById((int)Configuration::get('PS_COUNTRY_DEFAULT')); + $paypal_countries = array('ES', 'FR', 'PL', 'IT'); + if (Context::getContext()->getMobileDevice() && Context::getContext()->shop->getTheme() == 'default' && in_array($iso_code, $paypal_countries)) + return 'm.`name` = \'paypal\''; + } /** * Returns the list of the payment module associated to the current customer @@ -1297,7 +1357,7 @@ abstract class ModuleCore elseif (isset($context->customer)) { $groups = $context->customer->getGroups(); - if (empty($groups)) + if (!count($groups)) $groups = array(Configuration::get('PS_UNIDENTIFIED_GROUP')); } @@ -1305,14 +1365,10 @@ abstract class ModuleCore if (Db::getInstance()->getValue('SELECT `id_hook` FROM `'._DB_PREFIX_.'hook` WHERE `name` = \'displayPayment\'')) $hookPayment = 'displayPayment'; - $paypal_condition = ''; - $iso_code = Country::getIsoById((int)Configuration::get('PS_COUNTRY_DEFAULT')); - $paypal_countries = array('ES', 'FR', 'PL', 'IT'); - if (Context::getContext()->getMobileDevice() && Context::getContext()->shop->getTheme() == 'default' && in_array($iso_code, $paypal_countries)) - $paypal_condition = ' AND m.`name` = \'paypal\''; - $list = Shop::getContextListShopID(); - + if ($paypal_condition = Module::getPaypalIgnore()) + $paypal_condition = ' AND '.$paypal_condition; + return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT DISTINCT m.`id_module`, h.`id_hook`, m.`name`, hm.`position` FROM `'._DB_PREFIX_.'module` m '.($frontend ? 'LEFT JOIN `'._DB_PREFIX_.'module_country` mc ON (m.`id_module` = mc.`id_module` AND mc.id_shop = '.(int)$context->shop->id.')' : '').' @@ -1324,7 +1380,7 @@ abstract class ModuleCore '.(isset($billing) && $frontend ? 'AND mc.id_country = '.(int)$billing->id_country : '').' AND (SELECT COUNT(*) FROM '._DB_PREFIX_.'module_shop ms WHERE ms.id_module = m.id_module AND ms.id_shop IN('.implode(', ', $list).')) = '.count($list).' AND hm.id_shop IN('.implode(', ', $list).') - '.(count($groups) && $frontend ? 'AND (mg.`id_group` IN('.implode(', ', $groups).'))' : '').$paypal_condition.' + '.((count($groups) && $frontend) ? 'AND (mg.`id_group` IN ('.implode(', ', $groups).'))' : '').$paypal_condition.' GROUP BY hm.id_hook, hm.id_module ORDER BY hm.`position`, m.`name` DESC'); } @@ -1348,7 +1404,7 @@ abstract class ModuleCore * @param boolean|string $specific filename to use in translation key * @return string Translation */ - public function l($string, $specific = false, $id_lang = null) + public function l($string, $specific = false) { if (self::$_generate_config_xml_mode) return $string; @@ -1462,12 +1518,12 @@ abstract class ModuleCore * @param int $id_hook Hook ID * @return array Exceptions */ - protected static $exceptionsCache = null; - public function getExceptions($hookID, $dispatch = false) + public function getExceptions($id_hook, $dispatch = false) { - if (self::$exceptionsCache === null) + $cache_id = 'exceptionsCache'; + if (!Cache::isStored($cache_id)) { - self::$exceptionsCache = array(); + $exceptionsCache = array(); $sql = 'SELECT * FROM `'._DB_PREFIX_.'hook_module_exceptions` WHERE `id_shop` IN ('.implode(', ', Shop::getContextListShopID()).')'; $result = Db::getInstance()->executeS($sql); @@ -1476,40 +1532,41 @@ abstract class ModuleCore if (!$row['file_name']) continue; $key = $row['id_hook'].'-'.$row['id_module']; - if (!isset(self::$exceptionsCache[$key])) - self::$exceptionsCache[$key] = array(); - if (!isset(self::$exceptionsCache[$key][$row['id_shop']])) - self::$exceptionsCache[$key][$row['id_shop']] = array(); - self::$exceptionsCache[$key][$row['id_shop']][] = $row['file_name']; + if (!isset($exceptionsCache[$key])) + $exceptionsCache[$key] = array(); + if (!isset($exceptionsCache[$key][$row['id_shop']])) + $exceptionsCache[$key][$row['id_shop']] = array(); + $exceptionsCache[$key][$row['id_shop']][] = $row['file_name']; } + Cache::store($cache_id, $exceptionsCache); } + else + $exceptionsCache = Cache::retrieve($cache_id); - $key = $hookID.'-'.$this->id; - if (!$dispatch) + $key = $id_hook.'-'.$this->id; + $array_return = array(); + if ($dispatch) { - $files = array(); foreach (Shop::getContextListShopID() as $shop_id) - if (isset(self::$exceptionsCache[$key], self::$exceptionsCache[$key][$shop_id])) - foreach (self::$exceptionsCache[$key][$shop_id] as $file) - if (!in_array($file, $files)) - $files[] = $file; - return $files; + if (isset($exceptionsCache[$key], $exceptionsCache[$key][$shop_id])) + $array_return[$shop_id] = $exceptionsCache[$key][$shop_id]; } else { - $list = array(); foreach (Shop::getContextListShopID() as $shop_id) - if (isset(self::$exceptionsCache[$key], self::$exceptionsCache[$key][$shop_id])) - $list[$shop_id] = self::$exceptionsCache[$key][$shop_id]; - return $list; + if (isset($exceptionsCache[$key], $exceptionsCache[$key][$shop_id])) + foreach ($exceptionsCache[$key][$shop_id] as $file) + if (!in_array($file, $array_return)) + $array_return[] = $file; } + return $array_return; } public static function isInstalled($module_name) { if (!Cache::isStored('Module::isInstalled'.$module_name)) { - $id_module = Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($module_name).'\''); + $id_module = Module::getModuleIdByName($module_name); Cache::store('Module::isInstalled'.$module_name, (bool)$id_module); } return Cache::retrieve('Module::isInstalled'.$module_name); @@ -1520,7 +1577,7 @@ abstract class ModuleCore if (!Cache::isStored('Module::isEnabled'.$module_name)) { $active = false; - $id_module = Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module` WHERE `name` = \''.pSQL($module_name).'\''); + $id_module = Module::getModuleIdByName($module_name); if (Db::getInstance()->getValue('SELECT `id_module` FROM `'._DB_PREFIX_.'module_shop` WHERE `id_module` = '.(int)$id_module.' AND `id_shop` = '.(int)Context::getContext()->shop->id)) $active = true; Cache::store('Module::isEnabled'.$module_name, (bool)$active); @@ -1558,11 +1615,18 @@ abstract class ModuleCore { return Module::_isTemplateOverloadedStatic($this->name, $template); } + + protected function getCacheId($name = null) + { + if ($name === null) + $name = $this->name; + return $name.'|'.(int)Tools::usingSecureMode().'|'.(int)$this->context->shop->id.'|'.(int)Group::getCurrent()->id.'|'.(int)$this->context->language->id.'|'.(int)$this->context->currency->id; + } public function display($file, $template, $cacheId = null, $compileId = null) { if (($overloaded = Module::_isTemplateOverloadedStatic(basename($file, '.php'), $template)) === null) - $result = Tools::displayError('No template found for module').' '.basename($file, '.php'); + return Tools::displayError('No template found for module').' '.basename($file, '.php'); else { $this->smarty->assign(array( @@ -1570,16 +1634,22 @@ abstract class ModuleCore 'module_template_dir' => ($overloaded ? _THEME_DIR_ : __PS_BASE_URI__).'modules/'.basename($file, '.php').'/' )); + if ($cacheId !== null) + Tools::enableCache(); + $smarty_subtemplate = $this->context->smarty->createTemplate( $this->getTemplatePath($template), $cacheId, $compileId, $this->smarty ); - $result = $smarty_subtemplate->fetch(); + + if ($cacheId !== null) + Tools::restoreCacheSettings(); + + return $result; } - return $result; } /** @@ -1611,13 +1681,17 @@ abstract class ModuleCore { $context = Context::getContext(); - return $context->smarty->isCached($this->getTemplatePath($template), $cacheId, $compileId); + Tools::enableCache(); + $is_cached = $context->smarty->isCached($this->getTemplatePath($template), $cacheId, $compileId); + Tools::restoreCacheSettings(); + + return $is_cached; } protected function _clearCache($template, $cache_id = null, $compile_id = null) { Tools::enableCache(); - Tools::clearCache(Context::getContext()->smarty, $template, $cache_id, $compile_id); + Tools::clearCache(Context::getContext()->smarty, $this->getTemplatePath($template), $cache_id, $compile_id); Tools::restoreCacheSettings(); } @@ -1867,12 +1941,14 @@ abstract class ModuleCore if (!is_writable(dirname($override_dest))) throw new Exception(sprintf(Tools::displayError('directory (%s) not writable'), dirname($override_dest))); copy($override_src, $override_dest); + // Re-generate the class index + Autoload::getInstance()->generateIndex(); return true; } // Check if override file is writable $override_path = _PS_ROOT_DIR_.'/'.Autoload::getInstance()->getClassPath($classname); - if (!is_writable($override_path)) + if ((!file_exists($override_path) && !is_writable(dirname($override_path))) || (file_exists($override_path) && !is_writable($override_path))) throw new Exception(sprintf(Tools::displayError('file (%s) not writable'), $override_path)); // Make a reflection of the override class and the module override class @@ -1915,7 +1991,7 @@ abstract class ModuleCore if (!Autoload::getInstance()->getClassPath($classname)) return true; - + // Check if override file is writable $override_path = _PS_ROOT_DIR_.'/'.Autoload::getInstance()->getClassPath($classname); if (!is_writable($override_path)) @@ -1948,7 +2024,7 @@ abstract class ModuleCore if (!$override_class->hasProperty($property->getName())) continue; - // Remplacer la ligne de déclaration par "remove" + // Remplacer la ligne de declaration par "remove" foreach ($override_file as $line_number => &$line_content) if (preg_match('/(public|private|protected)\s+(static\s+)?\$'.$property->getName().'/i', $line_content)) { diff --git a/classes/module/ModuleGraph.php b/classes/module/ModuleGraph.php index 1b85533f3..f8937fcd2 100644 --- a/classes/module/ModuleGraph.php +++ b/classes/module/ModuleGraph.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/module/ModuleGraphEngine.php b/classes/module/ModuleGraphEngine.php index 3db85db2d..7b83d08b1 100644 --- a/classes/module/ModuleGraphEngine.php +++ b/classes/module/ModuleGraphEngine.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/module/ModuleGrid.php b/classes/module/ModuleGrid.php index 7986bf5b7..7d3ab191a 100644 --- a/classes/module/ModuleGrid.php +++ b/classes/module/ModuleGrid.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/module/ModuleGridEngine.php b/classes/module/ModuleGridEngine.php index 6291f0678..0f4a65de7 100644 --- a/classes/module/ModuleGridEngine.php +++ b/classes/module/ModuleGridEngine.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/module/index.php b/classes/module/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/module/index.php +++ b/classes/module/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/order/Order.php b/classes/order/Order.php index 0a5597c27..a4d4db1b0 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -63,7 +63,7 @@ class OrderCore extends ObjectModel /** @var string Payment module */ public $module; - /** @var float Currency conversion rate */ + /** @var float Currency exchange rate */ public $conversion_rate; /** @var boolean Customer is ok for a recyclable package */ @@ -75,6 +75,9 @@ class OrderCore extends ObjectModel /** @var string Gift message if specified */ public $gift_message; + /** @var boolean Mobile Theme */ + public $mobile_theme; + /** * @var string Shipping number * @deprecated 1.5.0.4 @@ -172,10 +175,11 @@ class OrderCore extends ObjectModel 'current_state' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'secure_key' => array('type' => self::TYPE_STRING, 'validate' => 'isMd5'), 'payment' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'required' => true), - 'module' => array('type' => self::TYPE_STRING), + 'module' => array('type' => self::TYPE_STRING, 'validate' => 'isModuleName', 'required' => true), 'recyclable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'gift' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'gift_message' => array('type' => self::TYPE_STRING, 'validate' => 'isMessage'), + 'mobile_theme' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), 'total_discounts' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'), 'total_discounts_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'), 'total_discounts_tax_excl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'), @@ -236,6 +240,8 @@ class OrderCore extends ObjectModel 'product_quantity' => array('required' => true), 'product_name' => array('setter' => false), 'product_price' => array('setter' => false), + 'unit_price_tax_incl' => array('setter' => false), + 'unit_price_tax_excl' => array('setter' => false), )), ), @@ -248,10 +254,12 @@ class OrderCore extends ObjectModel public function __construct($id = null, $id_lang = null) { parent::__construct($id, $id_lang); - if ($this->id_customer) + + $is_admin = (is_object(Context::getContext()->controller) && Context::getContext()->controller->controller_type == 'admin'); + if ($this->id_customer && !$is_admin) { $customer = new Customer((int)($this->id_customer)); - $this->_taxCalculationMethod = Group::getPriceDisplayMethod((int)($customer->id_default_group)); + $this->_taxCalculationMethod = Group::getPriceDisplayMethod((int)$customer->id_default_group); } else $this->_taxCalculationMethod = Group::getDefaultPriceDisplayMethod(); @@ -264,7 +272,7 @@ class OrderCore extends ObjectModel public function getFields() { if (!$this->id_lang) - $this->id_lang = Configuration::get('PS_LANG_DEFAULT'); + $this->id_lang = Configuration::get('PS_LANG_DEFAULT', null, null, $this->id_shop); return parent::getFields(); } @@ -284,12 +292,12 @@ class OrderCore extends ObjectModel /* Does NOT delete a product but "cancel" it (which means return/refund/delete it depending of the case) */ public function deleteProduct($order, $orderDetail, $quantity) { - if (!(int)($this->getCurrentState())) + if (!(int)($this->getCurrentState()) || !validate::isLoadedObject($orderDetail)) return false; if ($this->hasBeenDelivered()) { - if (!Configuration::get('PS_ORDER_RETURN')) + if (!Configuration::get('PS_ORDER_RETURN', null, null, $this->id_shop)) throw new PrestaShopException('PS_ORDER_RETURN is not defined in table configuration'); $orderDetail->product_quantity_return += (int)($quantity); return $orderDetail->update(); @@ -1027,7 +1035,7 @@ class OrderCore extends ObjectModel * @param int $id_order_invoice * @return bool */ - public function addCartRule($id_cart_rule, $name, $values, $id_order_invoice = 0) + public function addCartRule($id_cart_rule, $name, $values, $id_order_invoice = 0, $free_shipping = null) { $order_cart_rule = new OrderCartRule(); $order_cart_rule->id_order = $this->id; @@ -1036,12 +1044,18 @@ class OrderCore extends ObjectModel $order_cart_rule->name = $name; $order_cart_rule->value = $values['tax_incl']; $order_cart_rule->value_tax_excl = $values['tax_excl']; + if ($free_shipping === null) + { + $cart_rule = new CartRule($id_cart_rule); + $free_shipping = $cart_rule->free_shipping; + } + $order_cart_rule->free_shipping = (int)$free_shipping; $order_cart_rule->add(); } public function getNumberOfDays() { - $nbReturnDays = (int)(Configuration::get('PS_ORDER_RETURN_NB_DAYS')); + $nbReturnDays = (int)(Configuration::get('PS_ORDER_RETURN_NB_DAYS', null, null, $this->id_shop)); if (!$nbReturnDays) return true; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' @@ -1059,7 +1073,7 @@ class OrderCore extends ObjectModel */ public function isReturnable() { - if (Configuration::get('PS_ORDER_RETURN') && $this->isPaidAndShipped()) + if (Configuration::get('PS_ORDER_RETURN', null, null, $this->id_shop) && $this->isPaidAndShipped()) return $this->getNumberOfDays(); return false; @@ -1082,10 +1096,10 @@ class OrderCore extends ObjectModel { $order_invoice = new OrderInvoice(); $order_invoice->id_order = $this->id; - $order_invoice->number = Configuration::get('PS_INVOICE_START_NUMBER'); + $order_invoice->number = Configuration::get('PS_INVOICE_START_NUMBER', null, null, $this->id_shop); // If invoice start number has been set, you clean the value of this configuration if ($order_invoice->number) - Configuration::updateValue('PS_INVOICE_START_NUMBER', false ); + Configuration::updateValue('PS_INVOICE_START_NUMBER', false, false, null, $this->id_shop); else $order_invoice->number = Order::getLastInvoiceNumber() + 1; @@ -1134,13 +1148,14 @@ class OrderCore extends ObjectModel if ($use_existing_payment) { $id_order_payments = Db::getInstance()->executeS(' - SELECT op.id_order_payment + SELECT DISTINCT op.id_order_payment FROM `'._DB_PREFIX_.'order_payment` op INNER JOIN `'._DB_PREFIX_.'orders` o ON (o.reference = op.order_reference) LEFT JOIN `'._DB_PREFIX_.'order_invoice_payment` oip ON (oip.id_order_payment = op.id_order_payment) - WHERE oip.id_order_payment IS NULL AND o.id_order = '.(int)$order_invoice->id_order); - + WHERE (oip.id_order != '.(int)$order_invoice->id_order.' OR oip.id_order IS NULL) AND o.id_order = '.(int)$order_invoice->id_order); + if (count($id_order_payments)) + { foreach ($id_order_payments as $order_payment) Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'order_invoice_payment` @@ -1148,6 +1163,9 @@ class OrderCore extends ObjectModel `id_order_invoice` = '.(int)$order_invoice->id.', `id_order_payment` = '.(int)$order_payment['id_order_payment'].', `id_order` = '.(int)$order_invoice->id_order); + // Clear cache + Cache::clean('order_invoice_paid_*'); + } } // Update order cart rule @@ -1169,11 +1187,14 @@ class OrderCore extends ObjectModel $order_invoice_collection = $this->getInvoicesCollection(); foreach ($order_invoice_collection as $order_invoice) { - $number = (int)Configuration::get('PS_DELIVERY_NUMBER'); + if ($order_invoice->delivery_number) + continue; + + $number = (int)Configuration::get('PS_DELIVERY_NUMBER', null, null, $this->id_shop); if (!$number) { //if delivery number is not set or wrong, we set a default one. - Configuration::updateValue('PS_DELIVERY_NUMBER', 1); + Configuration::updateValue('PS_DELIVERY_NUMBER', 1, false, null, $this->id_shop); $number = 1; } @@ -1185,7 +1206,7 @@ class OrderCore extends ObjectModel // Keep for backward compatibility $this->delivery_number = $number; - Configuration::updateValue('PS_DELIVERY_NUMBER', $number + 1); + Configuration::updateValue('PS_DELIVERY_NUMBER', $number + 1, false, null, $this->id_shop); } // Keep it for backward compatibility, to remove on 1.6 version @@ -1222,12 +1243,11 @@ class OrderCore extends ObjectModel public function getTotalWeight() { - $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow(' - SELECT SUM(product_weight * product_quantity) weight + $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue(' + SELECT SUM(product_weight * product_quantity) FROM '._DB_PREFIX_.'order_detail WHERE id_order = '.(int)($this->id)); - - return (float)($result['weight']); + return (float)($result); } /** @@ -1274,7 +1294,7 @@ class OrderCore extends ObjectModel public function getWsOrderRows() { - $query = 'SELECT id_order_detail as `id`, `product_id`, `product_price`, `id_order`, `product_attribute_id`, `product_quantity`, `product_name` + $query = 'SELECT id_order_detail as `id`, `product_id`, `product_price`, `id_order`, `product_attribute_id`, `product_quantity`, `product_name`, `unit_price_tax_incl`, `unit_price_tax_excl` FROM `'._DB_PREFIX_.'order_detail` WHERE id_order = '.(int)$this->id; $result = Db::getInstance()->executeS($query); @@ -1451,6 +1471,9 @@ class OrderCore extends ObjectModel $res = Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'order_invoice_payment` VALUES('.(int)$order_invoice->id.', '.(int)$order_payment->id.', '.(int)$this->id.')'); + + // Clear cache + Cache::clean('order_invoice_paid_*'); } return $res; @@ -1497,11 +1520,12 @@ class OrderCore extends ObjectModel /** * @return array return all shipping method for the current order + * state_name sql var is now deprecated - use order_state_name for the state name and carrier_name for the carrier_name */ public function getShipping() { return Db::getInstance()->executeS(' - SELECT DISTINCT oc.`id_order_invoice`, oc.`weight`, oc.`shipping_cost_tax_excl`, oc.`shipping_cost_tax_incl`, c.`url`, oc.`id_carrier`, c.`name` as `state_name`, oc.`date_add`, "Delivery" as `type`, "true" as `can_edit`, oc.`tracking_number`, oc.`id_order_carrier` + SELECT DISTINCT oc.`id_order_invoice`, oc.`weight`, oc.`shipping_cost_tax_excl`, oc.`shipping_cost_tax_incl`, c.`url`, oc.`id_carrier`, c.`name` as `carrier_name`, oc.`date_add`, "Delivery" as `type`, "true" as `can_edit`, oc.`tracking_number`, oc.`id_order_carrier`, osl.`name` as order_state_name, c.`name` as state_name FROM `'._DB_PREFIX_.'orders` o LEFT JOIN `'._DB_PREFIX_.'order_history` oh ON (o.`id_order` = oh.`id_order`) @@ -1511,7 +1535,8 @@ class OrderCore extends ObjectModel ON (oc.`id_carrier` = c.`id_carrier`) LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl ON (oh.`id_order_state` = osl.`id_order_state` AND osl.`id_lang` = '.(int)Context::getContext()->language->id.') - WHERE oc.`id_order` = '.(int)$this->id); + WHERE o.`id_order` = '.(int)$this->id.' + GROUP BY c.id_carrier'); } @@ -1591,7 +1616,7 @@ class OrderCore extends ObjectModel else { $amount = Tools::convertPrice($payment->amount, $payment->id_currency, false); - if ($currency->id == Configuration::get('PS_DEFAULT_CURRENCY')) + if ($currency->id == Configuration::get('PS_DEFAULT_CURRENCY', null, null, $this->id_shop)) $total += $amount; else $total += Tools::convertPrice($amount, $currency->id, true); @@ -1612,7 +1637,7 @@ class OrderCore extends ObjectModel return Db::getInstance()->getValue(' SELECT SUM(total_paid_tax_incl) FROM `'._DB_PREFIX_.'orders` - WHERE `reference` = '.(int)$this->reference.' + WHERE `reference` = \''.pSQL($this->reference).'\' AND `id_cart` = '.(int)$this->id_cart ); } @@ -1864,5 +1889,21 @@ class OrderCore extends ObjectModel $order = new Order($id_order); return $order->getUniqReference(); } + + /** + * Return a unique reference like : GWJTHMZUN#2 + * + * With multishipping, order reference are the same for all orders made with the same cart + * in this case this method suffix the order reference by a # and the order number + * + * @since 1.5.5.0 + */ + public function getIdOrderCarrier() + { + return (int)Db::getInstance()->getValue(' + SELECT `id_order_carrier` + FROM `'._DB_PREFIX_.'order_carrier` + WHERE `id_order` = '.(int)$this->id); + } } diff --git a/classes/order/OrderCarrier.php b/classes/order/OrderCarrier.php index 247ef03d1..6a15e2b43 100644 --- a/classes/order/OrderCarrier.php +++ b/classes/order/OrderCarrier.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/order/OrderCartRule.php b/classes/order/OrderCartRule.php index 8bd0f7032..3eceb173d 100644 --- a/classes/order/OrderCartRule.php +++ b/classes/order/OrderCartRule.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/order/OrderDetail.php b/classes/order/OrderDetail.php index a01f8332d..1136ebfdc 100644 --- a/classes/order/OrderDetail.php +++ b/classes/order/OrderDetail.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -249,7 +249,17 @@ class OrderDetailCore extends ObjectModel $context = Context::getContext(); $this->context = $context->cloneContext(); } - + + public function delete() + { + if(!$res = parent::delete()) + return false; + + Db::getInstance()->delete('order_detail_tax', 'id_order_detail='.(int)$this->id); + + return $res; + } + protected function setContext($id_shop) { if ($this->context->shop->id != $id_shop) @@ -498,7 +508,7 @@ class OrderDetailCore extends ObjectModel $this->purchase_supplier_price = (float)$product['wholesale_price']; if ($product['id_supplier'] > 0) - $this->purchase_supplier_price = (float)ProductSupplier::getProductPrice((int)$product['id_supplier'], $product['id_product'], $product['id_product_attribute']); + $this->purchase_supplier_price = (float)ProductSupplier::getProductPrice((int)$product['id_supplier'], $product['id_product'], $product['id_product_attribute'], true); $this->setSpecificPrice($order, $product); diff --git a/classes/order/OrderDiscount.php b/classes/order/OrderDiscount.php index 8fc06fc51..e0e087b31 100644 --- a/classes/order/OrderDiscount.php +++ b/classes/order/OrderDiscount.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/order/OrderHistory.php b/classes/order/OrderHistory.php index 556821ed4..55f0795f7 100644 --- a/classes/order/OrderHistory.php +++ b/classes/order/OrderHistory.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -64,16 +64,19 @@ class OrderHistoryCore extends ObjectModel 'id_order_state' => array('required' => true, 'xlink_resource'=> 'order_states'), 'id_order' => array('xlink_resource' => 'orders'), ), + 'objectMethods' => array( + 'add' => 'addWs', + ), ); /** * Sets the new state of the given order * * @param int $new_order_state - * @param int $id_order + * @param int/object $id_order * @param bool $use_existing_payment */ - public function changeIdOrderState($new_order_state, &$id_order, $use_existing_payment = false) + public function changeIdOrderState($new_order_state, $id_order, $use_existing_payment = false) { if (!$new_order_state || !$id_order) return; @@ -85,12 +88,15 @@ class OrderHistoryCore extends ObjectModel else return; + ShopUrl::cacheMainDomainForShop($order->id_shop); + $new_os = new OrderState((int)$new_order_state, $order->id_lang); $old_os = $order->getCurrentOrderState(); $is_validated = $this->isValidated(); + // executes hook - if ($new_os->id == Configuration::get('PS_OS_PAYMENT')) + if (in_array($new_os->id, array(Configuration::get('PS_OS_PAYMENT'), Configuration::get('PS_OS_WS_PAYMENT')))) Hook::exec('actionPaymentConfirmation', array('id_order' => (int)$order->id)); // executes hook @@ -99,124 +105,183 @@ class OrderHistoryCore extends ObjectModel 'id_order' => (int)$order->id )); - if (Validate::isLoadedObject($order) && ($old_os instanceof OrderState) && ($new_os instanceof OrderState)) + if (Validate::isLoadedObject($order) && ($new_os instanceof OrderState)) { + // An email is sent the first time a virtual item is validated + $virtual_products = $order->getVirtualProducts(); + if ($virtual_products && (!$old_os || !$old_os->logable) && $new_os && $new_os->logable) + { + $context = Context::getContext(); + $assign = array(); + foreach ($virtual_products as $key => $virtual_product) + { + $id_product_download = ProductDownload::getIdFromIdProduct($virtual_product['product_id']); + $product_download = new ProductDownload($id_product_download); + // If this virtual item has an associated file, we'll provide the link to download the file in the email + if ($product_download->display_filename != '') + { + $assign[$key]['name'] = $product_download->display_filename; + $dl_link = $product_download->getTextLink(false, $virtual_product['download_hash']) + .'&id_order='.(int)$order->id + .'&secure_key='.$order->secure_key; + $assign[$key]['link'] = $dl_link; + if (isset($virtual_product['date_expiration']) && $virtual_product['date_expiration'] != '0000-00-00 00:00:00') + $assign[$key]['deadline'] = Tools::displayDate($virtual_product['date_expiration ']); + if ($product_download->nb_downloadable != 0) + $assign[$key]['downloadable'] = (int)$product_download->nb_downloadable; + } + } + + $customer = new Customer((int)$order->id_customer); + + $links = '
          '; + foreach($assign as $product) + { + $links .= '
        • '; + $links .= ''.Tools::htmlentitiesUTF8($product['name']).''; + if (isset($product['deadline'])) + $links .= ' '.Tools::htmlentitiesUTF8(Tools::displayError('expires on')).' '.$product['deadline']; + if (isset($product['downloadable'])) + $links .= ' '.Tools::htmlentitiesUTF8(sprintf(Tools::displayError('downloadable %d time(s)'), (int)$product['downloadable'])); + $links .= '
        • '; + } + $links .= '
        '; + $data = array( + '{lastname}' => $customer->lastname, + '{firstname}' => $customer->firstname, + '{id_order}' => (int)$order->id, + '{order_name}' => $order->getUniqReference(), + '{nbProducts}' => count($virtual_products), + '{virtualProducts}' => $links + ); + // If there's at least one downloadable file + if (!empty($assign)) + Mail::Send((int)$order->id_lang, 'download_product', Mail::l('Virtual product to download', $order->id_lang), $data, $customer->email, $customer->firstname.' '.$customer->lastname, + null, null, null, null, _PS_MAIL_DIR_, false, (int)$order->id_shop); + } + // @since 1.5.0 : gets the stock manager $manager = null; if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) $manager = StockManagerFactory::getManager(); + + $errorOrCanceledStatuses = array(Configuration::get('PS_OS_ERROR'), Configuration::get('PS_OS_CANCELED')); + // foreach products of the order - foreach ($order->getProductsDetail() as $product) - { - // if becoming logable => adds sale - if ($new_os->logable && !$old_os->logable) + if (Validate::isLoadedObject($old_os)) + foreach ($order->getProductsDetail() as $product) { - ProductSale::addProductSale($product['product_id'], $product['product_quantity']); - // @since 1.5.0 - Stock Management - if (!Pack::isPack($product['product_id']) && - ($old_os->id == Configuration::get('PS_OS_ERROR') || $old_os->id == Configuration::get('PS_OS_CANCELED')) && - !StockAvailable::dependsOnStock($product['id_product'], (int)$order->id_shop)) - StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], -(int)$product['product_quantity'], $order->id_shop); - } - // if becoming unlogable => removes sale - elseif (!$new_os->logable && $old_os->logable) - { - ProductSale::removeProductSale($product['product_id'], $product['product_quantity']); - - // @since 1.5.0 - Stock Management - if (!Pack::isPack($product['product_id']) && - ($new_os->id == Configuration::get('PS_OS_ERROR') || $new_os->id == Configuration::get('PS_OS_CANCELED')) && - !StockAvailable::dependsOnStock($product['id_product'])) - StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); - } - // if waiting for payment => payment error/canceled - elseif (!$new_os->logable && !$old_os->logable && - ($new_os->id == Configuration::get('PS_OS_ERROR') || $new_os->id == Configuration::get('PS_OS_CANCELED')) && - !StockAvailable::dependsOnStock($product['id_product'])) - StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); - // @since 1.5.0 : if the order is being shipped and this products uses the advanced stock management : - // decrements the physical stock using $id_warehouse - if ($new_os->shipped == 1 && $old_os->shipped == 0 && - Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && - Warehouse::exists($product['id_warehouse']) && - $manager != null && - ((int)$product['advanced_stock_management'] == 1 || Pack::usesAdvancedStockManagement($product['product_id']))) - { - // gets the warehouse - $warehouse = new Warehouse($product['id_warehouse']); - - // decrements the stock (if it's a pack, the StockManager does what is needed) - $manager->removeProduct( - $product['product_id'], - $product['product_attribute_id'], - $warehouse, - $product['product_quantity'], - Configuration::get('PS_STOCK_CUSTOMER_ORDER_REASON'), - true, - (int)$order->id - ); - } - // @since.1.5.0 : if the order was shipped, and is not anymore, we need to restock products - elseif ($new_os->shipped == 0 && $old_os->shipped == 1 && - Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && - Warehouse::exists($product['id_warehouse']) && - $manager != null && - ((int)$product['advanced_stock_management'] == 1 || Pack::usesAdvancedStockManagement($product['product_id']))) - { - // if the product is a pack, we restock every products in the pack using the last negative stock mvts - if (Pack::isPack($product['product_id'])) + // if becoming logable => adds sale + if ($new_os->logable && !$old_os->logable) { - $pack_products = Pack::getItems($product['product_id'], Configuration::get('PS_LANG_DEFAULT')); - foreach ($pack_products as $pack_product) + ProductSale::addProductSale($product['product_id'], $product['product_quantity']); + // @since 1.5.0 - Stock Management + if (!Pack::isPack($product['product_id']) && + in_array($old_os->id, $errorOrCanceledStatuses) && + !StockAvailable::dependsOnStock($product['id_product'], (int)$order->id_shop)) + StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], -(int)$product['product_quantity'], $order->id_shop); + } + // if becoming unlogable => removes sale + elseif (!$new_os->logable && $old_os->logable) + { + ProductSale::removeProductSale($product['product_id'], $product['product_quantity']); + + // @since 1.5.0 - Stock Management + if (!Pack::isPack($product['product_id']) && + in_array($new_os->id, $errorOrCanceledStatuses) && + !StockAvailable::dependsOnStock($product['id_product'])) + StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); + } + // if waiting for payment => payment error/canceled + elseif (!$new_os->logable && !$old_os->logable && + in_array($new_os->id, $errorOrCanceledStatuses) && + !in_array($old_os->id, $errorOrCanceledStatuses) && + !StockAvailable::dependsOnStock($product['id_product'])) + StockAvailable::updateQuantity($product['product_id'], $product['product_attribute_id'], (int)$product['product_quantity'], $order->id_shop); + // @since 1.5.0 : if the order is being shipped and this products uses the advanced stock management : + // decrements the physical stock using $id_warehouse + if ($new_os->shipped == 1 && $old_os->shipped == 0 && + Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && + Warehouse::exists($product['id_warehouse']) && + $manager != null && + ((int)$product['advanced_stock_management'] == 1 || Pack::usesAdvancedStockManagement($product['product_id']))) + { + // gets the warehouse + $warehouse = new Warehouse($product['id_warehouse']); + + // decrements the stock (if it's a pack, the StockManager does what is needed) + $manager->removeProduct( + $product['product_id'], + $product['product_attribute_id'], + $warehouse, + $product['product_quantity'], + Configuration::get('PS_STOCK_CUSTOMER_ORDER_REASON'), + true, + (int)$order->id + ); + } + // @since.1.5.0 : if the order was shipped, and is not anymore, we need to restock products + elseif ($new_os->shipped == 0 && $old_os->shipped == 1 && + Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && + Warehouse::exists($product['id_warehouse']) && + $manager != null && + ((int)$product['advanced_stock_management'] == 1 || Pack::usesAdvancedStockManagement($product['product_id']))) + { + // if the product is a pack, we restock every products in the pack using the last negative stock mvts + if (Pack::isPack($product['product_id'])) { - if ($pack_product->advanced_stock_management == 1) + $pack_products = Pack::getItems($product['product_id'], Configuration::get('PS_LANG_DEFAULT', null, null, $order->id_shop)); + foreach ($pack_products as $pack_product) { - $mvts = StockMvt::getNegativeStockMvts($order->id, $pack_product->id, 0, $pack_product->pack_quantity * $product['product_quantity']); - foreach ($mvts as $mvt) + if ($pack_product->advanced_stock_management == 1) { - $manager->addProduct( - $pack_product->id, - 0, - new Warehouse($mvt['id_warehouse']), - $mvt['physical_quantity'], - null, - $mvt['price_te'], - true - ); + $mvts = StockMvt::getNegativeStockMvts($order->id, $pack_product->id, 0, $pack_product->pack_quantity * $product['product_quantity']); + foreach ($mvts as $mvt) + { + $manager->addProduct( + $pack_product->id, + 0, + new Warehouse($mvt['id_warehouse']), + $mvt['physical_quantity'], + null, + $mvt['price_te'], + true + ); + } + if (!StockAvailable::dependsOnStock($product['id_product'])) + StockAvailable::updateQuantity($pack_product->id, 0, (int)$pack_product->pack_quantity * $product['product_quantity'], $order->id_shop); } - if (!StockAvailable::dependsOnStock($product['id_product'])) - StockAvailable::updateQuantity($pack_product->id, 0, (int)$pack_product->pack_quantity * $product['product_quantity'], $order->id_shop); + } + } + // else, it's not a pack, re-stock using the last negative stock mvts + else + { + $mvts = StockMvt::getNegativeStockMvts($order->id, $product['product_id'], $product['product_attribute_id'], $product['product_quantity']); + foreach ($mvts as $mvt) + { + $manager->addProduct( + $product['product_id'], + $product['product_attribute_id'], + new Warehouse($mvt['id_warehouse']), + $mvt['physical_quantity'], + null, + $mvt['price_te'], + true + ); } } } - // else, it's not a pack, re-stock using the last negative stock mvts - else - { - $mvts = StockMvt::getNegativeStockMvts($order->id, $product['product_id'], $product['product_attribute_id'], $product['product_quantity']); - foreach ($mvts as $mvt) - { - $manager->addProduct( - $product['product_id'], - $product['product_attribute_id'], - new Warehouse($mvt['id_warehouse']), - $mvt['physical_quantity'], - null, - $mvt['price_te'], - true - ); - } - } } - } } $this->id_order_state = (int)$new_order_state; - + // changes invoice number of order ? if (!Validate::isLoadedObject($new_os) || !Validate::isLoadedObject($order)) die(Tools::displayError('Invalid new order state')); // the order is valid if and only if the invoice is available and the order is not cancelled + $order->current_state = $this->id_order_state; $order->valid = $new_os->logable; $order->update(); @@ -270,6 +335,8 @@ class OrderHistoryCore extends ObjectModel 'newOrderStatus' => $new_os, 'id_order' => (int)$order->id, )); + + ShopUrl::resetMainDomainCache(); } /** @@ -307,9 +374,7 @@ class OrderHistoryCore extends ObjectModel if (!$context) $context = Context::getContext(); $order = new Order($this->id_order); - $last_order_state = $order->getCurrentOrderState(); - $new_order_state = new OrderState($this->id_order_state, Configuration::get('PS_LANG_DEFAULT')); - + if (!$this->add($autodate)) return false; @@ -323,6 +388,8 @@ class OrderHistoryCore extends ObjectModel WHERE oh.`id_order_history` = '.(int)$this->id.' AND os.`send_email` = 1'); if (isset($result['template']) && Validate::isEmail($result['email'])) { + ShopUrl::cacheMainDomainForShop($order->id_shop); + $topic = $result['osname']; $data = array( '{lastname}' => $result['lastname'], @@ -343,45 +410,11 @@ class OrderHistoryCore extends ObjectModel $data['{total_paid}'] = Tools::displayPrice((float)$order->total_paid, new Currency((int)$order->id_currency), false); $data['{order_name}'] = $order->getUniqReference(); - // An additional email is sent the first time a virtual item is validated - $virtual_products = $order->getVirtualProducts(); - - if ($virtual_products && (!$last_order_state || !$last_order_state->logable) && $new_order_state && $new_order_state->logable) - { - $assign = array(); - foreach ($virtual_products as $key => $virtual_product) - { - $id_product_download = ProductDownload::getIdFromIdProduct($virtual_product['product_id']); - $product_download = new ProductDownload($id_product_download); - // If this virtual item has an associated file, we'll provide the link to download the file in the email - if ($product_download->display_filename != '') - { - $assign[$key]['name'] = $product_download->display_filename; - $dl_link = $product_download->getTextLink(false, $virtual_product['download_hash']) - .'&id_order='.$order->id - .'&secure_key='.$order->secure_key; - $assign[$key]['link'] = $dl_link; - if ($virtual_product['download_deadline'] != '0000-00-00 00:00:00') - $assign[$key]['deadline'] = Tools::displayDate($virtual_product['download_deadline'], $order->id_lang); - if ($product_download->nb_downloadable != 0) - $assign[$key]['downloadable'] = $product_download->nb_downloadable; - } - } - $context->smarty->assign('virtualProducts', $assign); - $context->smarty->assign('id_order', $order->id); - $iso = Language::getIsoById((int)($order->id_lang)); - $links = $context->smarty->fetch(_PS_MAIL_DIR_.$iso.'/download-product.tpl'); - $tmp_array = array('{nbProducts}' => count($virtual_products), '{virtualProducts}' => $links); - $data = array_merge ($data, $tmp_array); - // If there's at least one downloadable file - if (!empty($assign)) - Mail::Send((int)$order->id_lang, 'download_product', Mail::l('Virtual product to download', $order->id_lang), $data, $result['email'], $result['firstname'].' '.$result['lastname'], - null, null, null, null, _PS_MAIL_DIR_, false, (int)$order->id_shop); - } - if (Validate::isLoadedObject($order)) Mail::Send((int)$order->id_lang, $result['template'], $topic, $data, $result['email'], $result['firstname'].' '.$result['lastname'], null, null, null, null, _PS_MAIL_DIR_, false, (int)$order->id_shop); + + ShopUrl::resetMainDomainCache(); } return true; @@ -415,4 +448,27 @@ class OrderHistoryCore extends ObjectModel AND os.`logable` = 1'); } -} + /** + * Add method for webservice create resource Order History + * If sendemail=1 GET parameter is present sends email to customer otherwise does not + * @return bool + */ + public function addWs() + { + $sendemail = (bool)Tools::getValue('sendemail', false); + if ($sendemail) + { + //Mail::Send requires link object on context and is not set when getting here + $context = Context::getContext(); + if ($context->link == null) + { + $protocol_link = (Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; + $protocol_content = (Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; + $context->link = new Link($protocol_link, $protocol_content); + } + return $this->addWithemail(); + } + else + return $this->add(); + } +} \ No newline at end of file diff --git a/classes/order/OrderInvoice.php b/classes/order/OrderInvoice.php index e048edafa..31614f2c5 100644 --- a/classes/order/OrderInvoice.php +++ b/classes/order/OrderInvoice.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -345,6 +345,11 @@ class OrderInvoiceCore extends ObjectModel // shipping cost are added in the product taxes breakdown if ($this->useOneAfterAnotherTaxComputationMethod()) return $taxes_breakdown; + + // No shipping breakdown if it's free! + foreach ($order->getCartRules() as $cart_rule) + if ($cart_rule['free_shipping']) + return $taxes_breakdown; $shipping_tax_amount = $this->total_shipping_tax_incl - $this->total_shipping_tax_excl; @@ -379,21 +384,22 @@ class OrderInvoiceCore extends ObjectModel */ public function getEcoTaxTaxesBreakdown() { - $res = Db::getInstance()->executeS(' + $result = Db::getInstance()->executeS(' SELECT `ecotax_tax_rate` as `rate`, SUM(`ecotax` * `product_quantity`) as `ecotax_tax_excl`, SUM(`ecotax` * `product_quantity`) as `ecotax_tax_incl` FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int)$this->id_order.' AND `id_order_invoice` = '.(int)$this->id.' - GROUP BY `ecotax_tax_rate`' - ); + GROUP BY `ecotax_tax_rate`'); - if ($res) - foreach ($res as &$row) + $taxes = array(); + foreach ($result as $row) + if ($row['ecotax_tax_excl'] > 0) { $row['ecotax_tax_incl'] = Tools::ps_round($row['ecotax_tax_excl'] + ($row['ecotax_tax_excl'] * $row['rate'] / 100), 2); $row['ecotax_tax_excl'] = Tools::ps_round($row['ecotax_tax_excl'], 2); + $taxes[] = $row; } - return $res; + return $taxes; } /** @@ -516,14 +522,16 @@ class OrderInvoiceCore extends ObjectModel */ public function getTotalPaid() { - if (!array_key_exists($this->id, self::$_total_paid_cache)) + $cache_id = 'order_invoice_paid_'.(int)$this->id; + if (!Cache::isStored($cache_id)) { - self::$_total_paid_cache[$this->id] = 0; + $amount = 0; $payments = OrderPayment::getByInvoiceId($this->id); foreach ($payments as $payment) - self::$_total_paid_cache[$this->id] += $payment->amount; + $amount += $payment->amount; + Cache::store($cache_id, $amount); } - return self::$_total_paid_cache[$this->id]; + return Cache::retrieve($cache_id); } /** @@ -654,9 +662,9 @@ class OrderInvoiceCore extends ObjectModel * @param int $id_lang for invoice_prefix * @return string */ - public function getInvoiceNumberFormatted($id_lang) + public function getInvoiceNumberFormatted($id_lang, $id_shop = null) { - return '#'.Configuration::get('PS_INVOICE_PREFIX', $id_lang).sprintf('%06d', $this->number); + return '#'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, $id_shop).sprintf('%06d', $this->number); } public function saveCarrierTaxCalculator(array $taxes_amount) diff --git a/classes/order/OrderMessage.php b/classes/order/OrderMessage.php index 45153b617..5ff453dc9 100644 --- a/classes/order/OrderMessage.php +++ b/classes/order/OrderMessage.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/order/OrderPayment.php b/classes/order/OrderPayment.php index c0806253a..7d2d71bd8 100644 --- a/classes/order/OrderPayment.php +++ b/classes/order/OrderPayment.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/order/OrderReturn.php b/classes/order/OrderReturn.php index 9d665ee45..fe4fbd578 100644 --- a/classes/order/OrderReturn.php +++ b/classes/order/OrderReturn.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -56,7 +56,7 @@ class OrderReturnCore extends ObjectModel 'fields' => array( 'id_customer' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), 'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'required' => true), - 'question' => array('type' => self::TYPE_HTML, 'validate' => 'isMessage'), + 'question' => array('type' => self::TYPE_HTML, 'validate' => 'isCleanHtml'), 'state' => array('type' => self::TYPE_STRING), 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), @@ -225,11 +225,12 @@ class OrderReturnCore extends ObjectModel public static function addReturnedQuantity(&$products, $id_order) { $details = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT od.id_order_detail, GREATEST(od.product_quantity_return, IFNULL(ord.product_quantity,0)) as qty_returned + SELECT od.id_order_detail, GREATEST(od.product_quantity_return, IFNULL(SUM(ord.product_quantity),0)) as qty_returned FROM '._DB_PREFIX_.'order_detail od LEFT JOIN '._DB_PREFIX_.'order_return_detail ord ON ord.id_order_detail = od.id_order_detail - WHERE od.id_order = '.(int)$id_order + WHERE od.id_order = '.(int)$id_order.' + GROUP BY od.id_order_detail' ); if (!$details) return; diff --git a/classes/order/OrderReturnState.php b/classes/order/OrderReturnState.php index dcbf2811e..9d273a951 100644 --- a/classes/order/OrderReturnState.php +++ b/classes/order/OrderReturnState.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/order/OrderSlip.php b/classes/order/OrderSlip.php index 290330611..a9b38457d 100644 --- a/classes/order/OrderSlip.php +++ b/classes/order/OrderSlip.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/order/OrderState.php b/classes/order/OrderState.php index 536c23734..7cc1d5375 100644 --- a/classes/order/OrderState.php +++ b/classes/order/OrderState.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/order/index.php b/classes/order/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/order/index.php +++ b/classes/order/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/pdf/HTMLTemplate.php b/classes/pdf/HTMLTemplate.php index ee6ba0763..954e8b243 100755 --- a/classes/pdf/HTMLTemplate.php +++ b/classes/pdf/HTMLTemplate.php @@ -1,7 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -42,7 +41,7 @@ abstract class HTMLTemplateCore */ public function getHeader() { - $shop_name = Configuration::get('PS_SHOP_NAME'); + $shop_name = Configuration::get('PS_SHOP_NAME', null, null, (int)$this->order->id_shop); $path_logo = $this->getLogo(); $width = 0; @@ -74,10 +73,10 @@ abstract class HTMLTemplateCore $this->smarty->assign(array( 'available_in_your_account' => $this->available_in_your_account, 'shop_address' => $shop_address, - 'shop_fax' => Configuration::get('PS_SHOP_FAX'), - 'shop_phone' => Configuration::get('PS_SHOP_PHONE'), - 'shop_details' => Configuration::get('PS_SHOP_DETAILS'), - 'free_text' => Configuration::get('PS_INVOICE_FREE_TEXT', (int)Context::getContext()->language->id) + 'shop_fax' => Configuration::get('PS_SHOP_FAX', null, null, (int)$this->order->id_shop), + 'shop_phone' => Configuration::get('PS_SHOP_PHONE', null, null, (int)$this->order->id_shop), + 'shop_details' => Configuration::get('PS_SHOP_DETAILS', null, null, (int)$this->order->id_shop), + 'free_text' => Configuration::get('PS_INVOICE_FREE_TEXT', (int)Context::getContext()->language->id, null, (int)$this->order->id_shop) )); return $this->smarty->fetch($this->getTemplate('footer')); @@ -110,10 +109,10 @@ abstract class HTMLTemplateCore $physical_uri = Context::getContext()->shop->physical_uri.'img/'; - if (Configuration::get('PS_LOGO_INVOICE') != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE'))) - $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE'); - elseif (Configuration::get('PS_LOGO') != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO'))) - $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO'); + if (Configuration::get('PS_LOGO_INVOICE', null, null, (int)$this->order->id_shop) != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE', null, null, (int)$this->order->id_shop))) + $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE', null, null, (int)$this->order->id_shop); + elseif (Configuration::get('PS_LOGO', null, null, (int)$this->order->id_shop) != false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, (int)$this->order->id_shop))) + $logo = _PS_IMG_DIR_.Configuration::get('PS_LOGO', null, null, (int)$this->order->id_shop); return $logo; } @@ -162,7 +161,7 @@ abstract class HTMLTemplateCore { $template = false; $default_template = _PS_PDF_DIR_.'/'.$template_name.'.tpl'; - $overriden_template = _PS_THEME_DIR_.'/pdf/'.$template_name.'.tpl'; + $overriden_template = _PS_THEME_DIR_.'pdf/'.$template_name.'.tpl'; if (file_exists($overriden_template)) $template = $overriden_template; diff --git a/classes/pdf/HTMLTemplateDeliverySlip.php b/classes/pdf/HTMLTemplateDeliverySlip.php index 13bc1c7e9..b5ea014fe 100755 --- a/classes/pdf/HTMLTemplateDeliverySlip.php +++ b/classes/pdf/HTMLTemplateDeliverySlip.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -38,7 +38,7 @@ class HTMLTemplateDeliverySlipCore extends HTMLTemplate $this->smarty = $smarty; // header informations - $this->date = Tools::displayDate($this->order->invoice_date, (int)$this->order->id_lang); + $this->date = Tools::displayDate($this->order->invoice_date); $this->title = HTMLTemplateDeliverySlip::l('Delivery').' #'.Configuration::get('PS_DELIVERY_PREFIX', Context::getContext()->language->id).sprintf('%06d', $this->order_invoice->delivery_number); // footer informations @@ -60,13 +60,16 @@ class HTMLTemplateDeliverySlipCore extends HTMLTemplate $invoice_address = new Address((int)$this->order->id_address_invoice); $formatted_invoice_address = AddressFormat::generateAddress($invoice_address, array(), '
        ', ' '); } - + + $carrier = new Carrier($this->order->id_carrier); + $carrier->name = ($carrier->name == '0' ? Configuration::get('PS_SHOP_NAME') : $carrier->name); $this->smarty->assign(array( 'order' => $this->order, 'order_details' => $this->order_invoice->getProducts(), 'delivery_address' => $formatted_delivery_address, 'invoice_address' => $formatted_invoice_address, - 'order_invoice' => $this->order_invoice + 'order_invoice' => $this->order_invoice, + 'carrier' => $carrier )); return $this->smarty->fetch($this->getTemplate('delivery-slip')); @@ -87,7 +90,7 @@ class HTMLTemplateDeliverySlipCore extends HTMLTemplate */ public function getFilename() { - return Configuration::get('PS_DELIVERY_PREFIX').sprintf('%06d', $this->order->invoice_number).'.pdf'; + return Configuration::get('PS_DELIVERY_PREFIX', Context::getContext()->language->id, null, $this->order->id_shop).sprintf('%06d', $this->order->invoice_number).'.pdf'; } } diff --git a/classes/pdf/HTMLTemplateInvoice.php b/classes/pdf/HTMLTemplateInvoice.php index 2bc879f61..8116eb03c 100755 --- a/classes/pdf/HTMLTemplateInvoice.php +++ b/classes/pdf/HTMLTemplateInvoice.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -39,10 +39,10 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate $this->smarty = $smarty; // header informations - $this->date = Tools::displayDate($order_invoice->date_add, (int)$this->order->id_lang); + $this->date = Tools::displayDate($order_invoice->date_add); $id_lang = Context::getContext()->language->id; - $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang).sprintf('%06d', $order_invoice->number); + $this->title = HTMLTemplateInvoice::l('Invoice ').' #'.Configuration::get('PS_INVOICE_PREFIX', $id_lang, null, (int)$this->order->id_shop).sprintf('%06d', $order_invoice->number); // footer informations $this->shop = new Shop((int)$this->order->id_shop); } @@ -85,11 +85,12 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate */ public function getTaxTabContent() { - $invoice_address = new Address((int)$this->order->id_address_invoice); + $address = new Address((int)$this->order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $tax_exempt = Configuration::get('VATNUMBER_MANAGEMENT') - && !empty($invoice_address->vat_number) - && $invoice_address->id_country != Configuration::get('VATNUMBER_COUNTRY'); - + && !empty($address->vat_number) + && $address->id_country != Configuration::get('VATNUMBER_COUNTRY'); + $carrier = new Carrier($this->order->id_carrier); + $this->smarty->assign(array( 'tax_exempt' => $tax_exempt, 'use_one_after_another_method' => $this->order_invoice->useOneAfterAnotherTaxComputationMethod(), @@ -98,7 +99,8 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate 'ecotax_tax_breakdown' => $this->order_invoice->getEcoTaxTaxesBreakdown(), 'wrapping_tax_breakdown' => $this->order_invoice->getWrappingTaxesBreakdown(), 'order' => $this->order, - 'order_invoice' => $this->order_invoice + 'order_invoice' => $this->order_invoice, + 'carrier' => $carrier )); return $this->smarty->fetch($this->getTemplate('invoice.tax-tab')); @@ -137,7 +139,7 @@ class HTMLTemplateInvoiceCore extends HTMLTemplate */ public function getFilename() { - return Configuration::get('PS_INVOICE_PREFIX').sprintf('%06d', $this->order_invoice->number).'.pdf'; + return Configuration::get('PS_INVOICE_PREFIX', Context::getContext()->language->id, null, $this->order->id_shop).sprintf('%06d', $this->order_invoice->number).'.pdf'; } } diff --git a/classes/pdf/HTMLTemplateOrderReturn.php b/classes/pdf/HTMLTemplateOrderReturn.php index ed1b3ff37..4bee5be8c 100755 --- a/classes/pdf/HTMLTemplateOrderReturn.php +++ b/classes/pdf/HTMLTemplateOrderReturn.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -39,7 +39,7 @@ class HTMLTemplateOrderReturnCore extends HTMLTemplate $this->order = new Order($order_return->id_order); // header informations - $this->date = Tools::displayDate($this->order->invoice_date, (int)$this->order->id_lang); + $this->date = Tools::displayDate($this->order->invoice_date); $this->title = HTMLTemplateOrderReturn::l('Order Return ').sprintf('%06d', $this->order_return->id); // footer informations diff --git a/classes/pdf/HTMLTemplateOrderSlip.php b/classes/pdf/HTMLTemplateOrderSlip.php index f0aa42af0..95d9b9f1f 100644 --- a/classes/pdf/HTMLTemplateOrderSlip.php +++ b/classes/pdf/HTMLTemplateOrderSlip.php @@ -1,29 +1,28 @@ - * @copyright 2007-2012 PrestaShop SA - * @version Release: $Revision: 8797 $ - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - * International Registered Trademark & Property of PrestaShop SA - */ +* 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 +* @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 +*/ /** * @since 1.5 @@ -47,7 +46,7 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice // header informations $this->date = Tools::displayDate($this->order->invoice_date, (int)$this->order->id_lang); - $this->title = HTMLTemplateOrderSlip::l('Slip #').sprintf('%06d', (int)$this->order_slip->id); + $this->title = HTMLTemplateOrderSlip::l('Slip #').Configuration::get('PS_CREDIT_SLIP_PREFIX', Context::getContext()->language->id).sprintf('%06d', (int)$this->order_slip->id); // footer informations $this->shop = new Shop((int)$this->order->id_shop); @@ -143,10 +142,10 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice */ public function getTaxTabContent() { - $invoice_address = new Address((int)$this->order->id_address_invoice); + $address = new Address((int)$this->order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); $tax_exempt = Configuration::get('VATNUMBER_MANAGEMENT') - && !empty($invoice_address->vat_number) - && $invoice_address->id_country != Configuration::get('VATNUMBER_COUNTRY'); + && !empty($address->vat_number) + && $address->id_country != Configuration::get('VATNUMBER_COUNTRY'); $this->smarty->assign(array( 'tax_exempt' => $tax_exempt, @@ -195,10 +194,9 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice } else { + $tax_rate = 0; foreach ($tax_amount as $tax_id => $amount) { - $tax_rate = 0; - $tax = new Tax((int)$tax_id); $tax_rate = $tax->rate; $infos['total_price_tax_excl'] += (float)Tools::ps_round($order_slip_details['amount_tax_excl'], 2); @@ -213,6 +211,8 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice if ($ecotax) foreach ($tmp_tax_infos as $rate => &$row) { + if (!isset($ecotax[$rate])) + continue; $row['total_price_tax_excl'] -= $ecotax[$rate]['ecotax_tax_excl']; $row['total_amount'] -= ($ecotax[$rate]['ecotax_tax_incl'] - $ecotax[$rate]['ecotax_tax_excl']); } diff --git a/classes/pdf/HTMLTemplateSupplyOrderForm.php b/classes/pdf/HTMLTemplateSupplyOrderForm.php index e9e320953..16a94b8e5 100644 --- a/classes/pdf/HTMLTemplateSupplyOrderForm.php +++ b/classes/pdf/HTMLTemplateSupplyOrderForm.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/pdf/PDF.php b/classes/pdf/PDF.php index e3904b33c..5027237e0 100755 --- a/classes/pdf/PDF.php +++ b/classes/pdf/PDF.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -54,7 +54,7 @@ class PDFCore public function render($display = true) { $render = false; - $this->pdf_renderer->setFontForLang('fr'); + $this->pdf_renderer->setFontForLang(Context::getContext()->language->iso_code); foreach ($this->objects as $object) { $template = $this->getTemplateObject($object); @@ -80,7 +80,12 @@ class PDFCore } if ($render) + { + // clean the output buffer + if (ob_get_level() && ob_get_length() > 0) + ob_clean(); return $this->pdf_renderer->render($this->filename, $display); + } } public function getTemplateObject($object) diff --git a/classes/pdf/PDFGenerator.php b/classes/pdf/PDFGenerator.php index d9e840364..3049eaf62 100755 --- a/classes/pdf/PDFGenerator.php +++ b/classes/pdf/PDFGenerator.php @@ -1,10 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ +require_once(_PS_TOOL_DIR_.'tcpdf/config/lang/eng.php'); +require_once(_PS_TOOL_DIR_.'tcpdf/tcpdf.php'); + /** * @since 1.5 */ @@ -40,7 +39,37 @@ class PDFGeneratorCore extends TCPDF public $content; public $font; - public $font_by_lang = array('jp' => 'cid0jp'); + public $font_by_lang = array( + 'ja' => 'cid0jp', + 'bg' => 'freeserif', + 'ru' => 'freeserif', + 'uk' => 'freeserif', + 'mk' => 'freeserif', + 'el' => 'freeserif', + 'en' => 'dejavusans', + 'vn' => 'dejavusans', + 'pl' => 'dejavusans', + 'ar' => 'dejavusans', + 'fa' => 'dejavusans', + 'ur' => 'dejavusans', + 'az' => 'dejavusans', + 'ca' => 'dejavusans', + 'gl' => 'dejavusans', + 'hr' => 'dejavusans', + 'sr' => 'dejavusans', + 'si' => 'dejavusans', + 'cs' => 'dejavusans', + 'sk' => 'dejavusans', + 'ka' => 'dejavusans', + 'he' => 'dejavusans', + 'lo' => 'dejavusans', + 'lv' => 'dejavusans', + 'tr' => 'dejavusans', + 'ko' => 'cid0kr', + 'zh' => 'cid0cs', + 'tw' => 'cid0cs', + 'th' => 'freeserif' + ); public function __construct($use_cache = false) @@ -94,11 +123,12 @@ class PDFGeneratorCore extends TCPDF public function setFontForLang($iso_lang) { $this->font = PDFGenerator::DEFAULT_FONT; - $this->setHeaderFont(array(PDFGenerator::DEFAULT_FONT, '', PDF_FONT_SIZE_MAIN)); - $this->setFooterFont(array(PDFGenerator::DEFAULT_FONT, '', PDF_FONT_SIZE_MAIN)); if (array_key_exists($iso_lang, $this->font_by_lang)) $this->font = $this->font_by_lang[$iso_lang]; + $this->setHeaderFont(array($this->font, '', PDF_FONT_SIZE_MAIN)); + $this->setFooterFont(array($this->font, '', PDF_FONT_SIZE_MAIN)); + $this->setFont($this->font); } @@ -122,7 +152,7 @@ class PDFGeneratorCore extends TCPDF * Render the pdf file * * @param string $filename - * @param boolean $inline + * @param $display : true:display to user, false:save, 'I','D','S' as fpdf display * @throws PrestaShopException */ public function render($filename, $display = true) @@ -132,7 +162,17 @@ class PDFGeneratorCore extends TCPDF $this->lastPage(); - $output = $display ? 'I' : 'S'; + if ($display === true) + $output = 'D'; + elseif ($display === false) + $output = 'S'; + elseif ($display == 'D') + $output = 'D'; + elseif ($display == 'S') + $output = 'S'; + else + $output = 'I'; + return $this->output($filename, $output); } @@ -150,4 +190,46 @@ class PDFGeneratorCore extends TCPDF $this->writeHTML($this->content, true, false, true, false, ''); } -} \ No newline at end of file + + /** + * Override of TCPDF::getRandomSeed() - getmypid() is blocked on several hosting + */ + protected function getRandomSeed($seed='') + { + $seed .= microtime(); + if (function_exists('openssl_random_pseudo_bytes') AND (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN')) { + // this is not used on windows systems because it is very slow for a know bug + $seed .= openssl_random_pseudo_bytes(512); + } else { + for ($i = 0; $i < 23; ++$i) { + $seed .= uniqid('', true); + } + } + $seed .= uniqid('', true); + $seed .= rand(); + $seed .= __FILE__; + $seed .= $this->bufferlen; + if (isset($_SERVER['REMOTE_ADDR'])) { + $seed .= $_SERVER['REMOTE_ADDR']; + } + if (isset($_SERVER['HTTP_USER_AGENT'])) { + $seed .= $_SERVER['HTTP_USER_AGENT']; + } + if (isset($_SERVER['HTTP_ACCEPT'])) { + $seed .= $_SERVER['HTTP_ACCEPT']; + } + if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { + $seed .= $_SERVER['HTTP_ACCEPT_ENCODING']; + } + if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { + $seed .= $_SERVER['HTTP_ACCEPT_LANGUAGE']; + } + if (isset($_SERVER['HTTP_ACCEPT_CHARSET'])) { + $seed .= $_SERVER['HTTP_ACCEPT_CHARSET']; + } + $seed .= rand(); + $seed .= uniqid('', true); + $seed .= microtime(); + return $seed; + } +} diff --git a/classes/pdf/index.php b/classes/pdf/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/pdf/index.php +++ b/classes/pdf/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/range/RangePrice.php b/classes/range/RangePrice.php index 877568eff..ca1b286cc 100644 --- a/classes/range/RangePrice.php +++ b/classes/range/RangePrice.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/range/RangeWeight.php b/classes/range/RangeWeight.php index 89f9db117..4cf0b99e4 100644 --- a/classes/range/RangeWeight.php +++ b/classes/range/RangeWeight.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/range/index.php b/classes/range/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/range/index.php +++ b/classes/range/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/shop/Shop.php b/classes/shop/Shop.php index 0f436a028..da7a42e6c 100644 --- a/classes/shop/Shop.php +++ b/classes/shop/Shop.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -179,7 +179,7 @@ class ShopCore extends ObjectModel 'supplier' => array('type' => 'shop'), ); - foreach($asso_tables as $table_name => $table_details) + foreach ($asso_tables as $table_name => $table_details) Shop::addTableAssociation($table_name, $table_details); Shop::$initialized = true; @@ -308,7 +308,7 @@ class ShopCore extends ObjectModel WHERE (su.domain = \''.$host.'\' OR su.domain_ssl = \''.$host.'\') AND s.active = 1 AND s.deleted = 0 - ORDER BY LENGTH(uri) DESC'; + ORDER BY LENGTH(CONCAT(su.physical_uri, su.virtual_uri)) DESC'; $id_shop = ''; $found_uri = ''; @@ -330,10 +330,6 @@ class ShopCore extends ObjectModel } } - // Optimization - don't redirect and allow WS and other script to work - if (!$id_shop) - $id_shop = Configuration::get('PS_SHOP_DEFAULT'); - // If an URL was found but is not the main URL, redirect to main URL if ($id_shop && !$is_main_uri) { @@ -353,12 +349,27 @@ class ShopCore extends ObjectModel } } - if (!$id_shop && defined('_PS_ADMIN_DIR_')) + if ((!$id_shop && defined('_PS_ADMIN_DIR_')) || Tools::isPHPCLI()) { // If in admin, we can access to the shop without right URL - $shop = new Shop(Configuration::get('PS_SHOP_DEFAULT')); + if ((!$id_shop && Tools::isPHPCLI()) || defined('_PS_ADMIN_DIR_')) + $id_shop = (int)Configuration::get('PS_SHOP_DEFAULT'); + + $shop = new Shop((int)$id_shop); + if (!Validate::isLoadedObject($shop)) + $shop = new Shop((int)Configuration::get('PS_SHOP_DEFAULT')); + $shop->physical_uri = preg_replace('#/+#', '/', str_replace('\\', '/', dirname(dirname($_SERVER['SCRIPT_NAME']))).'/'); $shop->virtual_uri = ''; + + // Define some $_SERVER variables like HTTP_HOST if PHP is launched with php-cli + if (Tools::isPHPCLI()) + { + if(!isset($_SERVER['HTTP_HOST']) || empty($_SERVER['HTTP_HOST'])) + $_SERVER['HTTP_HOST'] = $shop->domain; + if(!isset($_SERVER['SERVER_NAME']) || empty($_SERVER['SERVER_NAME'])) + $_SERVER['SERVER_NAME'] = $shop->domain; + } } else { @@ -947,7 +958,10 @@ class ShopCore extends ObjectModel public static function addSqlRestrictionOnLang($alias = null, $id_shop = null) { if (is_null($id_shop)) - $id_shop = Context::getContext()->shop->id; + $id_shop = (int)Context::getContext()->shop->id; + if (!$id_shop) + $id_shop = (int)Configuration::get('PS_SHOP_DEFAULT'); + return ' AND '.(($alias) ? $alias.'.' : '').'id_shop = '.$id_shop.' '; } @@ -979,6 +993,10 @@ class ShopCore extends ObjectModel { // If we duplicate some specific data, automatically duplicate other data linked to the first // E.g. if carriers are duplicated for the shop, duplicate carriers langs too + + if (!$old_id) + $old_id = Configuration::get('PS_SHOP_DEFAULT'); + if (isset($tables_import['carrier'])) { $tables_import['carrier_tax_rules_group_shop'] = true; diff --git a/classes/shop/ShopGroup.php b/classes/shop/ShopGroup.php index 932180260..7818fb56f 100644 --- a/classes/shop/ShopGroup.php +++ b/classes/shop/ShopGroup.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -153,4 +153,15 @@ class ShopGroupCore extends ObjectModel return false; } -} + + public function shopNameExists($name, $id_shop = false) + { + return Db::getInstance()->getValue(' + SELECT id_shop + FROM '._DB_PREFIX_.'shop + WHERE name = "'.pSQL($name).'" + AND id_shop_group = '.(int)$this->id.' + '.($id_shop ? 'AND id_shop != '.(int)$id_shop : '') + ); + } +} \ No newline at end of file diff --git a/classes/shop/ShopUrl.php b/classes/shop/ShopUrl.php index cdd34fcd0..5edf106d4 100644 --- a/classes/shop/ShopUrl.php +++ b/classes/shop/ShopUrl.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,8 +34,8 @@ class ShopUrlCore extends ObjectModel public $main; public $active; - protected static $main_domain = null; - protected static $main_domain_ssl = null; + protected static $main_domain = array(); + protected static $main_domain_ssl = array(); /** * @see ObjectModel::$definition @@ -124,10 +124,11 @@ class ShopUrlCore extends ObjectModel public function canAddThisUrl($domain, $domain_ssl, $physical_uri, $virtual_uri) { $physical_uri = trim($physical_uri, '/'); + if ($physical_uri) $physical_uri = preg_replace('#/+#', '/', '/'.$physical_uri.'/'); else - $this->physical_uri = '/'; + $physical_uri = '/'; $virtual_uri = trim($virtual_uri, '/'); if ($virtual_uri) @@ -142,25 +143,35 @@ class ShopUrlCore extends ObjectModel return Db::getInstance()->getValue($sql); } - public static function getMainShopDomain() + public static function cacheMainDomainForShop($id_shop) { - if (!self::$main_domain) - self::$main_domain = Db::getInstance()->getValue('SELECT domain - FROM '._DB_PREFIX_.'shop_url - WHERE main=1 AND id_shop = '.Context::getContext()->shop->id); - return self::$main_domain; + if (!isset(self::$main_domain_ssl[(int)$id_shop]) || !isset(self::$main_domain[(int)$id_shop])) + { + $row = Db::getInstance()->getRow(' + SELECT domain, domain_ssl + FROM '._DB_PREFIX_.'shop_url + WHERE main = 1 + AND id_shop = '.($id_shop !== null ? (int)$id_shop : Context::getContext()->shop->id)); + self::$main_domain[(int)$id_shop] = $row['domain']; + self::$main_domain_ssl[(int)$id_shop] = $row['domain_ssl']; + } + } + + public static function resetMainDomainCache() + { + self::$main_domain = array(); + self::$main_domain_ssl = array(); } - public static function getMainShopDomainSSL() + public static function getMainShopDomain($id_shop = null) { - if (!self::$main_domain_ssl) - { - $sql = 'SELECT domain_ssl - FROM '._DB_PREFIX_.'shop_url - WHERE main = 1 - AND id_shop='.Context::getContext()->shop->id; - self::$main_domain_ssl = Db::getInstance()->getValue($sql); - } - return self::$main_domain_ssl; + ShopUrl::cacheMainDomainForShop($id_shop); + return self::$main_domain[(int)$id_shop]; } -} + + public static function getMainShopDomainSSL($id_shop = null) + { + ShopUrl::cacheMainDomainForShop($id_shop); + return self::$main_domain_ssl[(int)$id_shop]; + } +} \ No newline at end of file diff --git a/classes/shop/index.php b/classes/shop/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/shop/index.php +++ b/classes/shop/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/Stock.php b/classes/stock/Stock.php index 785da1fca..5d72263d5 100644 --- a/classes/stock/Stock.php +++ b/classes/stock/Stock.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/StockAvailable.php b/classes/stock/StockAvailable.php index e545d21ac..fbdaa1a2f 100644 --- a/classes/stock/StockAvailable.php +++ b/classes/stock/StockAvailable.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -171,6 +171,14 @@ class StockAvailableCore extends ObjectModel continue; $product_quantity = $manager->getProductRealQuantities($id_product, null, $allowed_warehouse_for_product_clean, true); + + Hook::exec('actionUpdateQuantity', + array( + 'id_product' => $id_product, + 'id_product_attribute' => 0, + 'quantity' => $product_quantity + ) + ); } // else this product has attributes, hence loops on $ids_product_attribute else @@ -359,9 +367,11 @@ class StockAvailableCore extends ObjectModel */ public function add($autodate = true, $null_values = false) { - if (!parent::add($autodate, $null_values)) + if (!$result = parent::add($autodate, $null_values)) return false; - $this->postSave(); + + $result &= $this->postSave(); + return $result; } /** @@ -370,9 +380,11 @@ class StockAvailableCore extends ObjectModel */ public function update($null_values = false) { - if (!parent::update($null_values)) + if (!$result = parent::update($null_values)) return false; - return $this->postSave(); + + $result &= $this->postSave(); + return $result; } /** @@ -545,11 +557,31 @@ class StockAvailableCore extends ObjectModel return true; } - return Db::getInstance()->execute(' + $res = Db::getInstance()->execute(' DELETE FROM '._DB_PREFIX_.'stock_available WHERE id_product = '.(int)$id_product. ($id_product_attribute ? ' AND id_product_attribute = '.(int)$id_product_attribute : ''). StockAvailable::addSqlShopRestriction(null, $shop)); + + if ($id_product_attribute) + { + if ($shop === null || !Validate::isLoadedObject($shop)) + { + $shop_datas = array(); + StockAvailable::addSqlShopParams($shop_datas); + $id_shop = (int)$shop_datas['id_shop']; + } + else + $id_shop = (int)$shop->id; + + $stock_available = new StockAvailable(); + $stock_available->id_product = (int)$id_product; + $stock_available->id_product_attribute = (int)$id_product; + $stock_available->id_shop = (int)$id_shop; + $stock_available->postSave(); + } + + return $res; } /** diff --git a/classes/stock/StockManager.php b/classes/stock/StockManager.php index c6e2331eb..a313da21f 100644 --- a/classes/stock/StockManager.php +++ b/classes/stock/StockManager.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -473,19 +473,19 @@ class StockManagerCore implements StockManagerInterface $query->where('od.product_id = '.(int)$id_product); if (0 != $id_product_attribute) $query->where('od.product_attribute_id = '.(int)$id_product_attribute); - $query->leftJoin('order_history', 'oh', 'oh.id_order = o.id_order AND oh.date_add = o.date_upd'); + $query->leftJoin('order_history', 'oh', 'oh.id_order = o.id_order AND oh.id_order_state = o.current_state'); $query->leftJoin('order_state', 'os', 'os.id_order_state = oh.id_order_state'); $query->where('os.shipped != 1'); $query->where('o.valid = 1 OR (os.id_order_state != '.(int)Configuration::get('PS_OS_ERROR').' AND os.id_order_state != '.(int)Configuration::get('PS_OS_CANCELED').')'); $query->groupBy('od.id_order_detail'); - //if (count($ids_warehouse)) - //$query->where('od.id_warehouse IN('.implode(', ', $ids_warehouse).')'); + if (count($ids_warehouse)) + $query->where('od.id_warehouse IN('.implode(', ', $ids_warehouse).')'); $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); $client_orders_qty = 0; if (count($res)) foreach ($res as $row) - $client_orders_qty += $row['product_quantity'] + $row['product_quantity_refunded']; + $client_orders_qty += ($row['product_quantity'] - $row['product_quantity_refunded']); // Gets supply_orders_qty $query = new DbQuery(); diff --git a/classes/stock/StockManagerFactory.php b/classes/stock/StockManagerFactory.php index 160850221..02c812a16 100644 --- a/classes/stock/StockManagerFactory.php +++ b/classes/stock/StockManagerFactory.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/StockManagerInterface.php b/classes/stock/StockManagerInterface.php index d902abc3c..f8b5ce728 100644 --- a/classes/stock/StockManagerInterface.php +++ b/classes/stock/StockManagerInterface.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/StockManagerModule.php b/classes/stock/StockManagerModule.php index 3180ed914..fe22910cb 100644 --- a/classes/stock/StockManagerModule.php +++ b/classes/stock/StockManagerModule.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/StockMvt.php b/classes/stock/StockMvt.php index fa0f00100..83bd79e08 100644 --- a/classes/stock/StockMvt.php +++ b/classes/stock/StockMvt.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -236,7 +236,7 @@ class StockMvtCore extends ObjectModel $query->innerJoin('stock', 's', 's.id_stock = sm.id_stock'); $query->innerJoin('warehouse', 'w', 'w.id_warehouse = s.id_warehouse'); $query->where('sm.sign = 1'); - $query->where('s.id_product = '.(int)$id_product.' AND s.id_product_attribute = '.(int)$id_product_attribute); + $query->where('s.id_product = '.(int)$id_product.' OR s.id_product_attribute = '.(int)$id_product_attribute); $query->orderBy('date_add DESC'); $res = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query); diff --git a/classes/stock/StockMvtReason.php b/classes/stock/StockMvtReason.php index 27a060f80..a26e8aadd 100644 --- a/classes/stock/StockMvtReason.php +++ b/classes/stock/StockMvtReason.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/StockMvtWS.php b/classes/stock/StockMvtWS.php index 258dc031d..50c7ecec4 100644 --- a/classes/stock/StockMvtWS.php +++ b/classes/stock/StockMvtWS.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/SupplyOrder.php b/classes/stock/SupplyOrder.php index a6901b439..4bef8a8f0 100755 --- a/classes/stock/SupplyOrder.php +++ b/classes/stock/SupplyOrder.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/SupplyOrderDetail.php b/classes/stock/SupplyOrderDetail.php index 29f5bf61c..37a8c85a9 100755 --- a/classes/stock/SupplyOrderDetail.php +++ b/classes/stock/SupplyOrderDetail.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/SupplyOrderHistory.php b/classes/stock/SupplyOrderHistory.php index 767ff6dcc..8e41b643a 100755 --- a/classes/stock/SupplyOrderHistory.php +++ b/classes/stock/SupplyOrderHistory.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/SupplyOrderReceiptHistory.php b/classes/stock/SupplyOrderReceiptHistory.php index 10e593d03..e7700bf1e 100755 --- a/classes/stock/SupplyOrderReceiptHistory.php +++ b/classes/stock/SupplyOrderReceiptHistory.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/SupplyOrderState.php b/classes/stock/SupplyOrderState.php index 38d57c1a5..01bdfde31 100755 --- a/classes/stock/SupplyOrderState.php +++ b/classes/stock/SupplyOrderState.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/Warehouse.php b/classes/stock/Warehouse.php index 0182d7a1b..4ad3d3f65 100644 --- a/classes/stock/Warehouse.php +++ b/classes/stock/Warehouse.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/WarehouseProductLocation.php b/classes/stock/WarehouseProductLocation.php index 1d7f90a19..e2275201d 100644 --- a/classes/stock/WarehouseProductLocation.php +++ b/classes/stock/WarehouseProductLocation.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/stock/index.php b/classes/stock/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/stock/index.php +++ b/classes/stock/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/tax/Tax.php b/classes/tax/Tax.php index 8d6beea8a..65a15157d 100644 --- a/classes/tax/Tax.php +++ b/classes/tax/Tax.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/tax/TaxCalculator.php b/classes/tax/TaxCalculator.php index 2185c76ec..7064f27c3 100644 --- a/classes/tax/TaxCalculator.php +++ b/classes/tax/TaxCalculator.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/tax/TaxManagerFactory.php b/classes/tax/TaxManagerFactory.php index 383495835..fb765dc11 100644 --- a/classes/tax/TaxManagerFactory.php +++ b/classes/tax/TaxManagerFactory.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/tax/TaxManagerInterface.php b/classes/tax/TaxManagerInterface.php index b4ad6cb64..2caf62eb2 100644 --- a/classes/tax/TaxManagerInterface.php +++ b/classes/tax/TaxManagerInterface.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/tax/TaxManagerModule.php b/classes/tax/TaxManagerModule.php index 628d0d7dd..7c1b9e88e 100644 --- a/classes/tax/TaxManagerModule.php +++ b/classes/tax/TaxManagerModule.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/tax/TaxRule.php b/classes/tax/TaxRule.php index c45329f79..e59a2ddb9 100644 --- a/classes/tax/TaxRule.php +++ b/classes/tax/TaxRule.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/tax/TaxRulesGroup.php b/classes/tax/TaxRulesGroup.php index f950f46bd..ea597bab7 100644 --- a/classes/tax/TaxRulesGroup.php +++ b/classes/tax/TaxRulesGroup.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -53,13 +53,22 @@ class TaxRulesGroupCore extends ObjectModel protected static $_taxes = array(); - public static function getTaxRulesGroups($only_active = true) + public static function getTaxRulesGroups($only_active = true, $multiShop = false) { - return Db::getInstance()->executeS(' - SELECT * - FROM `'._DB_PREFIX_.'tax_rules_group` g' - .($only_active ? ' WHERE g.`active` = 1' : '').' - ORDER BY name ASC'); + if ((bool)$multiShop) { + return Db::getInstance()->executeS(' + SELECT * + FROM `'._DB_PREFIX_.'tax_rules_group` g' + .Shop::addSqlAssociation('tax_rules_group', 'g') + .($only_active ? ' WHERE g.`active` = 1' : '').' + ORDER BY name ASC'); + } else { + return Db::getInstance()->executeS(' + SELECT * + FROM `'._DB_PREFIX_.'tax_rules_group` g' + .($only_active ? ' WHERE g.`active` = 1' : '').' + ORDER BY name ASC'); + } } /** @@ -113,11 +122,11 @@ class TaxRulesGroupCore extends ObjectModel ); } - public function hasUniqueTaxRuleForCountry($id_country, $id_state) + public function hasUniqueTaxRuleForCountry($id_country, $id_state, $id_tax_rule = false) { $rules = TaxRule::getTaxRulesByGroupId((int)Context::getContext()->language->id, (int)$this->id); foreach ($rules as $rule) - if ($rule['id_country'] == $id_country && $id_state == $rule['id_state'] && !$rule['behavior']) + if ($rule['id_country'] == $id_country && $id_state == $rule['id_state'] && !$rule['behavior'] && (int)$id_tax_rule != $rule['id_tax_rule']) return true; return false; diff --git a/classes/tax/TaxRulesTaxManager.php b/classes/tax/TaxRulesTaxManager.php index eb4cabc7a..dcb78419e 100644 --- a/classes/tax/TaxRulesTaxManager.php +++ b/classes/tax/TaxRulesTaxManager.php @@ -1,7 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -65,13 +64,18 @@ class TaxRulesTaxManagerCore implements TaxManagerInterface */ public function getTaxCalculator() { + static $tax_enabled = null; + if (isset($this->tax_calculator)) return $this->tax_calculator; + if ($tax_enabled === null) + $tax_enabled = Configuration::get('PS_TAX'); + + if (!$tax_enabled) + return new TaxCalculator(array()); + $taxes = array(); - if (!Configuration::get('PS_TAX')) - return new TaxCalculator($taxes); - $postcode = 0; if (!empty($this->address->postcode)) $postcode = $this->address->postcode; @@ -84,7 +88,7 @@ class TaxRulesTaxManagerCore implements TaxManagerInterface WHERE `id_country` = '.(int)$this->address->id_country.' AND `id_tax_rules_group` = '.(int)$this->type.' AND `id_state` IN (0, '.(int)$this->address->id_state.') - AND (\''.pSQL($postcode).'\' BETWEEN `zipcode_from` AND `zipcode_to` OR `zipcode_from` = 0 OR `zipcode_from` = \''.pSQL($postcode).'\') + AND (\''.pSQL($postcode).'\' BETWEEN `zipcode_from` AND `zipcode_to` OR (`zipcode_to` = 0 AND `zipcode_from` IN(0, \''.pSQL($postcode).'\'))) ORDER BY `zipcode_from` DESC, `zipcode_to` DESC, `id_state` DESC, `id_country` DESC'); $behavior = 0; diff --git a/classes/tax/index.php b/classes/tax/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/tax/index.php +++ b/classes/tax/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/webservice/WebserviceException.php b/classes/webservice/WebserviceException.php index 7f2ebde62..1865647ae 100755 --- a/classes/webservice/WebserviceException.php +++ b/classes/webservice/WebserviceException.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/webservice/WebserviceKey.php b/classes/webservice/WebserviceKey.php index b92cf9516..decc3132a 100755 --- a/classes/webservice/WebserviceKey.php +++ b/classes/webservice/WebserviceKey.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/webservice/WebserviceOutputBuilder.php b/classes/webservice/WebserviceOutputBuilder.php index 552e44881..8aaabea65 100755 --- a/classes/webservice/WebserviceOutputBuilder.php +++ b/classes/webservice/WebserviceOutputBuilder.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -47,6 +47,8 @@ class WebserviceOutputBuilderCore protected $virtualFields = array(); protected $statusInt; protected $wsParamOverrides; + + protected static $_cache_ws_parameters = array(); // Header properties protected $headerParams = array( @@ -283,7 +285,7 @@ class WebserviceOutputBuilderCore if (is_null($this->wsResource)) throw new WebserviceException ('You must set web service resource for get the resources list.', array(82, 500)); $output = ''; - $more_attr = array('shop_name' => htmlentities(Configuration::get('PS_SHOP_NAME'))); + $more_attr = array('shop_name' => htmlspecialchars(Configuration::get('PS_SHOP_NAME'))); $output .= $this->objectRender->renderNodeHeader('api', array(), $more_attr); foreach ($this->wsResource as $resourceName => $resource) { @@ -359,7 +361,11 @@ class WebserviceOutputBuilderCore $type_of_view = self::VIEW_DETAILS; } - $ws_params = $objects['empty']->getWebserviceParameters(); + $class = get_class($objects['empty']); + if (!isset(WebserviceOutputBuilder::$_cache_ws_parameters[$class])) + WebserviceOutputBuilder::$_cache_ws_parameters[$class] = $objects['empty']->getWebserviceParameters(); + $ws_params = WebserviceOutputBuilder::$_cache_ws_parameters[$class]; + foreach ($this->wsParamOverrides AS $p) { $object = $p['object']; @@ -376,7 +382,7 @@ class WebserviceOutputBuilderCore { if ($key !== 'empty') { - if ($this->fieldsToDisplay === 'minimum') + if ($this->fieldsToDisplay === 'minimum') $output .= $this->renderEntityMinimum($object, $depth); else $output .= $this->renderEntity($object, $depth); @@ -406,7 +412,11 @@ class WebserviceOutputBuilderCore */ public function renderEntityMinimum($object, $depth) { - $ws_params = $object->getWebserviceParameters(); + $class = get_class($object); + if (!isset(WebserviceOutputBuilder::$_cache_ws_parameters[$class])) + WebserviceOutputBuilder::$_cache_ws_parameters[$class] = $object->getWebserviceParameters(); + $ws_params = WebserviceOutputBuilder::$_cache_ws_parameters[$class]; + $more_attr['id'] = $object->id; $more_attr['xlink_resource'] = $this->wsUrl.$ws_params['objectsNodeName'].'/'.$object->id; $output = $this->setIndent($depth).$this->objectRender->renderNodeHeader($ws_params['objectNodeName'], $ws_params, $more_attr, false); @@ -446,7 +456,12 @@ class WebserviceOutputBuilderCore public function renderEntity($object, $depth) { $output = ''; - $ws_params = $object->getWebserviceParameters(); + + $class = get_class($object); + if (!isset(WebserviceOutputBuilder::$_cache_ws_parameters[$class])) + WebserviceOutputBuilder::$_cache_ws_parameters[$class] = $object->getWebserviceParameters(); + $ws_params = WebserviceOutputBuilder::$_cache_ws_parameters[$class]; + foreach ($this->wsParamOverrides AS $p) { $o = $p['object']; @@ -792,4 +807,4 @@ class WebserviceOutputBuilderCore { $this->fieldsToDisplay = $fields; } -} \ No newline at end of file +} diff --git a/classes/webservice/WebserviceOutputInterface.php b/classes/webservice/WebserviceOutputInterface.php index ac50aab3b..c603543ca 100755 --- a/classes/webservice/WebserviceOutputInterface.php +++ b/classes/webservice/WebserviceOutputInterface.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/webservice/WebserviceOutputXML.php b/classes/webservice/WebserviceOutputXML.php index e99673c8a..9df8cef90 100755 --- a/classes/webservice/WebserviceOutputXML.php +++ b/classes/webservice/WebserviceOutputXML.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/webservice/WebserviceRequest.php b/classes/webservice/WebserviceRequest.php index 2df91e930..c90e3a43a 100644 --- a/classes/webservice/WebserviceRequest.php +++ b/classes/webservice/WebserviceRequest.php @@ -1,6 +1,6 @@ array('description' => 'The product categories','class' => 'Category'), 'combinations' => array('description' => 'The product combinations','class' => 'Combination'), 'configurations' => array('description' => 'Shop configuration', 'class' => 'Configuration'), + 'contacts' => array('description' => 'Shop contacts','class' => 'Contact'), 'countries' => array('description' => 'The countries','class' => 'Country'), 'currencies' => array('description' => 'The currencies', 'class' => 'Currency'), 'customers' => array('description' => 'The e-shop\'s customers','class' => 'Customer'), + 'customer_threads' => array('description' => 'Customer services threads','class' => 'CustomerThread'), + 'customer_messages' => array('description' => 'Customer services messages','class' => 'CustomerMessage'), 'deliveries' => array('description' => 'Product delivery', 'class' => 'Delivery'), 'groups' => array('description' => 'The customer\'s groups','class' => 'Group'), 'guests' => array('description' => 'The guests', 'class' => 'Guest'), @@ -333,7 +336,7 @@ class WebserviceRequestCore $id_country = (int)(isset($value['country']) ? $value['country'] : (Configuration::get('PS_COUNTRY_DEFAULT'))); $id_state = (int)(isset($value['state']) ? $value['state'] : 0); $id_currency = (int)(isset($value['currency']) ? $value['currency'] : Configuration::get('PS_CURRENCY_DEFAULT')); - $id_group = (int)(isset($value['group']) ? $value['group'] : Configuration::get('_PS_DEFAULT_CUSTOMER_GROUP_')); + $id_group = (int)(isset($value['group']) ? $value['group'] : (int)Configuration::get('PS_CUSTOMER_GROUP')); $quantity = (int)(isset($value['quantity']) ? $value['quantity'] : 1); $use_tax = (int)(isset($value['use_tax']) ? $value['use_tax'] : Configuration::get('PS_TAX')); $decimals = (int)(isset($value['decimals']) ? $value['decimals'] : Configuration::get('PS_PRICE_ROUND_MODE')); @@ -527,9 +530,10 @@ class WebserviceRequestCore } } } - return $this->returnOutput(); + $return = $this->returnOutput(); unset($webservice_call); - unset ($display_errors); + unset($display_errors); + return $return; } protected function webserviceChecks() @@ -1155,6 +1159,7 @@ class WebserviceRequestCore $sorts = array($this->urlFragments['sort']); $sql_sort .= ' ORDER BY '; + foreach ($sorts as $sort) { $delimiterPosition = strrpos($sort, '_'); @@ -1181,7 +1186,14 @@ class WebserviceRequestCore $sql_sort .= 'main_i18n.`'.pSQL($this->resourceConfiguration['fields'][$fieldName]['sqlId']).'` '.$direction.', ';// ORDER BY main_i18n.`field` ASC|DESC } else - $sql_sort .= (isset($this->resourceConfiguration['retrieveData']['tableAlias']) ? $this->resourceConfiguration['retrieveData']['tableAlias'].'.' : '').'`'.pSQL($this->resourceConfiguration['fields'][$fieldName]['sqlId']).'` '.$direction.', ';// ORDER BY `field` ASC|DESC + { + $object = new $this->resourceConfiguration['retrieveData']['className'](); + if ($object->isMultiShopField($this->resourceConfiguration['fields'][$fieldName]['sqlId'])) + $table_alias = 'multi_shop_'.$this->resourceConfiguration['retrieveData']['table']; + else + $table_alias = ''; + $sql_sort .= (isset($this->resourceConfiguration['retrieveData']['tableAlias']) ? '`'.bqSQL($this->resourceConfiguration['retrieveData']['tableAlias']).'`.' : '`'.bqSQL($table_alias).'`.').'`'.pSQL($this->resourceConfiguration['fields'][$fieldName]['sqlId']).'` '.$direction.', ';// ORDER BY `field` ASC|DESC + } } $sql_sort = rtrim($sql_sort, ', ')."\n"; } @@ -1209,12 +1221,15 @@ class WebserviceRequestCore return $filters; } - - public function getFilteredObjectList() { $objects = array(); $filters = $this->manageFilters(); + + /* If we only need to display the synopsis, analyzing the first row is sufficient */ + if (isset($this->urlFragments['schema']) && in_array($this->urlFragments['schema'], array('blank', 'synopsis'))) + $filters = array('sql_join' => '', 'sql_filter' => '', 'sql_sort' => '', 'sql_limit' => ' LIMIT 1'); + $this->resourceConfiguration['retrieveData']['params'][] = $filters['sql_join']; $this->resourceConfiguration['retrieveData']['params'][] = $filters['sql_filter']; $this->resourceConfiguration['retrieveData']['params'][] = $filters['sql_sort']; @@ -1226,7 +1241,16 @@ class WebserviceRequestCore if ($sqlObjects) { foreach ($sqlObjects as $sqlObject) - $objects[] = new $this->resourceConfiguration['retrieveData']['className']((int)$sqlObject[$this->resourceConfiguration['fields']['id']['sqlId']]); + { + if ($this->fieldsToDisplay == 'minimum') + { + $obj = new $this->resourceConfiguration['retrieveData']['className'](); + $obj->id = (int)$sqlObject[$this->resourceConfiguration['fields']['id']['sqlId']]; + $objects[] = $obj; + } + else + $objects[] = new $this->resourceConfiguration['retrieveData']['className']((int)$sqlObject[$this->resourceConfiguration['fields']['id']['sqlId']]); + } return $objects; } } diff --git a/classes/webservice/WebserviceSpecificManagementImages.php b/classes/webservice/WebserviceSpecificManagementImages.php index 7901617bc..dd6401e5a 100755 --- a/classes/webservice/WebserviceSpecificManagementImages.php +++ b/classes/webservice/WebserviceSpecificManagementImages.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -33,7 +33,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage /** * @var string The extension of the image to display */ - protected $imgExtension = 'jpg'; + protected $imgExtension; /** * @var array The type of images (general, categories, manufacturers, suppliers, stores...) @@ -119,10 +119,18 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage // display image content if needed else if ($this->imgToDisplay) { + if(empty($this->imgExtension)){ + $imginfo = getimagesize($this->imgToDisplay); + $this->imgExtension = image_type_to_extension($imginfo[2],false); + } + $imageResource = false; - $types = array('jpg' => array('function' => 'imagecreatefromjpeg', 'Content-Type' => 'image/jpeg'), - 'gif' => array('function' => 'imagecreatefromgif', 'Content-Type' => 'image/gif') - ); + $types = array( + 'jpg' => array('function' => 'imagecreatefromjpeg', 'Content-Type' => 'image/jpeg'), + 'jpeg' => array('function' => 'imagecreatefromjpeg', 'Content-Type' => 'image/jpeg'), + 'png' => array('function' => 'imagecreatefrompng', 'Content-Type' => 'image/png'), + 'gif' => array('function' => 'imagecreatefromgif', 'Content-Type' => 'image/gif') + ); if (array_key_exists($this->imgExtension, $types)) $imageResource = @$types[$this->imgExtension]['function']($this->imgToDisplay); @@ -323,7 +331,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage // Set the image path on display in relation to the header image case 'header': if (in_array($this->wsObject->method, array('GET','HEAD','PUT'))) - $path = _PS_IMG_DIR_.'logo.jpg'; + $path = _PS_IMG_DIR_.Configuration::get('PS_LOGO'); else throw new WebserviceException('This method is not allowed with general image resources.', array(49, 405)); break; @@ -387,7 +395,7 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage { case 'GET': case 'HEAD': - $this->imgToDisplay = ($path != '' && file_exists($path)) ? $path : $alternative_path; + $this->imgToDisplay = ($path != '' && file_exists($path) && is_file($path)) ? $path : $alternative_path; return true; break; case 'PUT': @@ -692,8 +700,13 @@ class WebserviceSpecificManagementImagesCore implements WebserviceSpecificManage $image = new Image((int)$this->wsObject->urlSegment[3]); return $image->delete(); } + elseif (in_array($this->imageType, array('categories', 'manufacturers', 'suppliers', 'stores'))) + { + $object = new $this->wsObject->resourceList[$this->imageType]['class']((int)$this->wsObject->urlSegment[2]); + return $object->deleteImage(true); + } else - return $this->deleteImageOnDisk($filename, $imageSizes, $directory); + return $this->deleteImageOnDisk($filename, $imageSizes, $directory); } else throw new WebserviceException('This image does not exist on disk', array(64, 500)); diff --git a/classes/webservice/WebserviceSpecificManagementInterface.php b/classes/webservice/WebserviceSpecificManagementInterface.php index d6ff7760c..ff7361bf4 100755 --- a/classes/webservice/WebserviceSpecificManagementInterface.php +++ b/classes/webservice/WebserviceSpecificManagementInterface.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/webservice/WebserviceSpecificManagementSearch.php b/classes/webservice/WebserviceSpecificManagementSearch.php index ac979dacf..c257910c7 100755 --- a/classes/webservice/WebserviceSpecificManagementSearch.php +++ b/classes/webservice/WebserviceSpecificManagementSearch.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/classes/webservice/index.php b/classes/webservice/index.php index cadb1ea6e..5ca842ada 100644 --- a/classes/webservice/index.php +++ b/classes/webservice/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/cms.php b/cms.php index a100f2513..ff2c40d7c 100644 --- a/cms.php +++ b/cms.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=cms'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +Tools::redirect('index.php?controller=cms'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file diff --git a/config/alias.php b/config/alias.php index 511c4ec5b..9c4cbb36a 100644 --- a/config/alias.php +++ b/config/alias.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -71,6 +71,13 @@ function bqSQL($string) return str_replace('`', '\`', pSQL($string)); } +function displayFatalError() +{ + $error = error_get_last(); + if ($error !== NULL && in_array($error['type'], array(E_ERROR, E_PARSE))) + echo '[PrestaShop] Fatal error in module '.substr(basename($error['file']), 0, -4).':
        '.$error['message']; +} + /** * @deprecated */ diff --git a/config/autoload.php b/config/autoload.php index 021289250..7a9c0f4a9 100644 --- a/config/autoload.php +++ b/config/autoload.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/config/config.inc.php b/config/config.inc.php index 568a8f90a..763f3a135 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -59,8 +59,12 @@ if (_PS_DEBUG_PROFILING_) include_once(_PS_TOOL_DIR_.'profiling/ObjectModel.php'); include_once(_PS_TOOL_DIR_.'profiling/Hook.php'); include_once(_PS_TOOL_DIR_.'profiling/Db.php'); + include_once(_PS_TOOL_DIR_.'profiling/Tools.php'); } +if (Tools::isPHPCLI()) + Tools::argvToGET($argc, $argv); + /* Redefine REQUEST_URI if empty (on some webservers...) */ if (!isset($_SERVER['REQUEST_URI']) || empty($_SERVER['REQUEST_URI'])) { @@ -82,11 +86,21 @@ if (!isset($_SERVER['REQUEST_URI']) || empty($_SERVER['REQUEST_URI'])) /* Trying to redefine HTTP_HOST if empty (on some webservers...) */ if (!isset($_SERVER['HTTP_HOST']) || empty($_SERVER['HTTP_HOST'])) $_SERVER['HTTP_HOST'] = @getenv('HTTP_HOST'); + +$context = Context::getContext(); /* Initialize the current Shop */ -Context::getContext()->shop = Shop::initialize(); -define('_THEME_NAME_', Context::getContext()->shop->getTheme()); -define('__PS_BASE_URI__', Context::getContext()->shop->getBaseURI()); +try +{ + $context->shop = Shop::initialize(); +} +catch (PrestaShopException $e) +{ + $e->displayMessage(); +} + +define('_THEME_NAME_', $context->shop->getTheme()); +define('__PS_BASE_URI__', $context->shop->getBaseURI()); /* Include all defines related to base uri and theme name */ require_once(dirname(__FILE__).'/defines_uri.inc.php'); @@ -102,11 +116,18 @@ Language::loadLanguages(); /* Loading default country */ $defaultCountry = new Country(Configuration::get('PS_COUNTRY_DEFAULT'), Configuration::get('PS_LANG_DEFAULT')); -Context::getContext()->country = $defaultCountry; +$context->country = $defaultCountry; /* It is not safe to rely on the system's timezone settings, and this would generate a PHP Strict Standards notice. */ @date_default_timezone_set(Configuration::get('PS_TIMEZONE')); +/* Set locales */ +$locale = strtolower(Configuration::get('PS_LOCALE_LANGUAGE')).'_'.strtoupper(Configuration::get('PS_LOCALE_COUNTRY').'.UTF-8'); +setlocale(LC_COLLATE, $locale); +setlocale(LC_CTYPE, $locale); +setlocale(LC_TIME, $locale); +setlocale(LC_NUMERIC, 'en_US.UTF-8'); + /* Instantiate cookie */ @@ -117,24 +138,25 @@ if (defined('_PS_ADMIN_DIR_')) $cookie = new Cookie('psAdmin', '', $cookie_lifetime); else { - if (Context::getContext()->shop->getGroup()->share_order) - $cookie = new Cookie('ps-sg'.Context::getContext()->shop->getGroup()->id, '', $cookie_lifetime, Context::getContext()->shop->getUrlsSharedCart()); + if ($context->shop->getGroup()->share_order) + $cookie = new Cookie('ps-sg'.$context->shop->getGroup()->id, '', $cookie_lifetime, $context->shop->getUrlsSharedCart()); else { $domains = null; - if(Context::getContext()->shop->domain != Context::getContext()->shop->domain_ssl) - $domains = array(Context::getContext()->shop->domain_ssl, Context::getContext()->shop->domain); + if ($context->shop->domain != $context->shop->domain_ssl) + $domains = array($context->shop->domain_ssl, $context->shop->domain); - $cookie = new Cookie('ps-s'.Context::getContext()->shop->id, '', $cookie_lifetime, $domains); + $cookie = new Cookie('ps-s'.$context->shop->id, '', $cookie_lifetime, $domains); } } -Context::getContext()->cookie = $cookie; +$context->cookie = $cookie; + /* Create employee if in BO, customer else */ if (defined('_PS_ADMIN_DIR_')) { $employee = new Employee($cookie->id_employee); - Context::getContext()->employee = $employee; + $context->employee = $employee; /* Auth on shops are recached after employee assignation */ if ($employee->id_profile != _PS_ADMIN_PROFILE_) @@ -142,31 +164,48 @@ if (defined('_PS_ADMIN_DIR_')) $cookie->id_lang = (int)$employee->id_lang; } -else -{ - if (isset($cookie->id_customer) && (int)$cookie->id_customer) - { - $customer = new Customer($cookie->id_customer); - $customer->logged = $cookie->logged; - } - else - { - $customer = new Customer(); - - // Change the default group - if (Group::isFeatureActive()) - $customer->id_default_group = Configuration::get('PS_UNIDENTIFIED_GROUP'); - } - $customer->id_guest = $cookie->id_guest; - Context::getContext()->customer = $customer; -} /* if the language stored in the cookie is not available language, use default language */ if (isset($cookie->id_lang) && $cookie->id_lang) $language = new Language($cookie->id_lang); if (!isset($language) || !Validate::isLoadedObject($language)) $language = new Language(Configuration::get('PS_LANG_DEFAULT')); -Context::getContext()->language = $language; +$context->language = $language; + +if (!defined('_PS_ADMIN_DIR_')) +{ + if (isset($cookie->id_customer) && (int)$cookie->id_customer) + { + $customer = new Customer($cookie->id_customer); + if(!Validate::isLoadedObject($customer)) + $customer->logout(); + else + { + $customer->logged = $cookie->logged; + + if ($customer->id_lang != $context->language->id) + { + $customer->id_lang = $context->language->id; + $customer->update(); + } + } + } + + if (!isset($customer) || !Validate::isLoadedObject($customer)) + { + $customer = new Customer(); + + // Change the default group + if (Group::isFeatureActive()) + $customer->id_default_group = Configuration::get('PS_UNIDENTIFIED_GROUP'); + } + $customer->id_guest = $cookie->id_guest; + $context->customer = $customer; +} + +/* Link should also be initialized in the context here for retrocompatibility */ +$https_link = (Tools::usingSecureMode() && Configuration::get('PS_SSL_ENABLED')) ? 'https://' : 'http://'; +$context->link = new Link($https_link, $https_link); /** * @deprecated : these defines are going to be deleted on 1.6 version of Prestashop @@ -187,4 +226,4 @@ define('_PS_OS_WS_PAYMENT_', Configuration::get('PS_OS_WS_PAYMENT')); /* Get smarty */ require_once(dirname(__FILE__).'/smarty.config.inc.php'); -Context::getContext()->smarty = $smarty; +$context->smarty = $smarty; diff --git a/config/defines.inc.php b/config/defines.inc.php index 7d12cd05e..ab72ff105 100755 --- a/config/defines.inc.php +++ b/config/defines.inc.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -28,7 +28,8 @@ define('_PS_MODE_DEV_', true); if (_PS_MODE_DEV_) { - @ini_set('display_errors', 'on'); + @ini_set('display_errors', 'on'); + @error_reporting(E_ALL | E_STRICT); define('_PS_DEBUG_SQL_', true); /* Compatibility warning */ define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true); @@ -142,7 +143,7 @@ define('_STOCK_MOVEMENT_MISSING_REASON_', 4); /** * @deprecated 1.5.0.1 - * @see const PS_CUSTOMER_GROUP + * @see Configuration::get('PS_CUSTOMER_GROUP') */ define('_PS_DEFAULT_CUSTOMER_GROUP_', 3); diff --git a/config/defines_uri.inc.php b/config/defines_uri.inc.php index 86e0b1242..34cbae33b 100644 --- a/config/defines_uri.inc.php +++ b/config/defines_uri.inc.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -71,11 +71,11 @@ define('_THEME_LANG_DIR_', _PS_IMG_.'l/'); define('_THEME_COL_DIR_', _PS_IMG_.'co/'); define('_THEME_GENDERS_DIR_', _PS_IMG_.'genders/'); define('_SUPP_DIR_', _PS_IMG_.'su/'); -define('_PS_PROD_IMG_', 'img/p/'); +define('_PS_PROD_IMG_', _PS_IMG_.'p/'); /* Other URLs */ define('_PS_JS_DIR_', __PS_BASE_URI__.'js/'); define('_PS_CSS_DIR_', __PS_BASE_URI__.'css/'); define('_THEME_PROD_PIC_DIR_', __PS_BASE_URI__.'upload/'); define('_MAIL_DIR_', __PS_BASE_URI__.'mails/'); -define('_MODULE_DIR_', __PS_BASE_URI__.'modules/'); \ No newline at end of file +define('_MODULE_DIR_', __PS_BASE_URI__.'modules/'); diff --git a/config/index.php b/config/index.php index c9411c13f..daf91706a 100644 --- a/config/index.php +++ b/config/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/config/smarty.config.inc.php b/config/smarty.config.inc.php index ecbc44194..128900a6d 100644 --- a/config/smarty.config.inc.php +++ b/config/smarty.config.inc.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -32,6 +32,8 @@ global $smarty; $smarty = new Smarty(); $smarty->setCompileDir(_PS_CACHE_DIR_.'smarty/compile'); $smarty->setCacheDir(_PS_CACHE_DIR_.'smarty/cache'); +if (!Tools::getSafeModeStatus()) + $smarty->use_sub_dirs = true; $smarty->setConfigDir(_PS_SMARTY_DIR_.'configs'); $smarty->caching = false; $smarty->force_compile = (Configuration::get('PS_SMARTY_FORCE_COMPILE') == _PS_SMARTY_FORCE_COMPILE_) ? true : false; @@ -55,11 +57,6 @@ if (defined('_PS_ADMIN_DIR_')) else require_once (dirname(__FILE__).'/smartyfront.config.inc.php'); -if (Configuration::get('PS_HTML_THEME_COMPRESSION')) - $smarty->registerFilter('output', 'smartyMinifyHTML'); -if (Configuration::get('PS_JS_HTML_THEME_COMPRESSION')) - $smarty->registerFilter('output', 'smartyPackJSinHTML'); - smartyRegisterFunction($smarty, 'modifier', 'truncate', 'smarty_modifier_truncate'); smartyRegisterFunction($smarty, 'modifier', 'secureReferrer', array('Tools', 'secureReferrer')); @@ -80,6 +77,9 @@ smartyRegisterFunction($smarty, 'function', 'displayPrice', array('Tools', 'disp smartyRegisterFunction($smarty, 'modifier', 'convertAndFormatPrice', array('Product', 'convertAndFormatPrice')); // used twice smartyRegisterFunction($smarty, 'function', 'getAdminToken', array('Tools', 'getAdminTokenLiteSmarty')); smartyRegisterFunction($smarty, 'function', 'displayAddressDetail', array('AddressFormat', 'generateAddressSmarty')); +smartyRegisterFunction($smarty, 'function', 'getWidthSize', array('Image', 'getWidth')); +smartyRegisterFunction($smarty, 'function', 'getHeightSize', array('Image', 'getHeight')); + function smartyDieObject($params, &$smarty) { @@ -228,7 +228,17 @@ class SmartyLazyRegister if (is_array($item[1])) return call_user_func_array($item[1].'::'.$item[0], array($arguments[0], &$arguments[1])); else - return call_user_func_array($item, array($arguments[0], &$arguments[1])); + { + $args = array(); + + foreach($arguments as $a => $argument) + if($a == 0) + $args[] = $arguments[0]; + else + $args[] = &$arguments[$a]; + + return call_user_func_array($item, $args); + } } public static function getInstance() diff --git a/config/smartyadmin.config.inc.php b/config/smartyadmin.config.inc.php index 6c9e82da2..9f5654082 100644 --- a/config/smartyadmin.config.inc.php +++ b/config/smartyadmin.config.inc.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ + global $smarty; $smarty->debugging = false; $smarty->debugging_ctrl = 'NONE'; +/* Smarty should be in compile check mode in the BackOffice */ +$smarty->force_compile = false; +$smarty->compile_check = true; + function smartyTranslate($params, &$smarty) { $htmlentities = !isset($params['js']); $pdf = isset($params['pdf']); - $addslashes = isset($params['slashes']); + $addslashes = (isset($params['slashes']) || isset($params['js'])); $sprintf = isset($params['sprintf']) ? $params['sprintf'] : false; if ($pdf) @@ -52,7 +57,14 @@ function smartyTranslate($params, &$smarty) // If the tpl is used by a Controller else { - // Split by \ and / to get the folder tree for the file + if (isset(Context::getContext()->controller)) + { + $class_name = get_class(Context::getContext()->controller); + $class = substr($class_name, 0, strpos(Tools::strtolower($class_name), 'controller')); + } + else + { + // Split by \ and / to get the folder tree for the file $folder_tree = preg_split('#[/\\\]#', $filename); $key = array_search('controllers', $folder_tree); @@ -60,10 +72,12 @@ function smartyTranslate($params, &$smarty) // Eg. xxx/controllers/customers/xxx => AdminCustomers if ($key !== false) $class = 'Admin'.Tools::toCamelCase($folder_tree[$key + 1], true); + elseif (isset($folder_tree[0])) + $class = 'Admin'.Tools::toCamelCase($folder_tree[0], true); else $class = null; + } } return Translate::getAdminTranslation($params['s'], $class, $addslashes, $htmlentities, $sprintf); -} - +} \ No newline at end of file diff --git a/config/smartyfront.config.inc.php b/config/smartyfront.config.inc.php index 45b47c6bb..b95642a4b 100644 --- a/config/smartyfront.config.inc.php +++ b/config/smartyfront.config.inc.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ + global $smarty; $smarty->setTemplateDir(_PS_THEME_DIR_.'tpl'); +if (Configuration::get('PS_HTML_THEME_COMPRESSION')) + $smarty->registerFilter('output', 'smartyMinifyHTML'); +if (Configuration::get('PS_JS_HTML_THEME_COMPRESSION')) + $smarty->registerFilter('output', 'smartyPackJSinHTML'); + function smartyTranslate($params, &$smarty) { global $_LANG; - if (!isset($params['js'])) $params['js'] = 0; + if (!isset($params['js'])) $params['js'] = false; if (!isset($params['pdf'])) $params['pdf'] = false; if (!isset($params['mod'])) $params['mod'] = false; if (!isset($params['sprintf'])) $params['sprintf'] = null; @@ -45,7 +51,7 @@ function smartyTranslate($params, &$smarty) $key = 'override_'.$key; if ($params['mod']) - return Translate::getModuleTranslation($params['mod'], $params['s'], $basename, $params['sprintf']); + return Translate::getModuleTranslation($params['mod'], $params['s'], $basename, $params['sprintf'], $params['js']); else if ($params['pdf']) return Translate::getPdfTranslation($params['s']); @@ -62,6 +68,6 @@ function smartyTranslate($params, &$smarty) if ($params['sprintf'] !== null) $msg = Translate::checkAndReplaceArgs($msg, $params['sprintf']); - return $params['js'] ? $msg : Tools::htmlentitiesUTF8($msg); + return $params['js'] ? $msg : Tools::safeOutput($msg); } diff --git a/config/xml/index.php b/config/xml/index.php index c9411c13f..daf91706a 100755 --- a/config/xml/index.php +++ b/config/xml/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/config/xml/modules_list.xml b/config/xml/modules_list.xml deleted file mode 100755 index a1ff61374..000000000 --- a/config/xml/modules_list.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/contact-form.php b/contact-form.php index 2573da9bc..5891e5b0a 100644 --- a/contact-form.php +++ b/contact-form.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=contact'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +Tools::redirect('index.php?controller=contact'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file diff --git a/controllers/admin/AdminAccessController.php b/controllers/admin/AdminAccessController.php index bcbc90e2c..543a3b5d2 100644 --- a/controllers/admin/AdminAccessController.php +++ b/controllers/admin/AdminAccessController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -86,7 +86,7 @@ class AdminAccessControllerCore extends AdminController if ($m) $module['name'] = $m->displayName; else - $this->warnings[] = sprintf($this->l('%s: module is installed in database, but its files are missing or incompatible.'), ''.$module['name'].''); + $this->warnings[] = sprintf($this->l('%s module is installed in the database but its files are missing/incompatible.'), ''.$module['name'].''); } } @@ -134,7 +134,7 @@ class AdminAccessControllerCore extends AdminController if (_PS_MODE_DEMO_) throw new PrestaShopException(Tools::displayError('This functionality has been disabled.')); if ($this->tabAccess['edit'] != '1') - throw new PrestaShopException(Tools::displayError('You do not have permission to edit here.')); + throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.')); if (Tools::isSubmit('submitAddAccess')) { @@ -153,35 +153,32 @@ class AdminAccessControllerCore extends AdminController $join = 'LEFT JOIN `'._DB_PREFIX_.'tab` t ON (t.`id_tab` = a.`id_tab`)'; } - if ($id_tab == -1 && $perm == 'all' && $enabled == 0) - $sql = ' - UPDATE `'._DB_PREFIX_.'access` a - SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.' - WHERE `id_profile` = '.(int)$id_profile.' AND `id_tab` != '.(int)$this->id_tab_access; - else if ($id_tab == -1 && $perm == 'all') - $sql = ' + if ($id_tab == -1) + { + if ($perm == 'all') + $sql = ' UPDATE `'._DB_PREFIX_.'access` a SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.' WHERE `id_profile` = '.(int)$id_profile; - else if ($id_tab == -1) - $sql = ' + else + $sql = ' UPDATE `'._DB_PREFIX_.'access` a SET `'.bqSQL($perm).'` = '.(int)$enabled.' WHERE `id_profile` = '.(int)$id_profile; - else if ($perm == 'all') - $sql = ' - UPDATE `'._DB_PREFIX_.'access` a - '.$join.' - SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.' - WHERE '.$where.' = '.(int)$id_tab.' - AND `id_profile` = '.(int)$id_profile; + } else - $sql = ' - UPDATE `'._DB_PREFIX_.'access` a - '.$join.' + { + if ($perm == 'all') + $sql = ' + UPDATE `'._DB_PREFIX_.'access` a '.$join.' + SET `view` = '.(int)$enabled.', `add` = '.(int)$enabled.', `edit` = '.(int)$enabled.', `delete` = '.(int)$enabled.' + WHERE '.$where.' = '.(int)$id_tab.' AND `id_profile` = '.(int)$id_profile; + else + $sql = ' + UPDATE `'._DB_PREFIX_.'access` a '.$join.' SET `'.bqSQL($perm).'` = '.(int)$enabled.' - WHERE '.$where.' = '.(int)$id_tab.' - AND `id_profile` = '.(int)$id_profile; + WHERE '.$where.' = '.(int)$id_tab.' AND `id_profile` = '.(int)$id_profile; + } $res = Db::getInstance()->execute($sql) ? 'ok' : 'error'; @@ -194,7 +191,7 @@ class AdminAccessControllerCore extends AdminController if (_PS_MODE_DEMO_) throw new PrestaShopException(Tools::displayError('This functionality has been disabled.')); if ($this->tabAccess['edit'] != '1') - throw new PrestaShopException(Tools::displayError('You do not have permission to edit here.')); + throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.')); if (Tools::isSubmit('changeModuleAccess')) { diff --git a/controllers/admin/AdminAddonsCatalogController.php b/controllers/admin/AdminAddonsCatalogController.php index 0608ea433..e65a897f4 100644 --- a/controllers/admin/AdminAddonsCatalogController.php +++ b/controllers/admin/AdminAddonsCatalogController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/controllers/admin/AdminAddressesController.php b/controllers/admin/AdminAddressesController.php index a59cf68f1..cc411b8eb 100644 --- a/controllers/admin/AdminAddressesController.php +++ b/controllers/admin/AdminAddressesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -44,6 +44,8 @@ class AdminAddressesControllerCore extends AdminController $this->addRowAction('delete'); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); + $this->allow_export = true; + if (!Tools::getValue('realedit')) $this->deleted = true; @@ -53,26 +55,31 @@ class AdminAddressesControllerCore extends AdminController $this->fields_list = array( 'id_address' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), - 'firstname' => array('title' => $this->l('First name'), 'width' => 120, 'filter_key' => 'a!firstname'), - 'lastname' => array('title' => $this->l('Last name'), 'width' => 140, 'filter_key' => 'a!lastname'), + 'firstname' => array('title' => $this->l('First Name'), 'width' => 120, 'filter_key' => 'a!firstname'), + 'lastname' => array('title' => $this->l('Last Name'), 'width' => 140, 'filter_key' => 'a!lastname'), 'address1' => array('title' => $this->l('Address')), - 'postcode' => array('title' => $this->l('Postal Code/Zip Code'), 'align' => 'right', 'width' => 80), + 'postcode' => array('title' => $this->l('Zip/Postal Code'), 'align' => 'right', 'width' => 80), 'city' => array('title' => $this->l('City'), 'width' => 150), 'country' => array('title' => $this->l('Country'), 'width' => 100, 'type' => 'select', 'list' => $this->countries_array, 'filter_key' => 'cl!id_country')); parent::__construct(); - } - public function renderList() - { $this->_select = 'cl.`name` as country'; $this->_join = ' LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = a.`id_country` AND cl.`id_lang` = '.(int)$this->context->language->id.') LEFT JOIN `'._DB_PREFIX_.'customer` c ON a.id_customer = c.id_customer '; $this->_where = 'AND a.id_customer != 0 '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER, 'c'); + } - return parent::renderList(); + public function initToolbar() + { + parent::initToolbar(); + if (!$this->display) + $this->toolbar_btn['import'] = array( + 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table, + 'desc' => $this->l('Import') + ); } public function renderForm() @@ -119,7 +126,7 @@ class AdminAddressesControllerCore extends AdminController 'name' => 'phone_mobile', 'size' => 33, 'required' => false, - 'desc' => sprintf($this->l('You must register at least one phone number %s'), '*') + 'desc' => Configuration::get('PS_ONE_PHONE_AT_LEAST')? sprintf($this->l('You must register at least one phone number %s'), '*') : '' ), array( 'type' => 'textarea', @@ -132,7 +139,7 @@ class AdminAddressesControllerCore extends AdminController ), ), 'submit' => array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ) ); @@ -145,18 +152,7 @@ class AdminAddressesControllerCore extends AdminController $token_customer = Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id); } - // @todo in 1.4, this include was done before the class declaration - // We should use a hook now - if (Configuration::get('VATNUMBER_MANAGEMENT') && file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php')) - include_once(_PS_MODULE_DIR_.'vatnumber/vatnumber.php'); - if (Configuration::get('VATNUMBER_MANAGEMENT')) - if (file_exists(_PS_MODULE_DIR_.'vatnumber/vatnumber.php') && VatNumber::isApplicable(Configuration::get('PS_COUNTRY_DEFAULT'))) - $vat = 'is_applicable'; - else - $vat = 'management'; - $this->tpl_form_vars = array( - 'vat' => isset($vat) ? $vat : null, 'customer' => isset($customer) ? $customer : null, 'tokenCustomer' => isset ($token_customer) ? $token_customer : null ); @@ -199,7 +195,7 @@ class AdminAddressesControllerCore extends AdminController $temp_fields[] = array( 'type' => 'text', - 'label' => $this->l('Last name'), + 'label' => $this->l('Last Name'), 'name' => 'lastname', 'size' => 33, 'required' => true, @@ -219,7 +215,7 @@ class AdminAddressesControllerCore extends AdminController $temp_fields[] = array( 'type' => 'text', - 'label' => $this->l('First name'), + 'label' => $this->l('First Name'), 'name' => 'firstname', 'size' => 33, 'required' => true, @@ -251,7 +247,7 @@ class AdminAddressesControllerCore extends AdminController { $temp_fields[] = array( 'type' => 'text', - 'label' => $this->l('Postal Code/Zip Code'), + 'label' => $this->l('Zip/Postal Code'), 'name' => 'postcode', 'size' => 33, 'required' => true, @@ -271,7 +267,7 @@ class AdminAddressesControllerCore extends AdminController { $temp_fields[] = array( 'type' => 'select', - 'label' => $this->l('Country:'), + 'label' => $this->l('Country'), 'name' => 'id_country', 'required' => false, 'default_value' => (int)$this->context->country->id, @@ -307,11 +303,11 @@ class AdminAddressesControllerCore extends AdminController if (Validate::isEmail(Tools::getValue('email'))) { $customer = new Customer(); - $customer->getByEmail(Tools::getValue('email')); + $customer->getByEmail(Tools::getValue('email'), null, false); if (Validate::isLoadedObject($customer)) $_POST['id_customer'] = $customer->id; else - $this->errors[] = Tools::displayError('This e-mail address is not registered.'); + $this->errors[] = Tools::displayError('This email address is not registered.'); } else if ($id_customer = Tools::getValue('id_customer')) { @@ -324,41 +320,30 @@ class AdminAddressesControllerCore extends AdminController else $this->errors[] = Tools::displayError('Unknown customer'); if (Country::isNeedDniByCountryId(Tools::getValue('id_country')) && !Tools::getValue('dni')) - $this->errors[] = Tools::displayError('Identification number is incorrect or has already been used.'); + $this->errors[] = Tools::displayError('The identification number is incorrect or has already been used.'); /* If the selected country does not contain states */ $id_state = (int)Tools::getValue('id_state'); $id_country = (int)Tools::getValue('id_country'); $country = new Country((int)$id_country); if ($country && !(int)$country->contains_states && $id_state) - $this->errors[] = Tools::displayError('You have selected a state for a country that does not contain states.'); + $this->errors[] = Tools::displayError('You\'ve selected a state for a country that does not contain states.'); /* If the selected country contains states, then a state have to be selected */ if ((int)$country->contains_states && !$id_state) $this->errors[] = Tools::displayError('An address located in a country containing states must have a state selected.'); - /* Check zip code */ - if ($country->need_zip_code) - { - $zip_code_format = $country->zip_code_format; - if (($postcode = Tools::getValue('postcode')) && $zip_code_format) - { - $zip_regexp = '/^'.$zip_code_format.'$/ui'; - $zip_regexp = str_replace(' ', '( |)', $zip_regexp); - $zip_regexp = str_replace('-', '(-|)', $zip_regexp); - $zip_regexp = str_replace('N', '[0-9]', $zip_regexp); - $zip_regexp = str_replace('L', '[a-zA-Z]', $zip_regexp); - $zip_regexp = str_replace('C', $country->iso_code, $zip_regexp); - if (!preg_match($zip_regexp, $postcode)) - $this->errors[] = Tools::displayError('Your Postal Code/Zip Code is incorrect.').'
        '. - Tools::displayError('Must be typed as follows:').' '. - str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $zip_code_format))); - } - else if ($zip_code_format) - $this->errors[] = Tools::displayError('Postal Code/Zip Code required.'); - else if ($postcode && !preg_match('/^[0-9a-zA-Z -]{4,9}$/ui', $postcode)) - $this->errors[] = Tools::displayError('Your Postal Code/Zip Code is incorrect.'); - } + $postcode = Tools::getValue('postcode'); + /* Check zip code format */ + if ($country->zip_code_format && !$country->checkZipCode($postcode)) + $this->errors[] = Tools::displayError('Your Postal / Zip Code is incorrect.').'
        '.Tools::displayError('It must be entered as follows:').' '.str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $country->zip_code_format))); + elseif(empty($postcode) && $country->need_zip_code) + $this->errors[] = Tools::displayError('A Zip / Postal code is required.'); + elseif ($postcode && !Validate::isPostCode($postcode)) + $this->errors[] = Tools::displayError('The Zip / Postal code is invalid.'); + + if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !Tools::getValue('phone') && !Tools::getValue('phone_mobile')) + $this->errors[] = Tools::displayError('You must register at least one phone number.'); /* If this address come from order's edition and is the same as the other one (invoice or delivery one) ** we delete its id_address to force the creation of a new one */ @@ -448,4 +433,41 @@ class AdminAddressesControllerCore extends AdminController } die; } + + /** + * Object Delete + */ + public function processDelete() + { + if (Validate::isLoadedObject($object = $this->loadObject())) + if (!$object->isUsed()) + $this->deleted = false; + + return parent::processDelete(); + } + + /** + * Delete multiple items + * + * @return boolean true if succcess + */ + protected function processBulkDelete() + { + if (is_array($this->boxes) && !empty($this->boxes)) + { + $deleted = false; + foreach ($this->boxes as $id) + { + $to_delete = new Address((int)$id); + if ($to_delete->isUsed()) + { + $deleted = true; + break; + } + } + $this->deleted = $deleted; + } + + return parent::processBulkDelete(); + } } diff --git a/controllers/admin/AdminAdminPreferencesController.php b/controllers/admin/AdminAdminPreferencesController.php index f1b09435c..1b2ad1322 100644 --- a/controllers/admin/AdminAdminPreferencesController.php +++ b/controllers/admin/AdminAdminPreferencesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -47,15 +47,15 @@ class AdminAdminPreferencesControllerCore extends AdminController 'fields' => array( 'PRESTASTORE_LIVE' => array( 'title' => $this->l('Automatically check for module updates'), - 'desc' => $this->l('New modules and updates are displayed on the modules page'), + 'desc' => $this->l('New modules and updates are displayed on the modules page.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL ), 'PS_COOKIE_CHECKIP' => array( - 'title' => $this->l('Check IP on the cookie'), - 'desc' => $this->l('Check the IP address of the cookie in order to avoid your cookie being stolen'), + 'title' => $this->l('Check the IP address on the cookie'), + 'desc' => $this->l('Check the IP address of the cookie in order to prevent your cookie from being stolen.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', @@ -63,7 +63,7 @@ class AdminAdminPreferencesControllerCore extends AdminController 'visibility' => Shop::CONTEXT_ALL ), 'PS_COOKIE_LIFETIME_FO' => array( - 'title' => $this->l('Lifetime of the Front Office cookie'), + 'title' => $this->l('Lifetime of Front Office cookies'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', @@ -72,7 +72,7 @@ class AdminAdminPreferencesControllerCore extends AdminController 'visibility' => Shop::CONTEXT_ALL ), 'PS_COOKIE_LIFETIME_BO' => array( - 'title' => $this->l('Lifetime of the Back Office cookie'), + 'title' => $this->l('Lifetime of Back Office cookies'), 'desc' => $this->l('Indicate the number of hours'), 'validation' => 'isInt', 'cast' => 'intval', @@ -88,31 +88,31 @@ class AdminAdminPreferencesControllerCore extends AdminController 'icon' => 'tab-preferences', 'fields' => array( 'PS_ATTACHMENT_MAXIMUM_SIZE' => array( - 'title' => $this->l('Attachment maximum size'), - 'desc' => $this->l('Set the maximum size of attachment files (in MegaBytes).').' '.$this->l('Maximum:').' '. + 'title' => $this->l('Maximum size for attachment'), + 'desc' => $this->l('Set the maximum size allowed for attachment files (in MegaBytes).').' '.$this->l('Maximum:').' '. ((int)str_replace('M', '', ini_get('post_max_size')) > (int)str_replace('M', '', ini_get('upload_max_filesize')) ? ini_get('upload_max_filesize') : ini_get('post_max_size')), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', - 'suffix' => $this->l('Megabytes'), + 'suffix' => $this->l('megabytes'), 'default' => '2' ), 'PS_LIMIT_UPLOAD_FILE_VALUE' => array( 'title' => $this->l('File value upload limit'), - 'desc' => $this->l('Define the limit upload for a downloadable product, this value have to be inferior or equal to your server\'s maximum upload file ').sprintf('(%s MB).', $upload_mb), + 'desc' => $this->l('Define the limit upload for a downloadable product. This value has to be less than or equal to the maximum file upload allotted by your server. ').sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', - 'suffix' => $this->l('Megabytes'), + 'suffix' => $this->l('megabytes'), 'default' => '1' ), 'PS_LIMIT_UPLOAD_IMAGE_VALUE' => array( 'title' => $this->l('Image value upload limit'), - 'desc' => $this->l('Define the limit upload for an image, this value have to be inferior or equal to your server\'s maximum upload file ').sprintf('(%s MB).', $upload_mb), + 'desc' => $this->l('Define the limit upload for an image. This value has to be less than or equal to the maximum file upload allotted by your server. ').sprintf('(%s MB).', $upload_mb), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', - 'suffix' => $this->l('Megabytes'), + 'suffix' => $this->l('megabytes'), 'default' => '1' ), ), @@ -123,7 +123,7 @@ class AdminAdminPreferencesControllerCore extends AdminController 'fields' => array( 'PS_HELPBOX' => array( 'title' => $this->l('Back Office help boxes'), - 'desc' => $this->l('Enable yellow help boxes which are displayed under form fields in the Back Office'), + 'desc' => $this->l('Allow yellow help boxes to be displayed under the form fields in the Back Office.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', @@ -144,21 +144,21 @@ class AdminAdminPreferencesControllerCore extends AdminController 'fields' => array( 'PS_SHOW_NEW_ORDERS' => array( 'title' => $this->l('Show notifications for new orders'), - 'desc' => $this->l('This will display notifications when new orders are made on your shop'), + 'desc' => $this->l('This will display notifications when new orders are made in your shop.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' ), 'PS_SHOW_NEW_CUSTOMERS' => array( 'title' => $this->l('Show notifications for new customers'), - 'desc' => $this->l('This will display notifications when new customers register on your shop'), + 'desc' => $this->l('This will display notifications every time a new customer registers in your shop.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' ), 'PS_SHOW_NEW_MESSAGES' => array( 'title' => $this->l('Show notifications for new messages'), - 'desc' => $this->l('This will display notifications when new messages are posted on your shop'), + 'desc' => $this->l('This will display notifications when new messages are posted in your shop.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' diff --git a/controllers/admin/AdminAttachmentsController.php b/controllers/admin/AdminAttachmentsController.php index d9b651288..30ab36cd5 100644 --- a/controllers/admin/AdminAttachmentsController.php +++ b/controllers/admin/AdminAttachmentsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -83,11 +83,11 @@ class AdminAttachmentsControllerCore extends AdminController 'type' => 'file', 'label' => $this->l('File:'), 'name' => 'file', - 'desc' => $this->l('Upload file from your computer') + 'desc' => $this->l('Upload a file from your computer.') ), ), 'submit' => array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ) ); @@ -145,7 +145,7 @@ class AdminAttachmentsControllerCore extends AdminController { if ($_FILES['file']['size'] > (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024 * 1024)) $this->errors[] = sprintf( - $this->l('File too large, maximum size allowed: %1$d kB. File size you\'re trying to upload is: %2$d kB.'), + $this->l('The file is too large. Maximum size allowed is: %1$d kB. The file you\'re trying to upload is: %2$d kB.'), (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024), number_format(($_FILES['file']['size'] / 1024), 2, '.', '') ); @@ -154,7 +154,7 @@ class AdminAttachmentsControllerCore extends AdminController do $uniqid = sha1(microtime()); while (file_exists(_PS_DOWNLOAD_DIR_.$uniqid)); if (!copy($_FILES['file']['tmp_name'], _PS_DOWNLOAD_DIR_.$uniqid)) - $this->errors[] = $this->l('File copy failed'); + $this->errors[] = $this->l('Failed to copy the file.'); $_POST['file_name'] = $_FILES['file']['name']; @unlink($_FILES['file']['tmp_name']); $_POST['file'] = $uniqid; @@ -167,13 +167,13 @@ class AdminAttachmentsControllerCore extends AdminController $max_post = (int)ini_get('post_max_size'); $upload_mb = min($max_upload, $max_post); $this->errors[] = sprintf( - $this->l('The File %1$s exceeds the size allowed by the server. The limit is set to %2$d MB.'), + $this->l('The file %1$s exceeds the size allowed by the server. The limit is set to %2$d MB.'), ''.$_FILES['file']['name'].' ', ''.$upload_mb.'' ); } else if (!empty($_FILES['file']['tmp_name'])) - $this->errors[] = $this->l('No file or your file is not uploadable, please check your server configuration for the maximum upload size.'); + $this->errors[] = $this->l('Upload error. Please check your server configurations for the maximum upload size allowed.'); } $this->validateRules(); } diff --git a/controllers/admin/AdminAttributeGeneratorController.php b/controllers/admin/AdminAttributeGeneratorController.php index 11bc4326d..1d6cd1368 100644 --- a/controllers/admin/AdminAttributeGeneratorController.php +++ b/controllers/admin/AdminAttributeGeneratorController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -85,7 +85,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') $this->action = 'generate'; else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } parent::initProcess(); } @@ -100,7 +100,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController public function processGenerate() { if (!is_array(Tools::getValue('options'))) - $this->errors[] = Tools::displayError('Please choose at least 1 attribute.'); + $this->errors[] = Tools::displayError('Please select at least one attribute.'); else { $tab = array_values(Tools::getValue('options')); @@ -134,7 +134,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)Tools::getValue('id_product').'&addproduct&key_tab=Combinations&conf=4'); } else - $this->errors[] = Tools::displayError('Unable to initialize parameters, combination is missing or object cannot be loaded.'); + $this->errors[] = Tools::displayError('Unable to initialize these parameters. A combination is missing or an object cannot be loaded.'); } } @@ -222,7 +222,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController { $this->toolbar_btn['back'] = array( 'href' => $this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)Tools::getValue('id_product').'&addproduct&key_tab=Combinations', - 'desc' => $this->l('Back to product') + 'desc' => $this->l('Back to the product') ); } @@ -230,7 +230,7 @@ class AdminAttributeGeneratorControllerCore extends AdminController { if (!Combination::isFeatureActive()) { - $this->displayWarning($this->l('This feature has been disabled, you can activate it at:').' + $this->displayWarning($this->l('This feature has been disabled. You can activate it at:').' '. $this->l('Performance').''); return; diff --git a/controllers/admin/AdminAttributesGroupsController.php b/controllers/admin/AdminAttributesGroupsController.php index 0f3aed7ac..937d632e0 100644 --- a/controllers/admin/AdminAttributesGroupsController.php +++ b/controllers/admin/AdminAttributesGroupsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -98,7 +98,7 @@ class AdminAttributesGroupsControllerCore extends AdminController $this->lang = true; if (!Validate::isLoadedObject($obj = new AttributeGroup((int)$id))) - $this->errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); $this->fields_list = array( 'id_attribute' => array( @@ -123,7 +123,7 @@ class AdminAttributesGroupsControllerCore extends AdminController $this->fields_list['position'] = array( 'title' => $this->l('Position'), 'width' => 40, - 'filter_key' => 'cp!position', + 'filter_key' => 'a!position', 'position' => 'position' ); @@ -237,7 +237,7 @@ class AdminAttributesGroupsControllerCore extends AdminController } $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); @@ -330,7 +330,7 @@ class AdminAttributesGroupsControllerCore extends AdminController ); $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); @@ -430,7 +430,7 @@ class AdminAttributesGroupsControllerCore extends AdminController { if (!Combination::isFeatureActive()) { - $this->displayWarning($this->l('This feature has been disabled, you can activate it at:'). + $this->displayWarning($this->l('This feature has been disabled. You can activate it at:'). ' '.$this->l('Performances').''); return; @@ -497,11 +497,11 @@ class AdminAttributesGroupsControllerCore extends AdminController default: // list $this->toolbar_btn['new'] = array( 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token, - 'desc' => $this->l('Add new Attributes') + 'desc' => $this->l('Add New Attributes') ); $this->toolbar_btn['newAttributes'] = array( 'href' => self::$currentIndex.'&updateattribute&token='.$this->token, - 'desc' => $this->l('Add new Values'), + 'desc' => $this->l('Add New Values'), 'class' => 'toolbar-new' ); } @@ -514,18 +514,18 @@ class AdminAttributesGroupsControllerCore extends AdminController switch ($this->display) { case 'edit': - $bread_extended[] = $this->l('Edit new Attribute'); + $bread_extended[] = $this->l('Edit New Attributes'); break; case 'add': - $bread_extended[] = $this->l('Add new Attribute'); + $bread_extended[] = $this->l('Add New Attributes'); break; case 'editAttributes': if ($this->id_attribute) $bread_extended[] = $this->l('Edit Value'); else - $bread_extended[] = $this->l('Add new Value'); + $bread_extended[] = $this->l('Add New Values'); break; } @@ -591,9 +591,9 @@ class AdminAttributesGroupsControllerCore extends AdminController if (Tools::getValue('updateattribute') || Tools::isSubmit('deleteattribute') || Tools::isSubmit('submitAddattribute')) { if ($this->tabAccess['edit'] !== '1') - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); else if (!$object = new Attribute((int)Tools::getValue($this->identifier))) - $this->errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); if (Tools::getValue('position') !== false && Tools::getValue('id_attribute')) { @@ -606,7 +606,7 @@ class AdminAttributesGroupsControllerCore extends AdminController else if (Tools::isSubmit('deleteattribute') && Tools::getValue('id_attribute')) { if (!$object->delete()) - $this->errors[] = Tools::displayError('Failed to delete attribute.'); + $this->errors[] = Tools::displayError('Failed to delete the attribute.'); else Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getAdminTokenLite('AdminAttributesGroups')); } @@ -640,13 +640,13 @@ class AdminAttributesGroupsControllerCore extends AdminController $object = new $this->className(); if ($object->deleteSelection($_POST[$this->table.'Box'])) Tools::redirectAdmin(self::$currentIndex.'&conf=2'.'&token='.$this->token); - $this->errors[] = Tools::displayError('An error occurred while deleting selection.'); + $this->errors[] = Tools::displayError('An error occurred while deleting this selection.'); } else $this->errors[] = Tools::displayError('You must select at least one element to delete.'); } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); // clean position after delete AttributeGroup::cleanPositions(); } @@ -686,7 +686,11 @@ class AdminAttributesGroupsControllerCore extends AdminController { foreach ($this->_list as &$list) if (file_exists(_PS_IMG_DIR_.$this->fieldImageSettings['dir'].'/'.(int)$list['id_attribute'].'.jpg')) + { + if (!isset($list['color']) || !is_array($list['color'])) + $list['color'] = array(); $list['color']['texture'] = '../img/'.$this->fieldImageSettings['dir'].'/'.(int)$list['id_attribute'].'.jpg'; + } } else { diff --git a/controllers/admin/AdminBackupController.php b/controllers/admin/AdminBackupController.php index a037769e1..734b05009 100644 --- a/controllers/admin/AdminBackupController.php +++ b/controllers/admin/AdminBackupController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -58,8 +58,8 @@ class AdminBackupControllerCore extends AdminController 'type' => 'bool' ), 'PS_BACKUP_DROP_TABLE' => array( - 'title' => $this->l('Drop existing tables during import:'), - 'desc' => $this->l('If enabled, the backup script will drop your tables prior to restoring the backed up data'). + 'title' => $this->l('Drop existing tables during import'), + 'desc' => $this->l('If enabled, the backup script will drop your tables prior to restoring data.'). '
        (ie. "DROP TABLE IF EXISTS")', 'cast' => 'intval', 'type' => 'bool' @@ -154,7 +154,7 @@ class AdminBackupControllerCore extends AdminController // Test if the backup dir is writable if (!is_writable(_PS_ADMIN_DIR_.'/backups/')) - $this->warnings[] = $this->l('"Backups" Directory in admin directory must be writeable (CHMOD 755 / 777)'); + $this->warnings[] = $this->l('The "Backups" directory located in the admin directory must be writeable (CHMOD 755 / 777)'); if ($this->display == 'add' && is_writable(_PS_ADMIN_DIR_.'/backups/')) { @@ -164,7 +164,7 @@ class AdminBackupControllerCore extends AdminController $this->errors[] = $object->error; else $this->context->smarty->assign(array( - 'conf' => $this->l('It appears that the Backup was successful, however, you must download and carefully verify the Backup file.'), + 'conf' => $this->l('It appears the backup was successful, however you must download and carefully verify the backup file before proceeding. '), 'backup_url' => $object->getBackupURL(), 'backup_weight' => number_format((filesize($object->id) * 0.000001), 2, '.', '') )); @@ -234,16 +234,16 @@ class AdminBackupControllerCore extends AdminController $date = date('Y-m-d H:i:s', $timestamp); $age = time() - $timestamp; if ($age < 3600) - $age = '< 1 '.$this->l('hour'); + $age = '< 1 '.$this->l('Hour'); else if ($age < 86400) { $age = floor($age / 3600); - $age = $age.' '.(($age == 1) ? $this->l('hour') : $this->l('hours')); + $age = $age.' '.(($age == 1) ? $this->l('Hour') : $this->l('Hours')); } else { $age = floor($age / 86400); - $age = $age.' '.(($age == 1) ? $this->l('day') : $this->l('days')); + $age = $age.' '.(($age == 1) ? $this->l('Day') : $this->l('Days')); } $size = filesize(_PS_ADMIN_DIR_.'/backups/'.$file); $this->_list[] = array( diff --git a/controllers/admin/AdminCarrierWizardController.php b/controllers/admin/AdminCarrierWizardController.php new file mode 100644 index 000000000..3cd3ef63d --- /dev/null +++ b/controllers/admin/AdminCarrierWizardController.php @@ -0,0 +1,812 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminCarrierWizardControllerCore extends AdminController +{ + protected $wizard_access; + + public function __construct() + { + $this->display = 'view'; + $this->table = 'carrier'; + $this->identifier = 'id_carrier'; + $this->className = 'Carrier'; + $this->lang = false; + $this->deleted = true; + $this->step_number = 0; + + $this->fieldImageSettings = array( + 'name' => 'logo', + 'dir' => 's' + ); + + parent::__construct(); + + $this->wizard_access = Profile::getProfileAccess($this->context->employee->id_profile, Tab::getIdFromClassName('AdminCarrierWizard')); + } + + public function setMedia() + { + parent::setMedia(); + $this->addJqueryPlugin('smartWizard'); + $this->addJs(_PS_JS_DIR_.'admin_carrier_wizard.js'); + } + + public function initWizard() + { + $this->wizard_steps = array( + 'name' => 'carrier_wizard', + 'steps' => array( + array( + 'title' => $this->l('General'), + 'desc' => $this->l('General'), + ), + array( + 'title' => $this->l('Where and how much ?'), + 'desc' => $this->l('Where and how much ?'), + ), + array( + 'title' => $this->l('What and to who ?'), + 'desc' => $this->l('What and to who ?'), + ), + array( + 'title' => $this->l('Resume'), + 'desc' => $this->l('Resume'), + ), + + )); + + if (Shop::isFeatureActive()) + { + $multistore_step = array( + array( + 'title' => $this->l('MultiStore'), + 'desc' => $this->l('MultiStore'), + ) + ); + array_splice($this->wizard_steps['steps'], 1, 0, $multistore_step); + } + } + + public function renderView() + { + $this->initWizard(); + + if (Tools::getValue('id_carrier') && $this->wizard_access['edit']) + $carrier = $this->loadObject(); + elseif ($this->wizard_access['add']) + $carrier = new Carrier(); + else + { + $this->errors[] = Tools::displayError('You do not have permission to use this wizard.'); + return ; + } + + $this->tpl_view_vars = array( + 'enableAllSteps' => Validate::isLoadedObject($carrier), + 'wizard_steps' => $this->wizard_steps, + 'validate_url' => $this->context->link->getAdminLink('AdminCarrierWizard'), + 'carrierlist_url' => $this->context->link->getAdminLink('AdminCarriers').'&conf='.((int)Validate::isLoadedObject($carrier) ? 4 : 3), + 'wizard_contents' => array( + 'contents' => array( + 0 => $this->renderStepOne($carrier), + 1 => $this->renderStepThree($carrier), + 2 => $this->renderStepFour($carrier), + 3 => $this->renderStepFive(), + )), + 'labels' => array('next' => $this->l('Next'), 'previous' => $this->l('Previous'), 'finish' => $this->l('Finish')) + ); + + if (Shop::isFeatureActive()) + array_splice($this->tpl_view_vars['wizard_contents']['contents'], 1, 0, array(0 => $this->renderStepTwo($carrier))); + + $this->context->smarty->assign(array( + 'max_image_size' => (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE') / 1024 / 1024, + 'carrier_logo' => (Validate::isLoadedObject($carrier) && file_exists(_PS_SHIP_IMG_DIR_.$carrier->id.'.jpg') ? _THEME_SHIP_DIR_.$carrier->id.'.jpg' : false) + )); + $this->content .= $this->createTemplate('logo.tpl')->fetch(); + $this->addjQueryPlugin(array('ajaxfileupload')); + + return parent::renderView(); + } + + public function initToolbarTitle() + { + $bread_extended = array_unique($this->breadcrumbs); + + if (Tools::getValue('id_carrier')) + $bread_extended[1] = $this->l('Edit'); + else + $bread_extended[1] = $this->l('Add new'); + + $this->toolbar_title = $bread_extended; + } + + public function initToolbar() + { + parent::initToolbar(); + $this->toolbar_btn['back']['href'] = $this->context->link->getAdminLink('AdminCarriers'); + } + + public function renderStepOne($carrier) + { + $this->fields_form = array( + 'form' => array( + 'id_form' => 'step_carrier_general', + 'input' => array( + array( + 'type' => 'text', + 'label' => $this->l('Company:'), + 'name' => 'name', + 'size' => 25, + 'required' => true, + 'hint' => sprintf($this->l('Allowed characters: letters, spaces and %s'), '().-'), + 'desc' => array( + $this->l('Carrier name displayed during checkout'), + $this->l('For in-store pickup, enter 0 to replace the carrier name with your shop name.') + ) + ), + array( + 'type' => 'text', + 'label' => $this->l('Transit time:'), + 'name' => 'delay', + 'lang' => true, + 'required' => true, + 'size' => 41, + 'maxlength' => 128, + 'desc' => $this->l('Estimated delivery time will be displayed during checkout.') + ), + array( + 'type' => 'text', + 'label' => $this->l('Speed Grade:'), + 'name' => 'grade', + 'required' => false, + 'size' => 1, + 'desc' => $this->l('Enter "0" for a longest shipping delay, or "9" for the shortest shipping delay.') + ), + array( + 'type' => 'text', + 'label' => $this->l('URL:'), + 'name' => 'url', + 'size' => 40, + 'desc' => $this->l('Delivery tracking URL: Type \'@\' where the tracking number should appear. It will then be automatically replaced by the tracking number.') + ), + )), + ); + + $fields_value = $this->getStepOneFieldsValues($carrier); + return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value); + } + + public function renderStepTwo($carrier) + { + $this->fields_form = array( + 'form' => array( + 'id_form' => 'step_carrier_shops', + 'input' => array( + array( + 'type' => 'shop', + 'label' => $this->l('Shop association:'), + 'name' => 'checkBoxShopAsso', + ), + )) + ); + $fields_value = $this->getStepTwoFieldsValues($carrier); + return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value); + } + + public function renderStepThree($carrier) + { + $this->fields_form = array( + 'form' => array( + 'id_form' => 'step_carrier_ranges', + 'input' => array( + array( + 'type' => 'radio', + 'label' => $this->l('Apply shipping cost:'), + 'name' => 'is_free', + 'required' => false, + 'class' => 't', + 'values' => array( + array( + 'id' => 'is_free_off', + 'value' => 0, + 'label' => ''.$this->l('Yes').'' + ), + array( + 'id' => 'is_free_on', + 'value' => 1, + 'label' => ''.$this->l('No').'' + ) + ), + 'desc' => $this->l('Apply both regular shipping cost and product-specific shipping costs.') + ), + array( + 'type' => 'radio', + 'label' => $this->l('Shipping and handling:'), + 'name' => 'shipping_handling', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'values' => array( + array( + 'id' => 'shipping_handling_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'shipping_handling_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ) + ), + 'desc' => $this->l('Include the shipping and handling costs in the carrier price.') + ), + array( + 'type' => 'radio', + 'label' => $this->l('Billing:'), + 'name' => 'shipping_method', + 'required' => false, + 'class' => 't', + 'br' => true, + 'values' => array( + array( + 'id' => 'billing_price', + 'value' => Carrier::SHIPPING_METHOD_PRICE, + 'label' => $this->l('According to total price') + ), + array( + 'id' => 'billing_weight', + 'value' => Carrier::SHIPPING_METHOD_WEIGHT, + 'label' => $this->l('According to total weight') + ) + ) + ), + array( + 'type' => 'select', + 'label' => $this->l('Tax:'), + 'name' => 'id_tax_rules_group', + 'options' => array( + 'query' => TaxRulesGroup::getTaxRulesGroups(true), + 'id' => 'id_tax_rules_group', + 'name' => 'name', + 'default' => array( + 'label' => $this->l('No Tax'), + 'value' => 0 + ) + ) + ), + array( + 'type' => 'zone', + 'name' => 'zones' + ) + ) + )); + + $tpl_vars = array(); + $fields_value = $this->getStepThreeFieldsValues($carrier); + + $this->getTplRangesVarsAndValues($carrier, &$tpl_vars, &$fields_value); + return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value, $tpl_vars); + } + + protected function getTplRangesVarsAndValues($carrier, $tpl_vars, $fields_value) + { + $tpl_vars['zones'] = Zone::getZones(false); + $carrier_zones = $carrier->getZones(); + $carrier_zones_ids = array(); + if (is_array($carrier_zones)) + foreach ($carrier_zones as $carrier_zone) + $carrier_zones_ids[] = $carrier_zone['id_zone']; + + + $shipping_method = $carrier->getShippingMethod(); + if ($shipping_method == Carrier::SHIPPING_METHOD_FREE) + { + $range_table = array(); + $range_obj = $carrier->getRangeObject($carrier->shipping_method); + $price_by_range = array(); + } + else + { + $range_table = $carrier->getRangeTable(); + $range_obj = $carrier->getRangeObject(); + $price_by_range = Carrier::getDeliveryPriceByRanges($range_table, (int)$carrier->id); + } + + $zones = Zone::getZones(false); + foreach ($zones as $zone) + $fields_value['zones'][$zone['id_zone']] = Tools::getValue('zone_'.$zone['id_zone'], (in_array($zone['id_zone'], $carrier_zones_ids))); + + foreach ($price_by_range as $price) + $tpl_vars['price_by_range'][$price['id_'.$range_table]][$price['id_zone']] = $price['price']; + + $tmp_range = $range_obj->getRanges((int)$carrier->id); + $tpl_vars['ranges'] = array(); + foreach ($tmp_range as $id => $range) + { + $tpl_vars['ranges'][$range['id_'.$range_table]] = $range; + $tpl_vars['ranges'][$range['id_'.$range_table]]['id_range'] = $range['id_'.$range_table]; + } + + // init blank range + if (!count($tpl_vars['ranges'])) + $tpl_vars['ranges'][] = array('id_range' => -1, 'delimiter1' => 0, 'delimiter2' => 100000); + } + + public function renderStepFour($carrier) + { + $this->fields_form = array( + 'form' => array( + 'id_form' => 'step_carrier_conf', + 'input' => array( + array( + 'type' => 'select', + 'label' => $this->l('Out-of-range behavior:'), + 'name' => 'range_behavior', + 'options' => array( + 'query' => array( + array( + 'id' => 0, + 'name' => $this->l('Apply the cost of the highest defined range') + ), + array( + 'id' => 1, + 'name' => $this->l('Disable carrier') + ) + ), + 'id' => 'id', + 'name' => 'name' + ), + 'desc' => $this->l('Out-of-range behavior occurs when none is defined (e.g. when a customer\'s cart weight is greater than the highest range limit)') + ), + array( + 'type' => 'text', + 'label' => $this->l('Maximium package height:'), + 'name' => 'max_height', + 'required' => false, + 'size' => 10, + 'desc' => $this->l('Maximum height managed by this carrier. Set the value to "0," or leave this field blank to ignore.') + ), + array( + 'type' => 'text', + 'label' => $this->l('Maximium package width:'), + 'name' => 'max_width', + 'required' => false, + 'size' => 10, + 'desc' => $this->l('Maximum width managed by this carrier. Set the value to "0," or leave this field blank to ignore.') + ), + array( + 'type' => 'text', + 'label' => $this->l('Maximium package depth:'), + 'name' => 'max_depth', + 'required' => false, + 'size' => 10, + 'desc' => $this->l('Maximum depth managed by this carrier. Set the value to "0," or leave this field blank to ignore.') + ), + array( + 'type' => 'text', + 'label' => $this->l('Maximium package weight:'), + 'name' => 'max_weight', + 'required' => false, + 'size' => 10, + 'desc' => $this->l('Maximum weight managed by this carrier. Set the value to "0," or leave this field blank to ignore.') + ), + array( + 'type' => 'group', + 'label' => $this->l('Group access:'), + 'name' => 'groupBox', + 'values' => Group::getGroups(Context::getContext()->language->id), + 'desc' => $this->l('Mark the groups that are allowed access to this carrier.') + ) + ) + )); + $fields_value = $this->getStepFourFieldsValues($carrier); + + // Added values of object Group + $carrier_groups = $carrier->getGroups(); + $carrier_groups_ids = array(); + if (is_array($carrier_groups)) + foreach ($carrier_groups as $carrier_group) + $carrier_groups_ids[] = $carrier_group['id_group']; + + $groups = Group::getGroups($this->context->language->id); + + foreach ($groups as $group) + $fields_value['groupBox_'.$group['id_group']] = Tools::getValue('groupBox_'.$group['id_group'], (in_array($group['id_group'], $carrier_groups_ids) || empty($carrier_groups_ids) && !$carrier->id)); + + return $this->renderGenericForm(array('form' => $this->fields_form), $fields_value); + } + + public function renderStepFive() + { + return $this->context->smarty->fetch('controllers/carrier_wizard/summary.tpl'); + } + + public function renderGenericForm($fields_form, $fields_value, $tpl_vars = array()) + { + $helper = new HelperForm(); + $helper->show_toolbar = false; + $helper->table = $this->table; + $helper->default_form_language = $this->context->language->id; + $helper->allow_employee_form_lang = Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') ? Configuration::get('PS_BO_ALLOW_EMPLOYEE_FORM_LANG') : 0; + $this->fields_form = array(); + $helper->id = (int)Tools::getValue('id_carrier'); + $helper->identifier = $this->identifier; + $helper->tpl_vars = array_merge(array( + 'fields_value' => $fields_value, + 'languages' => $this->getLanguages(), + 'id_language' => $this->context->language->id + ), $tpl_vars); + $helper->override_folder = 'carrier_wizard/'; + + return $helper->generateForm($fields_form); + } + + public function getStepOneFieldsValues($carrier) + { + return array( + 'id_carrier' => $this->getFieldValue($carrier, 'id_carrier'), + 'name' => $this->getFieldValue($carrier, 'name'), + 'delay' => $this->getFieldValue($carrier, 'delay'), + 'grade' => $this->getFieldValue($carrier, 'grade'), + 'url' => $this->getFieldValue($carrier, 'url'), + ); + } + + public function getStepTwoFieldsValues($carrier) + { + return array('shop' => $this->getFieldValue($carrier, 'shop')); + + } + + public function getStepThreeFieldsValues($carrier) + { + $id_tax_rules_group = (is_object($this->object) && !$this->object->id) ? Carrier::getIdTaxRulesGroupMostUsed() : $this->getFieldValue($carrier, 'id_tax_rules_group'); + + return array( + 'is_free' => $this->getFieldValue($carrier, 'is_free'), + 'id_tax_rules_group' => (int)$id_tax_rules_group, + 'shipping_handling' => $this->getFieldValue($carrier, 'shipping_handling'), + 'shipping_method' => $this->getFieldValue($carrier, 'shipping_method'), + 'range_behavior' => $this->getFieldValue($carrier, 'range_behavior'), + 'zones' => $this->getFieldValue($carrier, 'zones'), + ); + } + + public function getStepFourFieldsValues($carrier) + { + return array( + 'range_behavior' => $this->getFieldValue($carrier, 'shop'), + 'max_height' => $this->getFieldValue($carrier, 'max_height'), + 'max_width' => $this->getFieldValue($carrier, 'max_width'), + 'max_depth' => $this->getFieldValue($carrier, 'max_depth'), + 'max_weight' => $this->getFieldValue($carrier, 'max_weight'), + 'group' => $this->getFieldValue($carrier, 'group'), + ); + } + + + public function ajaxProcessChangeRanges() + { + if ((Validate::isLoadedObject($this->object) && !$this->wizard_access['edit']) || !$this->wizard_access['add']) + { + $this->errors[] = Tools::displayError('You do not have permission to use this wizard.'); + return; + } + if ((!(int)$shipping_method = Tools::getValue('shipping_method')) || !in_array($shipping_method, array(Carrier::SHIPPING_METHOD_PRICE, Carrier::SHIPPING_METHOD_WEIGHT))) + return ; + + $carrier = $this->loadObject(true); + $carrier->shipping_method = $shipping_method; + + $tpl_vars = array(); + $fields_value = $this->getStepThreeFieldsValues($carrier); + $this->getTplRangesVarsAndValues($carrier, &$tpl_vars, &$fields_value); + + $template = $this->createTemplate('controllers/carrier_wizard/helpers/form/form_ranges.tpl'); + $template->assign($tpl_vars); + $template->assign('fields_value', $fields_value); + $template->assign('input', array('type' => 'zone', 'name' => 'zones' )); + + die ($template->fetch()); + } + + public function ajaxProcessValidateStep() + { + $step_number = (int)Tools::getValue('step_number'); + $return = array('has_error' => false); + + if (!$this->wizard_access['edit']) + $this->errors[] = Tools::displayError('You do not have permission to use this wizard.'); + else + { + + if (Shop::isFeatureActive() && $step_number == 2) + { + if (!Tools::getValue('checkBoxShopAsso_carrier')) + { + $return['has_error'] = true; + $return['errors'][] = $this->l('You must choose at least one shop or group shop.'); + } + } + else + $this->validateRules('AdminCarrierWizardControllerCore'); + } + + if (count($this->errors)) + { + $return['has_error'] = true; + $return['errors'] = $this->errors; + } + die(Tools::jsonEncode($return)); + } + + public function processRanges($id_carrier) + { + if (!$this->wizard_access['edit'] || !$this->wizard_access['add']) + { + $this->errors[] = Tools::displayError('You do not have permission to use this wizard.'); + return; + } + + $carrier = new Carrier((int)$id_carrier); + if (!Validate::isLoadedObject($carrier)) + return false; + + $range_inf = Tools::getValue('range_inf'); + $range_sup = Tools::getValue('range_sup'); + $range_type = Tools::getValue('shipping_method'); + + $fees = Tools::getValue('fees'); + + $carrier->deleteDeliveryPrice($carrier->getRangeTable()); + if ($range_type != Carrier::SHIPPING_METHOD_FREE) + { + foreach ($range_inf as $key => $delimiter1) + { + if (!isset($range_sup[$key])) + continue; + + if ($range_type == Carrier::SHIPPING_METHOD_WEIGHT) + $range = new RangeWeight((int)$key); + if ($range_type == Carrier::SHIPPING_METHOD_PRICE) + $range = new RangePrice((int)$key); + + $range->id_carrier = (int)$carrier->id; + $range->delimiter1 = (float)$delimiter1; + $range->delimiter2 = (float)$range_sup[$key]; + $range->save(); + + if (!Validate::isLoadedObject($range)) + return false; + + $price_list = array(); + foreach ($fees as $id_zone => $fee) + $price_list[] = array( + 'id_range_price' => ($range_type == Carrier::SHIPPING_METHOD_PRICE ? (int)$range->id : null), + 'id_range_weight' => ($range_type == Carrier::SHIPPING_METHOD_WEIGHT ? (int)$range->id : null), + 'id_carrier' => (int)$carrier->id, + 'id_zone' => (int)$id_zone, + 'price' => (float)$fee[$key] + ); + + if (!$carrier->addDeliveryPrice($price_list, true)) + return false; + } + } + + return true; + } + + public function ajaxProcessUploadLogo() + { + if (!$this->wizard_access['edit']) + die(''); + + $allowedExtensions = array('jpeg', 'gif', 'png', 'jpg'); + + $logo = (isset($_FILES['carrier_logo_input']) ? $_FILES['carrier_logo_input'] : false); + if ($logo && !empty($logo['tmp_name']) && $logo['tmp_name'] != 'none' + && (!isset($logo['error']) || !$logo['error']) + && preg_match('/\.(jpe?g|gif|png)$/', $logo['name']) + && is_uploaded_file($logo['tmp_name'])) + { + $file = $logo['tmp_name']; + do $tmp_name = uniqid().'.jpg'; + while (file_exists(_PS_TMP_IMG_DIR_.$tmp_name)); + if (!ImageManager::resize($file, _PS_TMP_IMG_DIR_.$tmp_name)) + die(''); + @unlink($file); + die(''); + } + else + die(''); + } + + public function ajaxProcessFinishStep() + { + $return = array('has_error' => false); + + if (!$this->wizard_access['edit']) + $return = array( + 'has_error' => true, + $return['errors'][] = Tools::displayError('You do not have permission to use this wizard.') + ); + else + { + + if ($id_carrier = Tools::getValue('id_carrier')) + { + $current_carrier = new Carrier((int)$id_carrier); + // if update we duplicate current Carrier + $carrier = $current_carrier->duplicateObject(); + if (Validate::isLoadedObject($carrier)) + { + // Set flag deteled to true for historization + $current_carrier->deleted = true; + $current_carrier->update(); + + // Fill the new carrier object + $this->copyFromPost($carrier, $this->table); + $carrier->position = $current_carrier->position; + $carrier->update(); + } + } + else + { + $carrier = new Carrier(); + $this->copyFromPost($carrier, $this->table); + if (!$carrier->add()) + { + $return['has_error'] = true; + $return['errors'][] = $this->l('An error occurred while saving this carrier.'); + } + } + if (Validate::isLoadedObject($carrier)) + { + if (!$this->changeGroups((int)$carrier->id)) + { + $return['has_error'] = true; + $return['errors'][] = $this->l('An error occurred while saving carrier groups.'); + } + + if (!$this->changeZones((int)$carrier->id)) + { + $return['has_error'] = true; + $return['errors'][] = $this->l('An error occurred while saving carrier zones.'); + } + + if (!$this->processRanges((int)$carrier->id)) + { + $return['has_error'] = true; + $return['errors'][] = $this->l('An error occurred while saving carrier ranges.'); + } + + if (Shop::isFeatureActive() && !$this->updateAssoShop((int)$carrier->id)) + { + $return['has_error'] = true; + $return['errors'][] = $this->l('An error occurred while saving associations of shops.'); + } + + if (!$carrier->setTaxRulesGroup((int)Tools::getValue('id_tax_rules_group'))) + { + $return['has_error'] = true; + $return['errors'][] = $this->l('An error occurred while saving the tax rules group.'); + } + + if (Tools::getValue('logo')) + { + if (Tools::getValue('logo') == 'null' && file_exists(_PS_SHIP_IMG_DIR_.$carrier->id.'.jpg')) + unlink(_PS_SHIP_IMG_DIR_.$carrier->id.'.jpg'); + else + { + $logo = basename(Tools::getValue('logo')); + if (!file_exists(_PS_TMP_IMG_DIR_.$logo) || !copy(_PS_TMP_IMG_DIR_.$logo, _PS_SHIP_IMG_DIR_.$carrier->id.'.jpg')) + { + $return['has_error'] = true; + $return['errors'][] = $this->l('An error occurred while saving carrier logo.'); + } + } + } + $return['id_carrier'] = $carrier->id; + } + } + die(Tools::jsonEncode($return)); + } + + protected function changeGroups($id_carrier, $delete = true) + { + $carrier = new Carrier((int)$id_carrier); + if (!Validate::isLoadedObject($carrier)) + return false; + + return $carrier->setGroups(Tools::getValue('groupBox')); + } + + public function changeZones($id) + { + $return = true; + $carrier = new Carrier($id); + if (!Validate::isLoadedObject($carrier)) + die (Tools::displayError('The object cannot be loaded.')); + $zones = Zone::getZones(false); + foreach ($zones as $zone) + if (count($carrier->getZone($zone['id_zone']))) + { + if (!isset($_POST['zone_'.$zone['id_zone']]) || !$_POST['zone_'.$zone['id_zone']]) + $return &= $carrier->deleteZone((int)$zone['id_zone']); + } + else + if (isset($_POST['zone_'.$zone['id_zone']]) && $_POST['zone_'.$zone['id_zone']]) + $return &= $carrier->addZone((int)$zone['id_zone']); + + return $return; + } + + public static function getValidationRules() + { + $step_number = Tools::getValue('step_number'); + $step_fields = array( + 1 => array('name', 'delay', 'grade', 'url'), + 2 => array('is_free', 'id_tax_rules_group', 'shipping_handling', 'shipping_method', 'range_behavior'), + 3 => array('range_behavior', 'max_height', 'max_width', 'max_depth', 'max_weight'), + ); + + if (Shop::isFeatureActive()) + { + $multistore_field = array(array('shop')); + $tmp = $step_fields; + $step_fields = array(1 => $tmp[1]) + $multistore_field; + array_shift($tmp); + foreach ($tmp as $row) + $step_field[] = $row; + } + + $rules = array(); + + if ($step_number == 1) + $rules = Carrier::getValidationRules('Carrier'); + + foreach ($rules as $key_r => $rule) + foreach ($rule as $key_f => $field) + { + if (in_array($key_r, array('required', 'requiredLang'))) + { + if(!in_array($field, $step_fields[$step_number])) + unset($rules[$key_r][$key_f]); + } + else if(!in_array($key_f, $step_fields[$step_number])) + unset($rules[$key_r][$key_f]); + } + return $rules; + } + + public static function displayFieldName($field) + { + return $field; + } +} diff --git a/controllers/admin/AdminCarriersController.php b/controllers/admin/AdminCarriersController.php index 989457d84..cd98c934d 100644 --- a/controllers/admin/AdminCarriersController.php +++ b/controllers/admin/AdminCarriersController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -43,7 +43,7 @@ class AdminCarriersControllerCore extends AdminController $this->context = Context::getContext(); $this->bulk_actions = array( - 'delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')), + 'delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Are you sure that you want to delete the selected items?')), 'enableSelection' => array('text' => $this->l('Enable selection')), 'disableSelection' => array('text' => $this->l('Disable selection')) ); @@ -156,33 +156,16 @@ class AdminCarriersControllerCore extends AdminController parent::__construct(); } + public function initToolbar() + { + parent::initToolbar(); + + if (isset($this->toolbar_btn['new'])) + $this->toolbar_btn['new']['href'] = $this->context->link->getAdminLink('AdminCarrierWizard'); + } + public function renderList() { - $this->displayInformation( - ' '.$this->l('How do I create a new carrier?').' -
        -
          -
        • '.$this->l('Click "Add new."').'
        • -
        • '.$this->l('Fill in the fields and click "Save."').'
        • -
        • '. - $this->l('You need to set a price range or a weight range for which the new carrier will be available.').' '. - $this->l('Under the "Shipping" menu, click either "Price Ranges" or "Weight Ranges".').' -
        • -
        • '.$this->l('Click "Add new."').'
        • -
        • '. - $this->l('Select the name of the carrier and define the price range or the weight range.').' '. - $this->l('For example, the carrier can be made available for a weight range between 0 and 5lbs. Another carrier can have a range between 5 and 10lbs.').' -
        • -
        • '.$this->l('When you are done, click "Save."').'
        • -
        • '.$this->l('Click on the "Shipping" menu.').'
        • -
        • '. - $this->l('You need to set the fees that will be applied for this carrier.').' '. - $this->l('At the bottom on the page, in the "Fees" section, select the name of the carrier.').' -
        • -
        • '.$this->l('For each zone, enter a price and click "Save."').'
        • -
        • '.$this->l('You\'re all set! The new carrier will be displayed to your customers.').'
        • -
        ' - ); $this->_select = 'b.*'; $this->_join = 'LEFT JOIN `'._DB_PREFIX_.'carrier_lang` b ON a.id_carrier = b.id_carrier'.Shop::addSqlRestrictionOnLang('b').' LEFT JOIN `'._DB_PREFIX_.'carrier_tax_rules_group_shop` ctrgs ON (a.`id_carrier` = ctrgs.`id_carrier` @@ -196,7 +179,7 @@ class AdminCarriersControllerCore extends AdminController { $this->fields_form = array( 'legend' => array( - 'title' => $this->l('Carriers'), + 'title' => $this->l('Carriers:'), 'image' => '../img/admin/delivery.gif' ), 'input' => array( @@ -209,14 +192,14 @@ class AdminCarriersControllerCore extends AdminController 'hint' => sprintf($this->l('Allowed characters: letters, spaces and %s'), '().-'), 'desc' => array( $this->l('Carrier name displayed during checkout'), - $this->l('For in-store pickup, enter 0 to replace the carrier name with your shop name') + $this->l('For in-store pickup, enter 0 to replace the carrier name with your shop name.') ) ), array( 'type' => 'file', 'label' => $this->l('Logo:'), 'name' => 'logo', - 'desc' => $this->l('Upload a logo from your computer').' (.gif, .jpg, .jpeg '.$this->l('or').' .png)' + 'desc' => $this->l('Upload a logo from your computer.').' (.gif, .jpg, .jpeg '.$this->l('or').' .png)' ), array( 'type' => 'text', @@ -226,7 +209,7 @@ class AdminCarriersControllerCore extends AdminController 'required' => true, 'size' => 41, 'maxlength' => 128, - 'desc' => $this->l('Estimated delivery time, displayed during checkout') + 'desc' => $this->l('Estimated delivery time will be displayed during checkout.') ), array( 'type' => 'text', @@ -234,14 +217,14 @@ class AdminCarriersControllerCore extends AdminController 'name' => 'grade', 'required' => false, 'size' => 1, - 'desc' => $this->l('"0" for a longest shipping delay, "9" for the shortest shipping delay.') + 'desc' => $this->l('Enter "0" for a longest shipping delay, or "9" for the shortest shipping delay.') ), array( 'type' => 'text', 'label' => $this->l('URL:'), 'name' => 'url', 'size' => 40, - 'desc' => $this->l('Delivery tracking URL; type \'@\' where the tracking number will appear, it will be automatically replaced by the tracking number') + 'desc' => $this->l('Delivery tracking URL: Type \'@\' where the tracking number should appear. It will then be automatically replaced by the tracking number.') ), array( 'type' => 'checkbox', @@ -252,14 +235,14 @@ class AdminCarriersControllerCore extends AdminController 'id' => 'id_zone', 'name' => 'name' ), - 'desc' => $this->l('The zones in which this carrier is to be used') + 'desc' => $this->l('The zones in which this carrier will be used') ), array( 'type' => 'group', 'label' => $this->l('Group access:'), 'name' => 'groupBox', 'values' => Group::getGroups(Context::getContext()->language->id), - 'desc' => $this->l('Mark all groups for which you want to give access to this carrier') + 'desc' => $this->l('Mark the groups that are allowed access to this carrier.') ), array( 'type' => 'radio', @@ -280,7 +263,7 @@ class AdminCarriersControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Enable carrier in the Front Office') + 'desc' => $this->l('Enable the carrier in the Front Office') ), array( 'type' => 'radio', @@ -300,7 +283,7 @@ class AdminCarriersControllerCore extends AdminController 'label' => ''.$this->l('No').'' ) ), - 'desc' => $this->l('Apply both regular shipping cost and product-specific additional shipping costs') + 'desc' => $this->l('Apply both regular shipping cost and product-specific shipping costs.') ), array( 'type' => 'select', @@ -318,7 +301,7 @@ class AdminCarriersControllerCore extends AdminController ), array( 'type' => 'radio', - 'label' => $this->l('Shipping & handling:'), + 'label' => $this->l('Shipping and handling:'), 'name' => 'shipping_handling', 'required' => false, 'class' => 't', @@ -335,7 +318,7 @@ class AdminCarriersControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Include the shipping & handling costs in carrier price') + 'desc' => $this->l('Include the shipping and handling costs in the carrier price.') ), array( 'type' => 'radio', @@ -380,7 +363,7 @@ class AdminCarriersControllerCore extends AdminController 'id' => 'id', 'name' => 'name' ), - 'desc' => $this->l('Out-of-range behavior when none is defined (e.g. when a customer\'s cart weight is greater than the highest range limit)') + 'desc' => $this->l('Out-of-range behavior occurs when none is defined (e.g. when a customer\'s cart weight is greater than the highest range limit)') ), array( 'type' => 'text', @@ -388,7 +371,7 @@ class AdminCarriersControllerCore extends AdminController 'name' => 'max_height', 'required' => false, 'size' => 10, - 'desc' => $this->l('Maximum height managed by this carrier. Set "0" or leave this field blank to ignore this.') + 'desc' => $this->l('Maximum height managed by this carrier. Set the value to "0," or leave this field blank to ignore.') ), array( 'type' => 'text', @@ -396,7 +379,7 @@ class AdminCarriersControllerCore extends AdminController 'name' => 'max_width', 'required' => false, 'size' => 10, - 'desc' => $this->l('Maximum width managed by this carrier. Set "0" or leave this field blank to ignore this.') + 'desc' => $this->l('Maximum width managed by this carrier. Set the value to "0," or leave this field blank to ignore.') ), array( 'type' => 'text', @@ -404,7 +387,7 @@ class AdminCarriersControllerCore extends AdminController 'name' => 'max_depth', 'required' => false, 'size' => 10, - 'desc' => $this->l('Maximum depth managed by this carrier. Set "0" or leave this field blank to ignore this.') + 'desc' => $this->l('Maximum depth managed by this carrier. Set the value to "0," or leave this field blank to ignore.') ), array( 'type' => 'text', @@ -412,7 +395,7 @@ class AdminCarriersControllerCore extends AdminController 'name' => 'max_weight', 'required' => false, 'size' => 10, - 'desc' => $this->l('Maximum weight managed by this carrier. Set "0" or leave this field blank to ignore this.') + 'desc' => $this->l('Maximum weight managed by this carrier. Set the value to "0," or leave this field blank to ignore.') ), array( 'type' => 'hidden', @@ -443,7 +426,7 @@ class AdminCarriersControllerCore extends AdminController } $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); @@ -467,43 +450,47 @@ class AdminCarriersControllerCore extends AdminController /* Object update */ if (isset($id) && !empty($id)) { - if ($this->tabAccess['edit'] === '1') - { - $current_carrier = new Carrier($id); - if (!Validate::isLoadedObject($current_carrier)) - throw new PrestaShopException('Cannot load Carrier object'); - - // Duplicate current Carrier - $new_carrier = $current_carrier->duplicateObject(); - if (Validate::isLoadedObject($new_carrier)) + try { + if ($this->tabAccess['edit'] === '1') { - // Set flag deteled to true for historization - $current_carrier->deleted = true; - $current_carrier->update(); + $current_carrier = new Carrier($id); + if (!Validate::isLoadedObject($current_carrier)) + throw new PrestaShopException('Cannot load Carrier object'); + + // Duplicate current Carrier + $new_carrier = $current_carrier->duplicateObject(); + if (Validate::isLoadedObject($new_carrier)) + { + // Set flag deteled to true for historization + $current_carrier->deleted = true; + $current_carrier->update(); - // Fill the new carrier object - $this->copyFromPost($new_carrier, $this->table); - $new_carrier->position = $current_carrier->position; - $new_carrier->update(); + // Fill the new carrier object + $this->copyFromPost($new_carrier, $this->table); + $new_carrier->position = $current_carrier->position; + $new_carrier->update(); - $this->updateAssoShop($new_carrier->id); - $new_carrier->copyCarrierData((int)$current_carrier->id); - $this->changeGroups($new_carrier->id); - // Call of hooks - Hook::exec('actionCarrierUpdate', array( - 'id_carrier' => (int)$current_carrier->id, - 'carrier' => $new_carrier - )); - $this->postImage($new_carrier->id); - $this->changeZones($new_carrier->id); - $new_carrier->setTaxRulesGroup((int)Tools::getValue('id_tax_rules_group')); - Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$current_carrier->id.'&conf=4&token='.$this->token); + $this->updateAssoShop($new_carrier->id); + $new_carrier->copyCarrierData((int)$current_carrier->id); + $this->changeGroups($new_carrier->id); + // Call of hooks + Hook::exec('actionCarrierUpdate', array( + 'id_carrier' => (int)$current_carrier->id, + 'carrier' => $new_carrier + )); + $this->postImage($new_carrier->id); + $this->changeZones($new_carrier->id); + $new_carrier->setTaxRulesGroup((int)Tools::getValue('id_tax_rules_group')); + Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$current_carrier->id.'&conf=4&token='.$this->token); + } + else + $this->errors[] = Tools::displayError('An error occurred while updating an object.').' '.$this->table.''; } else - $this->errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.''; + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); + } catch (PrestaShopException $e) { + $this->errors[] = $e->getMessage(); } - else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); } /* Object creation */ @@ -527,10 +514,10 @@ class AdminCarriersControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.''; + $this->errors[] = Tools::displayError('An error occurred while creating an object.').' '.$this->table.''; } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } } parent::postProcess(); @@ -540,18 +527,18 @@ class AdminCarriersControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') { if (Tools::getValue('id_carrier') == Configuration::get('PS_CARRIER_DEFAULT')) - $this->errors[] = Tools::displayError('You cannot disable the default carrier, please change your default carrier first.'); + $this->errors[] = Tools::displayError('You cannot disable the default carrier, however you can change your defeault carrier. '); else parent::postProcess(); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else { if ((Tools::isSubmit('submitDel'.$this->table) && in_array(Configuration::get('PS_CARRIER_DEFAULT'), Tools::getValue('carrierBox'))) || (isset($_GET['delete'.$this->table]) && Tools::getValue('id_carrier') == Configuration::get('PS_CARRIER_DEFAULT'))) - $this->errors[] = $this->l('Please set another carrier as default before deleting this one'); + $this->errors[] = $this->l('Please set another carrier as default before deleting this one.'); else { // if deletion : removes the carrier from the warehouse/carrier association @@ -642,7 +629,7 @@ class AdminCarriersControllerCore extends AdminController { $carrier = new $this->className($id); if (!Validate::isLoadedObject($carrier)) - die (Tools::displayError('Object cannot be loaded')); + die (Tools::displayError('The object cannot be loaded.')); $zones = Zone::getZones(false); foreach ($zones as $zone) if (count($carrier->getZone($zone['id_zone']))) @@ -692,6 +679,11 @@ class AdminCarriersControllerCore extends AdminController } } + public function displayEditLink($token = null, $id, $name = null) + { + return ''; + } + } diff --git a/controllers/admin/AdminCartRulesController.php b/controllers/admin/AdminCartRulesController.php index 7e74fdf46..9a0fddeb8 100644 --- a/controllers/admin/AdminCartRulesController.php +++ b/controllers/admin/AdminCartRulesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -31,8 +31,8 @@ class AdminCartRulesControllerCore extends AdminController $this->table = 'cart_rule'; $this->className = 'CartRule'; $this->lang = true; - $this->addRowAction('delete'); $this->addRowAction('edit'); + $this->addRowAction('delete'); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->fields_list = array( @@ -48,6 +48,12 @@ class AdminCartRulesControllerCore extends AdminController parent::__construct(); } + public function setMedia() + { + parent::setMedia(); + $this->addJqueryPlugin(array('typewatch', 'fancybox', 'autocomplete')); + } + public function postProcess() { if (Tools::isSubmit('submitAddcart_rule') || Tools::isSubmit('submitAddcart_ruleAndStay')) @@ -113,14 +119,14 @@ class AdminCartRulesControllerCore extends AdminController // Idiot-proof control if (strtotime(Tools::getValue('date_from')) > strtotime(Tools::getValue('date_to'))) - $this->errors[] = Tools::displayError('The voucher cannot end before it begins'); + $this->errors[] = Tools::displayError('The voucher cannot end before it begins.'); if ((int)Tools::getValue('minimum_amount') < 0) - $this->errors[] = Tools::displayError('Minimum amount cannot be lower than 0'); + $this->errors[] = Tools::displayError('The minimum amount cannot be lower than zero.'); if ((float)Tools::getValue('reduction_percent') < 0 || (float)Tools::getValue('reduction_percent') > 100) $this->errors[] = Tools::displayError('Reduction percent must be between 0% and 100%'); if ((int)Tools::getValue('reduction_amount') < 0) - $this->errors[] = Tools::displayError('Reduction amount cannot be lower than 0'); - if (Tools::getValue('code') && ($same_code = (int)CartRule::getIdByCode(Tools::getValue('code')))) + $this->errors[] = Tools::displayError('Reduction amount cannot be lower than zero.'); + if (Tools::getValue('code') && ($same_code = (int)CartRule::getIdByCode(Tools::getValue('code'))) && $same_code != Tools::getValue('id_cart_rule')) $this->errors[] = sprintf(Tools::displayError('This cart rule code is already used (conflict with cart rule %d)'), $same_code); } @@ -445,7 +451,7 @@ class AdminCartRulesControllerCore extends AdminController ); } else - return array('found' => false, 'notfound' => Tools::displayError('No product found')); + return array('found' => false, 'notfound' => Tools::displayError('No product has been found.')); } public function ajaxProcessSearchProducts() @@ -465,13 +471,6 @@ class AdminCartRulesControllerCore extends AdminController 'desc' => $this->l('Save and Stay') ); - // Todo: change for "Media" version - $this->addJs(_PS_JS_DIR_.'jquery/plugins/jquery.typewatch.js'); - $this->addJs(_PS_JS_DIR_.'jquery/plugins/fancybox/jquery.fancybox.js'); - $this->addJs(_PS_JS_DIR_.'jquery/plugins/autocomplete/jquery.autocomplete.js'); - $this->addCss(_PS_JS_DIR_.'jquery/plugins/fancybox/jquery.fancybox.css'); - $this->addCss(_PS_JS_DIR_.'jquery/plugins/autocomplete/jquery.autocomplete.css'); - $current_object = $this->loadObject(true); // All the filter are prefilled with the correct information @@ -542,7 +541,7 @@ class AdminCartRulesControllerCore extends AdminController 'show_toolbar' => true, 'toolbar_btn' => $this->toolbar_btn, 'toolbar_scroll' => $this->toolbar_scroll, - 'title' => array($this->l('Payment'), $this->l('Cart Rules')), + 'title' => array($this->l('Payment: '), $this->l('Cart Rules')), 'defaultDateFrom' => date('Y-m-d H:00:00'), 'defaultDateTo' => date('Y-m-d H:00:00', strtotime('+1 month')), 'customerFilter' => $customer_filter, diff --git a/controllers/admin/AdminCartsController.php b/controllers/admin/AdminCartsController.php index f1fcbdf82..b4c5bf35c 100755 --- a/controllers/admin/AdminCartsController.php +++ b/controllers/admin/AdminCartsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -35,6 +35,7 @@ class AdminCartsControllerCore extends AdminController $this->addRowAction('view'); $this->addRowAction('delete'); + $this->allow_export = true; $this->_select = 'CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) `customer`, a.id_cart total, ca.name carrier, o.id_order, IF(co.id_guest, 1, 0) id_guest'; $this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = a.id_customer) @@ -100,21 +101,31 @@ class AdminCartsControllerCore extends AdminController { if (!($cart = $this->loadObject(true))) return; - $customer = new Customer($cart->id_customer); + $currency = new Currency($cart->id_currency); $this->context->cart = $cart; + $this->context->currency = $currency; $this->context->customer = $customer; $products = $cart->getProducts(); $customized_datas = Product::getAllCustomizedDatas((int)$cart->id); Product::addCustomizationPrice($products, $customized_datas); $summary = $cart->getSummaryDetails(); - $currency = new Currency($cart->id_currency); /* Display order information */ $id_order = (int)Order::getOrderByCartId($cart->id); $order = new Order($id_order); - - if ($order->getTaxCalculationMethod() == PS_TAX_EXC) + if (Validate::isLoadedObject($order)) + { + $tax_calculation_method = $order->getTaxCalculationMethod(); + $id_shop = (int)$order->id_shop; + } + else + { + $id_shop = (int)$cart->id_shop; + $tax_calculation_method = Group::getPriceDisplayMethod(Group::getCurrent()->id); + } + + if ($tax_calculation_method == PS_TAX_EXC) { $total_products = $summary['total_products']; $total_discounts = $summary['total_discounts_tax_exc']; @@ -132,7 +143,7 @@ class AdminCartsControllerCore extends AdminController } foreach ($products as $k => &$product) { - if ($order->getTaxCalculationMethod() == PS_TAX_EXC) + if ($tax_calculation_method == PS_TAX_EXC) { $product['product_price'] = $product['price']; $product['product_total'] = $product['total']; @@ -153,7 +164,7 @@ class AdminCartsControllerCore extends AdminController WHERE id_product = '.(int)$product['id_product'].' AND cover = 1'); $product_obj = new Product($product['id_product']); - $product['qty_in_stock'] = StockAvailable::getQuantityAvailableByProduct($product['id_product'], isset($product['id_product_attribute']) ? $product['id_product_attribute'] : null, (int)$order->id_shop); + $product['qty_in_stock'] = StockAvailable::getQuantityAvailableByProduct($product['id_product'], isset($product['id_product_attribute']) ? $product['id_product_attribute'] : null, (int)$id_shop); $image_product = new Image($image['id_image']); $product['image'] = (isset($image['id_image']) ? ImageManager::thumbnail(_PS_IMG_DIR_.'p/'.$image_product->getExistingImgPath().'.jpg', 'product_mini_'.(int)$product['id_product'].(isset($product['id_product_attribute']) ? '_'.(int)$product['id_product_attribute'] : '').'.jpg', 45, 'jpg') : '--'); @@ -189,9 +200,16 @@ class AdminCartsControllerCore extends AdminController if (!$id_cart) $id_cart = $customer->getLastCart(false); $this->context->cart = new Cart((int)$id_cart); + + if (!$this->context->cart->id) + { + $this->context->cart->recyclable = 0; + $this->context->cart->gift = 0; + } + if (!$this->context->cart->id_customer) $this->context->cart->id_customer = $id_customer; - if ($this->context->cart->OrderExists()) + if (Validate::isLoadedObject($this->context->cart) && $this->context->cart->OrderExists()) return; if (!$this->context->cart->secure_key) $this->context->cart->secure_key = $this->context->customer->secure_key; @@ -255,35 +273,35 @@ class AdminCartsControllerCore extends AdminController $field_id = 'customization_'.$id_product.'_'.$customization_field['id_customization_field']; if ($customization_field['type'] == Product::CUSTOMIZE_TEXTFIELD) { - if (!isset($_POST[$field_id]) || empty($_POST[$field_id])) + if (!Tools::getValue($field_id)) { if ($customization_field['required']) - $errors[] = Tools::displayError('Please fill in all required fields'); + $errors[] = Tools::displayError('Please fill in all the required fields.'); continue; } - if (!Validate::isMessage($_POST[$field_id]) || empty($_POST[$field_id])) + if (!Validate::isMessage(Tools::getValue($field_id))) $errors[] = Tools::displayError('Invalid message'); - $this->context->cart->addTextFieldToProduct((int)$product->id, (int)$customization_field['id_customization_field'], Product::CUSTOMIZE_TEXTFIELD, $_POST[$field_id]); + $this->context->cart->addTextFieldToProduct((int)$product->id, (int)$customization_field['id_customization_field'], Product::CUSTOMIZE_TEXTFIELD, Tools::getValue($field_id)); } elseif ($customization_field['type'] == Product::CUSTOMIZE_FILE) { if (!isset($_FILES[$field_id]) || !isset($_FILES[$field_id]['tmp_name']) || empty($_FILES[$field_id]['tmp_name'])) { if ($customization_field['required']) - $errors[] = Tools::displayError('Please fill in all required fields'); + $errors[] = Tools::displayError('Please fill in all the required fields.'); continue; } if ($error = ImageManager::validateUpload($_FILES[$field_id], (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE'))) $errors[] = $error; if (!($tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES[$field_id]['tmp_name'], $tmp_name)) - $errors[] = Tools::displayError('An error occurred during the image upload.'); + $errors[] = Tools::displayError('An error occurred during the image upload process.'); $file_name = md5(uniqid(rand(), true)); if (!ImageManager::resize($tmp_name, _PS_UPLOAD_DIR_.$file_name)) continue; elseif (!ImageManager::resize($tmp_name, _PS_UPLOAD_DIR_.$file_name.'_small', (int)Configuration::get('PS_PRODUCT_PICTURE_WIDTH'), (int)Configuration::get('PS_PRODUCT_PICTURE_HEIGHT'))) - $errors[] = Tools::displayError('An error occurred during the image upload.'); + $errors[] = Tools::displayError('An error occurred during the image upload process.'); elseif (!chmod(_PS_UPLOAD_DIR_.$file_name, 0777) || !chmod(_PS_UPLOAD_DIR_.$file_name.'_small', 0777)) - $errors[] = Tools::displayError('An error occurred during the image upload.'); + $errors[] = Tools::displayError('An error occurred during the image upload process.'); else $this->context->cart->addPictureToProduct((int)$product->id, (int)$customization_field['id_customization_field'], Product::CUSTOMIZE_FILE, $file_name); unlink($tmp_name); @@ -306,7 +324,7 @@ class AdminCartsControllerCore extends AdminController if (!$this->context->cart->id) return; if ($this->context->cart->OrderExists()) - $errors[] = Tools::displayError('An order has already been placed with this cart'); + $errors[] = Tools::displayError('An order has already been placed with this cart.'); elseif (!($id_product = (int)Tools::getValue('id_product')) || !($product = new Product((int)$id_product, true, $this->context->language->id))) $errors[] = Tools::displayError('Invalid product'); elseif (!($qty = Tools::getValue('qty')) || $qty == 0) @@ -318,17 +336,17 @@ class AdminCartsControllerCore extends AdminController if (($id_product_attribute = Tools::getValue('id_product_attribute')) != 0) { if (!Product::isAvailableWhenOutOfStock($product->out_of_stock) && !Attribute::checkAttributeQty((int)$id_product_attribute, (int)$qty)) - $errors[] = Tools::displayError('There is not enough product in stock'); + $errors[] = Tools::displayError('There is not enough product in stock.'); } else if (!$product->checkQty((int)$qty)) - $errors[] = Tools::displayError('There is not enough product in stock'); + $errors[] = Tools::displayError('There is not enough product in stock.'); if (!($id_customization = (int)Tools::getValue('id_customization', 0)) && !$product->hasAllRequiredCustomizableFields()) - $errors[] = Tools::displayError('Please fill in all required fields'); + $errors[] = Tools::displayError('Please fill in all the required fields.'); $this->context->cart->save(); } else - $errors[] = Tools::displayError('Product can\'t be added to the cart'); + $errors[] = Tools::displayError('This product cannot be added to the cart'); if (!count($errors)) { @@ -345,7 +363,7 @@ class AdminCartsControllerCore extends AdminController elseif ($qty_upd < 0) { $minimal_qty = $id_product_attribute ? Attribute::getAttributeMinimalQty((int)$id_product_attribute) : $product->minimal_quantity; - $errors[] = sprintf(Tools::displayError('You must add a minimum of %d quantity', false), $minimal_qty); + $errors[] = sprintf(Tools::displayError('You must add a minimum quantity of %d', false), $minimal_qty); } } @@ -434,9 +452,9 @@ class AdminCartsControllerCore extends AdminController $cart = Cart::getCartByOrderId($id_order); $new_cart = $cart->duplicate(); if (!$new_cart || !Validate::isLoadedObject($new_cart['cart'])) - $errors[] = Tools::displayError('The order cannot be renewed'); + $errors[] = Tools::displayError('The order cannot be renewed.'); else if (!$new_cart['success']) - $errors[] = Tools::displayError('The order cannot be renewed'); + $errors[] = Tools::displayError('The order cannot be renewed.'); else { $this->context->cart = $new_cart['cart']; @@ -461,8 +479,8 @@ class AdminCartsControllerCore extends AdminController if (!$id_cart_rule = CartRule::getIdByCode('BO_ORDER_'.(int)$this->context->cart->id)) { $cart_rule = new CartRule(); - $cart_rule->code = 'BO_ORDER_'.(int)$this->context->cart->id; - $cart_rule->name = array(Configuration::get('PS_LANG_DEFAULT') => $this->l('Free Shipping')); + $cart_rule->code = CartRule::BO_ORDER_CODE_PREFIX.(int)$this->context->cart->id; + $cart_rule->name = array(Configuration::get('PS_LANG_DEFAULT') => $this->l('Free Shipping', 'AdminTab', false, false)); $cart_rule->id_customer = (int)$this->context->cart->id_customer; $cart_rule->free_shipping = true; $cart_rule->quantity = 1; @@ -535,7 +553,7 @@ class AdminCartsControllerCore extends AdminController { $product['price'] = str_replace($currency->sign, '', Tools::displayPrice($product['price'], $currency)); $product['total'] = str_replace($currency->sign, '', Tools::displayPrice($product['total'], $currency)); - $product['image_link'] = $this->context->link->getImageLink($product['link_rewrite'], $product['id_image'], 'small'); + $product['image_link'] = $this->context->link->getImageLink($product['link_rewrite'], $product['id_image'], 'small_default'); if (!isset($product['attributes_small'])) $product['attributes_small'] = ''; $product['customized_datas'] = Product::getAllCustomizedDatas((int)$this->context->cart->id, null, true); @@ -570,7 +588,7 @@ class AdminCartsControllerCore extends AdminController if (isset($summary['gift_products']) && count($summary['gift_products'])) foreach ($summary['gift_products'] as &$product) { - $product['image_link'] = $this->context->link->getImageLink($product['link_rewrite'], $product['id_image'], 'small'); + $product['image_link'] = $this->context->link->getImageLink($product['link_rewrite'], $product['id_image'], 'small_default'); if (!isset($product['attributes_small'])) $product['attributes_small'] = ''; } @@ -721,6 +739,7 @@ class AdminCartsControllerCore extends AdminController { $context = Context::getContext(); $context->cart = new Cart($id_cart); + $context->currency = new Currency((int)$context->cart->id_currency); $context->customer = new Customer((int)$context->cart->id_customer); return Cart::getTotalCart($id_cart, true, Cart::BOTH_WITHOUT_SHIPPING); } @@ -729,4 +748,14 @@ class AdminCartsControllerCore extends AdminController { return ($echo == '0' ? Configuration::get('PS_SHOP_NAME') : $echo); } + + public function displayDeleteLink($token = null, $id, $name = null) + { + // don't display ordered carts + foreach ($this->_list as $row) + if ($row['id_cart'] == $id && isset($row['id_order']) && $row['id_order']) + return ; + + return $this->helper->displayDeleteLink($token, $id, $name); + } } diff --git a/controllers/admin/AdminCategoriesController.php b/controllers/admin/AdminCategoriesController.php index 6c5f7229b..46e80f515 100644 --- a/controllers/admin/AdminCategoriesController.php +++ b/controllers/admin/AdminCategoriesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -45,6 +45,7 @@ class AdminCategoriesControllerCore extends AdminController $this->lang = true; $this->deleted = false; $this->explicitSelect = true; + $this->allow_export = true; $this->context = Context::getContext(); @@ -101,17 +102,51 @@ class AdminCategoriesControllerCore extends AdminController if (($id_category = Tools::getvalue('id_category')) && $this->action != 'select_delete') $this->_category = new Category($id_category); else + { if (Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP) $this->_category = new Category($this->context->shop->id_category); - else if (count(Category::getCategoriesWithoutParent()) > 1 && Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(true, null, true)) != 1) + elseif (count(Category::getCategoriesWithoutParent()) > 1 && Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(true, null, true)) != 1) $this->_category = Category::getTopCategory(); else $this->_category = new Category(Configuration::get('PS_HOME_CATEGORY')); + } + + $count_categories_without_parent = count(Category::getCategoriesWithoutParent()); + $top_category = Category::getTopCategory(); + if (Tools::isSubmit('id_category')) + $id_parent = $this->_category->id; + elseif (!Shop::isFeatureActive() && $count_categories_without_parent > 1) + $id_parent = $top_category->id; + elseif (Shop::isFeatureActive() && $count_categories_without_parent == 1) + $id_parent = Configuration::get('PS_HOME_CATEGORY'); + elseif (Shop::isFeatureActive() && $count_categories_without_parent > 1 && Shop::getContext() != Shop::CONTEXT_SHOP) + { + if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(true, null, true)) == 1) + $id_parent = $this->context->shop->id_category; + else + $id_parent = $top_category->id; + } + else + $id_parent = $this->context->shop->id_category; + + $this->_select = 'sa.position position'; + $this->_filter .= ' AND `id_parent` = '.(int)$id_parent.' '; + + if (Shop::getContext() == Shop::CONTEXT_SHOP) + $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = '.(int)$this->context->shop->id.') '; + else + $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = a.id_shop_default) '; + + + // we add restriction for shop + if (Shop::getContext() == Shop::CONTEXT_SHOP && Shop::isFeatureActive()) + $this->_where = ' AND sa.`id_shop` = '.(int)Context::getContext()->shop->id; + // if we are not in a shop context, we remove the position column if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) unset($this->fields_list['position']); // shop restriction : if category is not available for current shop, we redirect to the list from default category - if (!$this->_category->isAssociatedToShop() && Shop::getContext() == Shop::CONTEXT_SHOP) + if (Validate::isLoadedObject($this->_category) && !$this->_category->isAssociatedToShop() && Shop::getContext() == Shop::CONTEXT_SHOP) { $this->redirect_after = self::$currentIndex.'&id_category='.(int)$this->context->shop->getCategory().'&token='.$this->token; $this->redirect(); @@ -144,45 +179,17 @@ class AdminCategoriesControllerCore extends AdminController $this->addRowAction('add'); $this->addRowAction('view'); - $count_categories_without_parent = count(Category::getCategoriesWithoutParent()); - $is_multishop = Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE'); - $top_category = Category::getTopCategory(); - - if (Tools::isSubmit('id_category')) - $id_parent = $this->_category->id; - else if (!$is_multishop && $count_categories_without_parent > 1) - $id_parent = $top_category->id; - else if ($is_multishop && $count_categories_without_parent == 1) - $id_parent = Configuration::get('PS_HOME_CATEGORY'); - else if ($is_multishop && $count_categories_without_parent > 1 && Shop::getContext() != Shop::CONTEXT_SHOP) - if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops(true, null, true)) == 1) - $id_parent = $this->context->shop->id_category; - else - $id_parent = $top_category->id; - else - $id_parent = $this->context->shop->id_category; - - $this->_select = 'sa.position position'; - $this->_filter .= ' AND `id_parent` = '.(int)$id_parent.' '; - - if (Shop::getContext() == Shop::CONTEXT_SHOP) - $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = '.(int)$this->context->shop->id.') '; - else - $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'category_shop` sa ON (a.`id_category` = sa.`id_category` AND sa.id_shop = a.id_shop_default) '; - - - // we add restriction for shop - if (Shop::getContext() == Shop::CONTEXT_SHOP && $is_multishop) - $this->_where = ' AND sa.`id_shop` = '.(int)Context::getContext()->shop->id; - + $count_categories_without_parent = count(Category::getCategoriesWithoutParent()); $categories_tree = $this->_category->getParentsCategories(); + if (empty($categories_tree) - && ($this->_category->id_category != 1 || Tools::isSubmit('id_category')) - && (Shop::getContext() == Shop::CONTEXT_SHOP && !$is_multishop && $count_categories_without_parent > 1)) + && ($this->_category->id != 1 || Tools::isSubmit('id_category')) + && (Shop::getContext() == Shop::CONTEXT_SHOP && !Shop::isFeatureActive() && $count_categories_without_parent > 1)) $categories_tree = array(array('name' => $this->_category->name[$this->context->language->id])); - asort($categories_tree); + $categories_tree = array_reverse($categories_tree); $this->tpl_list_vars['categories_tree'] = $categories_tree; + $this->tpl_list_vars['categories_tree_current_id'] = $this->_category->id; if (Tools::isSubmit('submitBulkdelete'.$this->table) || Tools::isSubmit('delete'.$this->table)) { @@ -201,8 +208,7 @@ class AdminCategoriesControllerCore extends AdminController public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) { - $alias = 'sa'; - parent::getList($id_lang, $alias.'.position', $order_way, $start, $limit, Context::getContext()->shop->id); + parent::getList($id_lang, $order_by, $order_way, $start, $limit, Context::getContext()->shop->id); // Check each row to see if there are combinations and get the correct action in consequence $nb_items = count($this->_list); @@ -225,14 +231,18 @@ class AdminCategoriesControllerCore extends AdminController { if (empty($this->display)) { - if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE')) + if (Configuration::get('PS_MULTISHOP_FEATURE_ACTIVE') && count(Shop::getShops()) > 1) $this->toolbar_btn['new-url'] = array( 'href' => self::$currentIndex.'&add'.$this->table.'root&token='.$this->token, 'desc' => $this->l('Add new root category') ); $this->toolbar_btn['new'] = array( 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token, - 'desc' => $this->l('Add new') + 'desc' => $this->l('Add New') + ); + $this->toolbar_btn['import'] = array( + 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table, + 'desc' => $this->l('Import') ); } // be able to edit the Home category @@ -253,7 +263,7 @@ class AdminCategoriesControllerCore extends AdminController if ($this->display == 'view') $this->toolbar_btn['new'] = array( 'href' => self::$currentIndex.'&add'.$this->table.'&id_parent='.(int)Tools::getValue('id_category').'&token='.$this->token, - 'desc' => $this->l('Add new') + 'desc' => $this->l('Add New') ); parent::initToolbar(); if ($this->_category->id == Category::getTopCategory()->id && isset($this->toolbar_btn['new'])) @@ -264,7 +274,7 @@ class AdminCategoriesControllerCore extends AdminController $id_category = (Tools::isSubmit('id_category')) ? '&id_parent='.(int)Tools::getValue('id_category') : ''; $this->toolbar_btn['new'] = array( 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token.$id_category, - 'desc' => $this->l('Add new') + 'desc' => $this->l('Add New') ); if (Tools::isSubmit('id_category')) @@ -287,10 +297,14 @@ class AdminCategoriesControllerCore extends AdminController if ($this->tabAccess['add']) { $this->action = 'add'.$this->table.'root'; - $this->display = 'edit'; + $obj = $this->loadObject(true); + if (Validate::isLoadedObject($obj)) + $this->display = 'edit'; + else + $this->display = 'add'; } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } parent::initProcess(); @@ -314,11 +328,11 @@ class AdminCategoriesControllerCore extends AdminController $guest = new Group(Configuration::get('PS_GUEST_GROUP')); $default = new Group(Configuration::get('PS_CUSTOMER_GROUP')); - $unidentified_group_information = sprintf($this->l('%s - All people without a validated customer account.'), ''.$unidentified->name[$this->context->language->id].''); - $guest_group_information = sprintf($this->l('%s - Customer who placed an order with the Guest Checkout.'), ''.$guest->name[$this->context->language->id].''); + $unidentified_group_information = sprintf($this->l('%s - All people without a valid customer account.'), ''.$unidentified->name[$this->context->language->id].''); + $guest_group_information = sprintf($this->l('%s - Customer who placed an order with the guest checkout.'), ''.$guest->name[$this->context->language->id].''); $default_group_information = sprintf($this->l('%s - All people who have created an account on this site.'), ''.$default->name[$this->context->language->id].''); $root_category = Category::getRootCategory(); - $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name); + $root_category = array('id_category' => $root_category->id, 'name' => $root_category->name); $this->fields_form = array( 'tinymce' => true, 'legend' => array( @@ -363,7 +377,7 @@ class AdminCategoriesControllerCore extends AdminController 'values' => array( 'trads' => array( 'Root' => $root_category, - 'selected' => $this->l('selected'), + 'selected' => $this->l('Selected'), 'Collapse All' => $this->l('Collapse All'), 'Expand All' => $this->l('Expand All') ), @@ -400,6 +414,7 @@ class AdminCategoriesControllerCore extends AdminController 'type' => 'textarea', 'label' => $this->l('Description:'), 'name' => 'description', + 'autoload_rte' => true, 'lang' => true, 'rows' => 10, 'cols' => 100, @@ -410,7 +425,7 @@ class AdminCategoriesControllerCore extends AdminController 'label' => $this->l('Image:'), 'name' => 'image', 'display_image' => true, - 'desc' => $this->l('Upload category logo from your computer') + 'desc' => $this->l('Upload a category logo from your computer.') ), array( 'type' => 'text', @@ -432,7 +447,7 @@ class AdminCategoriesControllerCore extends AdminController 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Forbidden characters:').' <>;=#{}', - 'desc' => $this->l('To add "tags" click in the field, write something, then press "Enter"') + 'desc' => $this->l('To add "tags," click in the field, write something, and then press "Enter."') ), array( 'type' => 'text', @@ -440,7 +455,7 @@ class AdminCategoriesControllerCore extends AdminController 'name' => 'link_rewrite', 'lang' => true, 'required' => true, - 'hint' => $this->l('Only letters and the minus (-) character are allowed') + 'hint' => $this->l('Only letters and the minus (-) character are allowed.') ), array( 'type' => 'group', @@ -451,7 +466,7 @@ class AdminCategoriesControllerCore extends AdminController 'unidentified' => $unidentified_group_information, 'guest' => $guest_group_information, 'customer' => $default_group_information, - 'desc' => $this->l('Mark all customer groups you want to give access to this category') + 'desc' => $this->l('Mark all of the customer groups you;d like to have access to this category.') ) ), 'submit' => array( @@ -528,18 +543,23 @@ class AdminCategoriesControllerCore extends AdminController { $id_category = (int)Tools::getValue('id_category'); $id_parent = (int)Tools::getValue('id_parent'); + // if true, we are in a root category creation if (!$id_parent && !Tools::isSubmit('is_root_category')) - $_POST['is_root_category'] = $_POST['level_depth'] = $_POST['id_parent'] = $id_parent = 1; + { + $_POST['is_root_category'] = $_POST['level_depth'] = 1; + $_POST['id_parent'] = $id_parent = (int)Configuration::get('PS_ROOT_CATEGORY'); + } + if ($id_category) { if ($id_category != $id_parent) { if (!Category::checkBeforeMove($id_category, $id_parent)) - $this->errors[] = Tools::displayError($this->l('Category cannot be moved here')); + $this->errors[] = Tools::displayError($this->l('The category cannot be moved here.')); } else - $this->errors[] = Tools::displayError($this->l('Category cannot be parent of itself.')); + $this->errors[] = Tools::displayError($this->l('The category cannot be a parent of itself.')); } $object = parent::processAdd(); @@ -585,7 +605,7 @@ class AdminCategoriesControllerCore extends AdminController return false; } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } public function processDelete() @@ -594,7 +614,7 @@ class AdminCategoriesControllerCore extends AdminController if ($this->tabAccess['delete'] === '1') { if ($category->isRootCategoryForAShop()) - $this->errors[] = Tools::displayError('You cannot remove this category because a shop uses this category as a root category.'); + $this->errors[] = Tools::displayError('You cannot remove this category because one of your shops uses it as a root category.'); else if (parent::processDelete()) { $this->setDeleteMode(); @@ -605,7 +625,7 @@ class AdminCategoriesControllerCore extends AdminController return false; } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } public function processFatherlessProducts($id_parent) @@ -615,10 +635,10 @@ class AdminCategoriesControllerCore extends AdminController SELECT p.`id_product` FROM `'._DB_PREFIX_.'product` p '.Shop::addSqlAssociation('product', 'p').' WHERE p.`id_product` NOT IN (SELECT DISTINCT(cp.`id_product`) FROM `'._DB_PREFIX_.'category_product` cp)'); - + foreach ($fatherless_products as $id_poor_product) { - $poor_product = new Product((int)$id_poor_product); + $poor_product = new Product((int)$id_poor_product['id_product']); if (Validate::isLoadedObject($poor_product)) { if ($this->remove_products || $id_parent == 0) @@ -638,9 +658,9 @@ class AdminCategoriesControllerCore extends AdminController public function processPosition() { if ($this->tabAccess['edit'] !== '1') - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); else if (!Validate::isLoadedObject($object = new Category((int)Tools::getValue($this->identifier, Tools::getValue('id_category_to_move', 1))))) - $this->errors[] = Tools::displayError('An error occurred while updating status for object.').' '. + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' '. $this->table.' '.Tools::displayError('(cannot load object)'); if (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) $this->errors[] = Tools::displayError('Failed to update the position.'); diff --git a/controllers/admin/AdminCmsCategoriesController.php b/controllers/admin/AdminCmsCategoriesController.php index ae64435f6..d973f22be 100644 --- a/controllers/admin/AdminCmsCategoriesController.php +++ b/controllers/admin/AdminCmsCategoriesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -33,6 +33,7 @@ class AdminCmsCategoriesControllerCore extends AdminController public function __construct() { + $this->is_cms = true; $this->table = 'cms_category'; $this->className = 'CMSCategory'; $this->lang = true; @@ -69,6 +70,7 @@ class AdminCmsCategoriesControllerCore extends AdminController public function renderList() { $this->initToolbar(); + $this->toolbar_btn['new']['href'] .= '&id_parent='.(int)Tools::getValue('id_cms_category'); return parent::renderList(); } @@ -96,10 +98,14 @@ class AdminCmsCategoriesControllerCore extends AdminController $this->id_object = $id_cms_category; if (!CMSCategory::checkBeforeMove($id_cms_category, (int)Tools::getValue('id_parent'))) { - $this->errors[] = Tools::displayError('CMS Category cannot be moved here'); + $this->errors[] = Tools::displayError('The CMS Category cannot be moved here.'); return false; } } + $object = parent::postProcess(); + if ($object !== false) + Tools::redirectAdmin(self::$currentIndex.'&conf=3&id_cms_category='.(int)$object->id.'&token='.Tools::getValue('token')); + return $object; } /* Change object statuts (active, inactive) */ elseif (Tools::isSubmit('statuscms_category') && Tools::getValue($this->identifier)) @@ -114,14 +120,14 @@ class AdminCmsCategoriesControllerCore extends AdminController Tools::redirectAdmin(self::$currentIndex.'&conf=5'.$identifier.'&token='.Tools::getValue('token')); } else - $this->errors[] = Tools::displayError('An error occurred while updating status.'); + $this->errors[] = Tools::displayError('An error occurred while updating the status.'); } else - $this->errors[] = Tools::displayError('An error occurred while updating status for object.') + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.') .' '.$this->table.' '.Tools::displayError('(cannot load object)'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } /* Delete object */ elseif (Tools::isSubmit('delete'.$this->table)) @@ -136,41 +142,39 @@ class AdminCmsCategoriesControllerCore extends AdminController .' '.$this->table.'
        '.Tools::displayError('You cannot delete all of the items.'); else { + $identifier = ((int)$object->id_parent ? '&'.$this->identifier.'='.(int)$object->id_parent : ''); if ($this->deleted) { $object->deleted = 1; if ($object->update()) - Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getValue('token')); + Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getValue('token').$identifier); } elseif ($object->delete()) - Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getValue('token')); + Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.Tools::getValue('token').$identifier); $this->errors[] = Tools::displayError('An error occurred during deletion.'); } } else - $this->errors[] = Tools::displayError('An error occurred while deleting object.') + $this->errors[] = Tools::displayError('An error occurred while deleting the object.') .' '.$this->table.' '.Tools::displayError('(cannot load object)'); } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } elseif (Tools::isSubmit('position')) { $object = new CMSCategory((int)Tools::getValue($this->identifier, Tools::getValue('id_cms_category_to_move', 1))); if ($this->tabAccess['edit'] !== '1') - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); elseif (!Validate::isLoadedObject($object)) - $this->errors[] = Tools::displayError('An error occurred while updating status for object.') + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.') .' '.$this->table.' '.Tools::displayError('(cannot load object)'); elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) $this->errors[] = Tools::displayError('Failed to update the position.'); else { - $identifier = ''; - if ($id_category = (int)Tools::getValue($this->identifier, Tools::getValue('id_cms_category_parent', 1))) - $identifier = '&'.$this->identifier.'='.$id_category; + $identifier = ((int)$object->id_parent ? '&'.$this->identifier.'='.(int)$object->id_parent : ''); $token = Tools::getAdminTokenLite('AdminCmsContent'); - Tools::redirectAdmin( self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=5'.$identifier.'&token='.$token ); @@ -190,16 +194,16 @@ class AdminCmsCategoriesControllerCore extends AdminController { $cms_category->cleanPositions((int)Tools::getValue('id_cms_category')); $token = Tools::getAdminTokenLite('AdminCmsContent'); - Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.$token.'&id_category='.(int)Tools::getValue('id_cms_category')); + Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.$token.'&id_cms_category='.(int)Tools::getValue('id_cms_category')); } - $this->errors[] = Tools::displayError('An error occurred while deleting selection.'); + $this->errors[] = Tools::displayError('An error occurred while deleting this selection.'); } else $this->errors[] = Tools::displayError('You must select at least one element to delete.'); } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } parent::postProcess(); } @@ -294,7 +298,7 @@ class AdminCmsCategoriesControllerCore extends AdminController 'name' => 'link_rewrite', 'required' => true, 'lang' => true, - 'hint' => $this->l('Only letters and the minus (-) character are allowed') + 'hint' => $this->l('Only letters and the minus (-) character are allowed.') ), ), 'submit' => array( @@ -302,7 +306,7 @@ class AdminCmsCategoriesControllerCore extends AdminController 'class' => 'button' ) ); - + $this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL'); return parent::renderForm(); } } diff --git a/controllers/admin/AdminCmsContentController.php b/controllers/admin/AdminCmsContentController.php index 566e4d591..59c5bec9e 100644 --- a/controllers/admin/AdminCmsContentController.php +++ b/controllers/admin/AdminCmsContentController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -113,6 +113,7 @@ class AdminCmsContentControllerCore extends AdminController if (Tools::isSubmit('submitDelcms') || Tools::isSubmit('previewSubmitAddcmsAndPreview') || Tools::isSubmit('submitAddcms') + || Tools::isSubmit('submitBulkdeletecms') || Tools::isSubmit('deletecms') || Tools::isSubmit('viewcms') || (Tools::isSubmit('statuscms') && Tools::isSubmit('id_cms')) @@ -126,6 +127,8 @@ class AdminCmsContentControllerCore extends AdminController || (Tools::isSubmit('statuscms_category') && Tools::isSubmit('id_cms_category')) || (Tools::isSubmit('position') && Tools::isSubmit('id_cms_category_to_move'))) $this->admin_cms_categories->postProcess(); + else + parent::postProcess(); if (((Tools::isSubmit('submitAddcms_category') || Tools::isSubmit('submitAddcms_categoryAndStay')) && count($this->admin_cms_categories->errors)) || Tools::isSubmit('updatecms_category') @@ -146,8 +149,6 @@ class AdminCmsContentControllerCore extends AdminController if (isset($this->admin_cms_categories->errors)) $this->errors = array_merge($this->errors, $this->admin_cms_categories->errors); - - parent::postProcess(); } public function setMedia() diff --git a/controllers/admin/AdminCmsController.php b/controllers/admin/AdminCmsController.php index 8029a1a2b..c46c61b88 100644 --- a/controllers/admin/AdminCmsController.php +++ b/controllers/admin/AdminCmsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -37,7 +37,6 @@ class AdminCmsControllerCore extends AdminController $this->table = 'cms'; $this->className = 'CMS'; $this->lang = true; - $this->addRowAction('view'); $this->addRowAction('edit'); $this->addRowAction('delete'); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); @@ -48,7 +47,7 @@ class AdminCmsControllerCore extends AdminController 'meta_title' => array('title' => $this->l('Title'), 'width' => '300', 'filter_key' => 'b!meta_title'), 'position' => array('title' => $this->l('Position'), 'width' => 40,'filter_key' => 'position', 'align' => 'center', 'position' => 'position'), 'active' => array('title' => $this->l('Displayed'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false) - ); + ); // The controller can't be call directly // In this case, AdminCmsContentController::getCurrentCMSCategory() is null @@ -69,14 +68,24 @@ class AdminCmsControllerCore extends AdminController public function renderForm() { - $this->display = 'edit'; + if (!$this->loadObject(true)) + return; + + if (Validate::isLoadedObject($this->object)) + $this->display = 'edit'; + else + $this->display = 'add'; + $this->toolbar_btn['save-and-preview'] = array( 'href' => '#', 'desc' => $this->l('Save and preview') ); + $this->toolbar_btn['save-and-stay'] = array( + 'short' => 'SaveAndStay', + 'href' => '#', + 'desc' => $this->l('Save and stay'), + ); $this->initToolbar(); - if (!$this->loadObject(true)) - return; $categories = CMSCategory::getCategories($this->context->language->id, false); $html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_cms_category'), 1); @@ -123,7 +132,7 @@ class AdminCmsControllerCore extends AdminController 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', 'size' => 70, - 'desc' => $this->l('To add "tags" click in the field, write something, then press "Enter"') + 'desc' => $this->l('To add "tags" click in the field, write something, and then press "Enter."') ), array( 'type' => 'text', @@ -165,7 +174,7 @@ class AdminCmsControllerCore extends AdminController ), ), 'submit' => array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save'), 'class' => 'button' ) ); @@ -180,9 +189,9 @@ class AdminCmsControllerCore extends AdminController } $this->tpl_form_vars = array( - 'active' => $this->object->active + 'active' => $this->object->active, + 'PS_ALLOW_ACCENTED_CHARS_URL', (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL') ); - return parent::renderForm(); } @@ -210,22 +219,29 @@ class AdminCmsControllerCore extends AdminController /* Close list table and submit button */ $this->displayListFooter($token); } - + /** - * Modifying initial getList method to display position feature (drag and drop) - */ + * Modifying initial getList method to display position feature (drag and drop) + */ public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) { + if (Tools::isSubmit($this->table.'Orderby') || Tools::isSubmit($this->table.'Orderway')) + $this->filter = true; + if ($order_by && $this->context->cookie->__get($this->table.'Orderby')) $order_by = $this->context->cookie->__get($this->table.'Orderby'); else $order_by = 'position'; + + if (is_null($order_way)) + $order_way = Tools::getValue($this->table.'Orderway', 'ASC'); parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop); } - + public function postProcess() { + if (Tools::isSubmit('viewcms') && ($id_cms = (int)Tools::getValue('id_cms')) && ($cms = new CMS($id_cms, $this->context->language->id)) && Validate::isLoadedObject($cms)) { $redir = $this->context->link->getCMSLink($cms); @@ -247,7 +263,7 @@ class AdminCmsControllerCore extends AdminController $cms = new CMS((int)Tools::getValue('id_cms')); $cms->cleanPositions($cms->id_cms_category); if (!$cms->delete()) - $this->errors[] = Tools::displayError('An error occurred while deleting object.') + $this->errors[] = Tools::displayError('An error occurred while deleting the object.') .' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; else Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=1&token='.Tools::getAdminTokenLite('AdminCmsContent')); @@ -265,71 +281,80 @@ class AdminCmsControllerCore extends AdminController { $cms->cleanPositions((int)Tools::getValue('id_cms_category')); $token = Tools::getAdminTokenLite('AdminCmsContent'); - Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.$token.'&id_category='.(int)Tools::getValue('id_cms_category')); + Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.$token.'&id_cms_category='.(int)Tools::getValue('id_cms_category')); } - $this->errors[] = Tools::displayError('An error occurred while deleting selection.'); + $this->errors[] = Tools::displayError('An error occurred while deleting this selection.'); } else $this->errors[] = Tools::displayError('You must select at least one element to delete.'); } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } elseif (Tools::isSubmit('submitAddcms') || Tools::isSubmit('submitAddcmsAndPreview')) { parent::validateRules(); - if (!count($this->errors)) - { - if (!$id_cms = (int)Tools::getValue('id_cms')) - { - $cms = new CMS(); - $this->copyFromPost($cms, 'cms'); - if (!$cms->add()) - $this->errors[] = Tools::displayError('An error occurred while creating object.') - .' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; - else - $this->updateAssoShop($cms->id); - } - else - { - $cms = new CMS($id_cms); - $this->copyFromPost($cms, 'cms'); - if (!$cms->update()) - $this->errors[] = Tools::displayError('An error occurred while updating object.') - .' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; - else - $this->updateAssoShop($cms->id); - - } - if (Tools::isSubmit('submitAddcmsAndPreview')) - { - $alias = $this->getFieldValue($cms, 'link_rewrite', $this->context->language->id); - $preview_url = $this->context->link->getCMSLink($cms, $alias, $this->context->language->id); - - if (!$cms->active) - { - $admin_dir = dirname($_SERVER['PHP_SELF']); - $admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1); - $preview_url .= $cms->active ? '' : '&adtoken='.Tools::getAdminTokenLite('AdminCmsContent').'&ad='.$admin_dir.'&id_employee='.(int)$this->context->employee->id; - } - Tools::redirectAdmin($preview_url); - } + if (count($this->errors)) + return false; + if (!$id_cms = (int)Tools::getValue('id_cms')) + { + $cms = new CMS(); + $this->copyFromPost($cms, 'cms'); + if (!$cms->add()) + $this->errors[] = Tools::displayError('An error occurred while creating an object.') + .' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; else - Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=4&token='.Tools::getAdminTokenLite('AdminCmsContent')); - } + $this->updateAssoShop($cms->id); + } + else + { + $cms = new CMS($id_cms); + $this->copyFromPost($cms, 'cms'); + if (!$cms->update()) + $this->errors[] = Tools::displayError('An error occurred while updating an object.') + .' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; + else + $this->updateAssoShop($cms->id); + } + if (Tools::isSubmit('submitAddcmsAndPreview')) + { + $alias = $this->getFieldValue($cms, 'link_rewrite', $this->context->language->id); + $preview_url = $this->context->link->getCMSLink($cms, $alias, $this->context->language->id); + + if (!$cms->active) + { + $admin_dir = dirname($_SERVER['PHP_SELF']); + $admin_dir = substr($admin_dir, strrpos($admin_dir, '/') + 1); + $params = http_build_query(array( + 'adtoken' => Tools::getAdminTokenLite('AdminCmsContent'), + 'ad' => $admin_dir, + 'id_employee' => (int)$this->context->employee->id) + ); + if (Configuration::get('PS_REWRITING_SETTINGS')) + $params = '?'.$params; + else + $params = '&'.$params; + $preview_url .= $cms->active ? '' : $params; + } + Tools::redirectAdmin($preview_url); + } + elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) + Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$cms->id.'&conf=4&update'.$this->table.'&token='.Tools::getAdminTokenLite('AdminCmsContent')); + else + Tools::redirectAdmin(self::$currentIndex.'&id_cms_category='.$cms->id_cms_category.'&conf=4&token='.Tools::getAdminTokenLite('AdminCmsContent')); } - elseif (Tools::getValue('position')) + elseif (Tools::isSubmit('way') && Tools::isSubmit('id_cms') && (Tools::isSubmit('position'))) { if ($this->tabAccess['edit'] !== '1') - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); elseif (!Validate::isLoadedObject($object = $this->loadObject())) - $this->errors[] = Tools::displayError('An error occurred while updating status for object.') + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.') .' '.$this->table.' '.Tools::displayError('(cannot load object)'); elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) $this->errors[] = Tools::displayError('Failed to update the position.'); else - Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=4'.(($id_category = (int)Tools::getValue('id_cms_category')) ? ('&id_cms_category='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminCmsContent')); + Tools::redirectAdmin(self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&conf=4&id_cms_category='.(int)$object->id_cms_category.'&token='.Tools::getAdminTokenLite('AdminCmsContent')); } /* Change object statuts (active, inactive) */ elseif (Tools::isSubmit('statuscms') && Tools::isSubmit($this->identifier)) @@ -339,16 +364,35 @@ class AdminCmsControllerCore extends AdminController if (Validate::isLoadedObject($object = $this->loadObject())) { if ($object->toggleStatus()) - Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((int)Tools::getValue('id_cms_category') ? '&id_cms_category='.(int)Tools::getValue('id_cms_category') : '').'&token='.Tools::getValue('token')); + Tools::redirectAdmin(self::$currentIndex.'&conf=5&id_cms_category='.(int)$object->id_cms_category.'&token='.Tools::getValue('token')); else - $this->errors[] = Tools::displayError('An error occurred while updating status.'); + $this->errors[] = Tools::displayError('An error occurred while updating the status.'); } else - $this->errors[] = Tools::displayError('An error occurred while updating status for object.') + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.') .' '.$this->table.' '.Tools::displayError('(cannot load object)'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); + } + /* Delete multiple CMS content */ + elseif (Tools::isSubmit('submitBulkdeletecms')) + { + if ($this->tabAccess['delete'] === '1') + { + $this->action = 'bulkdelete'; + $this->boxes = Tools::getValue($this->table.'Box'); + if (is_array($this->boxes) && array_key_exists(0, $this->boxes)) + { + $firstCms = new CMS((int)$this->boxes[0]); + $id_cms_category = (int)$firstCms->id_cms_category; + if (!$res = parent::postProcess(true)) + return $res; + Tools::redirectAdmin(self::$currentIndex.'&conf=2&token='.Tools::getAdminTokenLite('AdminCmsContent').'&id_cms_category='.$id_cms_category); + } + } + else + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } else parent::postProcess(true); diff --git a/controllers/admin/AdminContactsController.php b/controllers/admin/AdminContactsController.php index 4a3b600b5..5cc4c184c 100644 --- a/controllers/admin/AdminContactsController.php +++ b/controllers/admin/AdminContactsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -38,7 +38,7 @@ class AdminContactsControllerCore extends AdminController $this->fields_list = array( 'id_contact' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'name' => array('title' => $this->l('Title'), 'width' => 130), - 'email' => array('title' => $this->l('E-mail address'), 'width' => 130), + 'email' => array('title' => $this->l('Email address'), 'width' => 130), 'description' => array('title' => $this->l('Description'), 'width' => 150), ); @@ -55,20 +55,20 @@ class AdminContactsControllerCore extends AdminController 'input' => array( array( 'type' => 'text', - 'label' => $this->l('Title:'), + 'label' => $this->l('Title'), 'name' => 'name', 'size' => 33, 'required' => true, 'lang' => true, - 'desc' => $this->l('Contact name (e.g. Technical Support)'), + 'desc' => $this->l('Contact name (e.g. Customer Support)'), ), array( 'type' => 'text', - 'label' => $this->l('E-mail address'), + 'label' => $this->l('Email address'), 'name' => 'email', 'size' => 33, 'required' => false, - 'desc' => $this->l('E-mails will be sent to this address'), + 'desc' => $this->l('Emails will be sent to this address'), ), array( 'type' => 'radio', @@ -77,7 +77,7 @@ class AdminContactsControllerCore extends AdminController 'required' => false, 'class' => 't', 'is_bool' => true, - 'desc' => $this->l('If enabled, all messages will be saved in the "Customer Service" page under the "Customer" menu'), + 'desc' => $this->l('If enabled, all messages will be saved in the "Customer Service" page under the "Customer" menu.'), 'values' => array( array( 'id' => 'customer_service_on', @@ -99,11 +99,11 @@ class AdminContactsControllerCore extends AdminController 'lang' => true, 'cols' => 36, 'rows' => 5, - 'desc' => $this->l('Additional information about this contact'), + 'desc' => $this->l('Further information regarding this contact'), ), ), 'submit' => array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ) ); diff --git a/controllers/admin/AdminCountriesController.php b/controllers/admin/AdminCountriesController.php index 42f76443c..fbf5f84df 100644 --- a/controllers/admin/AdminCountriesController.php +++ b/controllers/admin/AdminCountriesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -145,7 +145,8 @@ class AdminCountriesControllerCore extends AdminController array('address2'), array('postcode', 'city'), array('Country:name'), - array('phone')); + array('phone'), + array('phone_mobile')); foreach ($default_layout_tab as $line) $default_layout .= implode(' ', $line)."\r\n"; @@ -174,7 +175,7 @@ class AdminCountriesControllerCore extends AdminController 'maxlength' => 3, 'class' => 'uppercase', 'required' => true, - 'desc' => $this->l('2- or 3-letter ISO code (e.g. US for United States)').'. + 'desc' => $this->l('Two -- or three -- letter ISO code (e.g. U.S. for United States)').'. '. $this->l('Official list here').' .' @@ -212,11 +213,11 @@ class AdminCountriesControllerCore extends AdminController 'id' => 'id_zone', 'name' => 'name' ), - 'desc' => $this->l('Geographical zone where country is located') + 'desc' => $this->l('Geographical region') ), array( 'type' => 'radio', - 'label' => $this->l('Need zip code:'), + 'label' => $this->l('Need zip/postal code:'), 'name' => 'need_zip_code', 'required' => false, 'class' => 't', @@ -236,11 +237,11 @@ class AdminCountriesControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('Zip code format:'), + 'label' => $this->l('Zip/post code format:'), 'name' => 'zip_code_format', 'class' => 'uppercase', 'required' => true, - 'desc' => $this->l('Zip Code format (L for a letter, N for a number and C for the Iso code), e.g. NNNNN for the United States. No verification if undefined') + 'desc' => $this->l('Zip Code format (L for a letter, N for a number and C for the ISO code). For example, NNNNN for the United States. No verification if undefined.') ), array( 'type' => 'address_layout', @@ -251,6 +252,26 @@ class AdminCountriesControllerCore extends AdminController 'encoding_default_layout' => urlencode($default_layout), 'display_valid_fields' => $this->displayValidFields() ), + array( + 'type' => 'radio', + 'label' => $this->l('Address Standardization:'), + 'name' => 'standardization', + 'required' => false, + 'class' => 't', + 'is_bool' => true, + 'values' => array( + array( + 'id' => 'standardization_on', + 'value' => 1, + 'label' => $this->l('Enabled') + ), + array( + 'id' => 'standardization_off', + 'value' => 0, + 'label' => $this->l('Disabled') + ) + ), + ), array( 'type' => 'radio', 'label' => $this->l('Active:'), @@ -270,11 +291,11 @@ class AdminCountriesControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Display this country to your customer (the country will always be displayed in the back office)') - ), + 'desc' => $this->l('Display this country to your customers (the selected country will always be displayed in the Back Office)') + ), array( 'type' => 'radio', - 'label' => $this->l('Contains states:'), + 'label' => $this->l('Contains following states:'), 'name' => 'contains_states', 'required' => false, 'class' => 't', @@ -293,7 +314,7 @@ class AdminCountriesControllerCore extends AdminController ), array( 'type' => 'radio', - 'label' => $this->l('Need Tax identification number?'), + 'label' => $this->l('Do you need a tax identification number?'), 'name' => 'need_identification_number', 'required' => false, 'class' => 't', @@ -330,6 +351,7 @@ class AdminCountriesControllerCore extends AdminController ) ) ) + ); if (Shop::isFeatureActive()) @@ -342,10 +364,13 @@ class AdminCountriesControllerCore extends AdminController } $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); - + + if ($this->object->iso_code == 'US') + $this->object->standardization = Configuration::get('PS_TAASC'); + return parent::renderForm(); } @@ -354,14 +379,17 @@ class AdminCountriesControllerCore extends AdminController if (!Tools::getValue('id_'.$this->table)) { if (Validate::isLanguageIsoCode(Tools::getValue('iso_code')) && Country::getByIso(Tools::getValue('iso_code'))) - $this->errors[] = Tools::displayError('This ISO code already exists, you cannot create two country with the same ISO code'); + $this->errors[] = Tools::displayError('This ISO code already exists.You cannot create two countries with the same ISO code.'); } else if (Validate::isLanguageIsoCode(Tools::getValue('iso_code'))) { $id_country = Country::getByIso(Tools::getValue('iso_code')); if (!is_null($id_country) && $id_country != Tools::getValue('id_'.$this->table)) - $this->errors[] = Tools::displayError('This ISO code already exists, you cannot create two country with the same ISO code'); + $this->errors[] = Tools::displayError('This ISO code already exists.You cannot create two countries with the same ISO code.'); } + + if (Tools::isSubmit('standardization')) + Configuration::updateValue('PS_TAASC', (bool)Tools::getValue('standardization', false)); if (!count($this->errors)) $res = parent::postProcess(); @@ -396,7 +424,7 @@ class AdminCountriesControllerCore extends AdminController } if (!$save_status) - $this->errors[] = Tools::displayError('Invalid address layout'.Db::getInstance()->getMsgError()); + $this->errors[] = Tools::displayError('Invalid address layout '.Db::getInstance()->getMsgError()); } unset($tmp_addr_format); } @@ -406,10 +434,10 @@ class AdminCountriesControllerCore extends AdminController public function processStatus() { - if (Validate::isLoadedObject($object = $this->loadObject())) - Country::addModuleRestrictions(array(), array(array('id_country' => $object->id)), array()); - parent::processStatus(); + if (Validate::isLoadedObject($object = $this->loadObject()) && $object->active == 1) + return Country::addModuleRestrictions(array(), array(array('id_country' => $object->id)), array()); + return false; } public function processBulkStatusSelection($way) @@ -442,7 +470,7 @@ class AdminCountriesControllerCore extends AdminController $html .= '
      • '.$class_name.''; foreach (AddressFormat::getValidateFields($class_name) as $name) - $fields[] = ' + $fields[] = ' '.$name.''; $html .= '
        diff --git a/controllers/admin/AdminCurrenciesController.php b/controllers/admin/AdminCurrenciesController.php index 12e92aa2f..bf8690b64 100644 --- a/controllers/admin/AdminCurrenciesController.php +++ b/controllers/admin/AdminCurrenciesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -31,7 +31,6 @@ class AdminCurrenciesControllerCore extends AdminController $this->table = 'currency'; $this->className = 'Currency'; $this->lang = false; - $this->multishop_context = Shop::CONTEXT_ALL; $this->fields_list = array( 'id_currency' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), @@ -39,7 +38,7 @@ class AdminCurrenciesControllerCore extends AdminController 'iso_code' => array('title' => $this->l('ISO code'), 'align' => 'center', 'width' => 80), 'iso_code_num' => array('title' => $this->l('ISO code number'), 'align' => 'center', 'width' => 120), 'sign' => array('title' => $this->l('Symbol'), 'width' => 20, 'align' => 'center', 'orderby' => false, 'search' => false), - 'conversion_rate' => array('title' => $this->l('Conversion rate'), 'type' => 'float', 'align' => 'center', 'width' => 130, 'search' => false), + 'conversion_rate' => array('title' => $this->l('Exchange rate'), 'type' => 'float', 'align' => 'center', 'width' => 130, 'search' => false, 'filter_key' => 'currency_shop!conversion_rate'), 'active' => array('title' => $this->l('Enabled'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false), ); @@ -53,7 +52,7 @@ class AdminCurrenciesControllerCore extends AdminController 'change' => array( 'title' => $this->l('Currency rates'), 'image' => '../img/admin/exchangesrate.gif', - 'description' => $this->l('Use PrestaShop\'s webservice to update your currency exchange rates. Please use caution, rates are provided as-is.'), + 'description' => $this->l('Use PrestaShop\'s webservice to update your currency exchange rates. Please use caution, however, rates are provided as-is.'), 'submit' => array( 'title' => $this->l('Update currency rates'), 'class' => 'button', @@ -63,12 +62,16 @@ class AdminCurrenciesControllerCore extends AdminController 'cron' => array( 'title' => $this->l('Automatically update currency rates'), 'image' => '../img/admin/tab-tools.gif', - 'info' => $this->l('Use PrestaShop\'s webservice to update your currency exchange rates. Please use caution, rates are provided as-is. Place this URL in crontab or access it manually daily').':
        + 'info' => $this->l('Use PrestaShop\'s webservice to update your currency exchange rates. Please use caution, rates are provided as-is. You can place this URL in the crontab,or access it manually.').':
        '.Tools::getShopDomain(true, true).__PS_BASE_URI__.basename(_PS_ADMIN_DIR_).'/cron_currency_rates.php?secure_key='.md5(_COOKIE_KEY_.Configuration::get('PS_SHOP_NAME')).'

        ', ) ); parent::__construct(); + + $this->_select .= 'currency_shop.conversion_rate conversion_rate'; + $this->_join .= Shop::addSqlAssociation('currency', 'a'); + $this->_group .= 'GROUP BY id_currency'; } public function renderList() @@ -96,7 +99,7 @@ class AdminCurrenciesControllerCore extends AdminController 'size' => 30, 'maxlength' => 32, 'required' => true, - 'hint' => $this->l('Only letters and the minus character are allowed') + 'hint' => $this->l('Only letters and the minus character are allowed.') ), array( 'type' => 'text', @@ -127,16 +130,16 @@ class AdminCurrenciesControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('Conversion rate:'), + 'label' => $this->l('Exchange rate:'), 'name' => 'conversion_rate', 'size' => 3, 'maxlength' => 11, 'required' => true, - 'desc' => $this->l('Conversion rate from one unit of your shop\'s default currency (for example, 1€) to this currency. For example, if the default currency is euros and this currency is dollars, type \'1.20\'').' 1€ = $1.20', + 'desc' => $this->l('Exchange rates are calculated from one unit of your shop\'s default currency. For example, if the default currency is euros and your chosen currency is dollars, type "1.20"').' 1€ = $1.20', ), array( 'type' => 'select', - 'label' => $this->l('Formatting:'), + 'label' => $this->l('Currency format:'), 'name' => 'format', 'size' => 3, 'maxlength' => 11, @@ -229,30 +232,69 @@ class AdminCurrenciesControllerCore extends AdminController } $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); return parent::renderForm(); } + protected function checkDeletion($object) + { + if (Validate::isLoadedObject($object)) + { + if ($object->id == Configuration::get('PS_CURRENCY_DEFAULT')) + $this->errors[] = $this->l('You cannot delete the default currency'); + else + return true; + } + else + $this->errors[] = Tools::displayError('An error occurred while deleting the object.').' + '.$this->table.' '.Tools::displayError('(cannot load object)'); + + return false; + } + + protected function checkDisableStatus($object) + { + if (Validate::isLoadedObject($object)) + { + if ($object->active && $object->id == Configuration::get('PS_CURRENCY_DEFAULT')) + $this->errors[] = $this->l('You cannot disable the default currency'); + else + return true; + } + else + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' + '.$this->table.' '.Tools::displayError('(cannot load object)'); + + return false; + } + /** * @see AdminController::processDelete() */ public function processDelete() { - if (Validate::isLoadedObject($object = $this->loadObject())) + $object = $this->loadObject(); + if (!$this->checkDeletion($object)) + return false; + return parent::processDelete(); + } + + protected function processBulkDelete() + { + if (is_array($this->boxes) && !empty($this->boxes)) { - if ($object->id == Configuration::get('PS_CURRENCY_DEFAULT')) - $this->errors[] = $this->l('You cannot delete the default currency'); - else if ($object->delete()) - Tools::redirectAdmin(self::$currentIndex.'&conf=1'.'&token='.$this->token); - else - $this->errors[] = Tools::displayError('An error occurred during deletion.'); + foreach ($this->boxes as $id_currency) + { + $object = new Currency((int)$id_currency); + if (!$this->checkDeletion($object)) + return false; + } } - else - $this->errors[] = Tools::displayError('An error occurred while deleting object.').' - '.$this->table.' '.Tools::displayError('(cannot load object)'); + + return parent::processBulkDelete(); } /** @@ -260,19 +302,25 @@ class AdminCurrenciesControllerCore extends AdminController */ public function processStatus() { - if (Validate::isLoadedObject($object = $this->loadObject())) + $object = $this->loadObject(); + if (!$this->checkDisableStatus($object)) + return false; + + return parent::processStatus(); + } + + protected function processBulkDisableSelection() + { + if (is_array($this->boxes) && !empty($this->boxes)) { - if ($object->active && $object->id == Configuration::get('PS_CURRENCY_DEFAULT')) - $this->errors[] = $this->l('You cannot disable the default currency'); - else if ($object->toggleStatus()) - Tools::redirectAdmin(self::$currentIndex.'&conf=5'.((($id_category = - (int)Tools::getValue('id_category')) && Tools::getValue('id_product')) ? '&id_category='.$id_category : '').'&token='.$this->token); - else - $this->errors[] = Tools::displayError('An error occurred while updating status.'); + foreach ($this->boxes as $id_currency) + { + $object = new Currency((int)$id_currency); + if (!$this->checkDisableStatus($object)) + return false; + } } - else - $this->errors[] = Tools::displayError('An error occurred while updating status for object.').' - '.$this->table.' '.Tools::displayError('(cannot load object)'); + return parent::processBulkDisableSelection(); } /** @@ -294,10 +342,10 @@ class AdminCurrenciesControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') $this->action = 'exchangeRates'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } if (Tools::isSubmit('submitAddcurrency') && !Tools::getValue('id_currency') && Currency::exists(Tools::getValue('iso_code'), Tools::getValue('iso_code_num'))) - $this->errors[] = Tools::displayError('This currency already exist.'); + $this->errors[] = Tools::displayError('This currency already exists.'); parent::initProcess(); } } diff --git a/controllers/admin/AdminCustomerPreferencesController.php b/controllers/admin/AdminCustomerPreferencesController.php index a7188b27d..497f69314 100644 --- a/controllers/admin/AdminCustomerPreferencesController.php +++ b/controllers/admin/AdminCustomerPreferencesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -51,7 +51,7 @@ class AdminCustomerPreferencesControllerCore extends AdminController 'fields' => array( 'PS_REGISTRATION_PROCESS_TYPE' => array( 'title' => $this->l('Registration process type'), - 'desc' => $this->l('The "Only account creation" registration option allows the customer to register faster, and create his address later.'), + 'desc' => $this->l('The "Only account creation" registration option allows the customer to register faster, and create his/her address later.'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', @@ -67,14 +67,22 @@ class AdminCustomerPreferencesControllerCore extends AdminController ), 'PS_CART_FOLLOWING' => array( 'title' => $this->l('Cart re-display at login'), - 'desc' => $this->l('After customer logs in, recall and display contents of his/her last shopping cart'), + 'desc' => $this->l('After customer logs in, you can recall and display the content of his/her last shopping cart.'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'type' => 'bool' + ), + 'PS_CUSTOMER_CREATION_EMAIL' => array( + 'title' => $this->l('Send an email after registration'), + 'desc' => $this->l('Send an email with summary account (email, password) after registration.'), + 'validation' => 'isUnsignedInt', 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' ), 'PS_PASSWD_TIME_FRONT' => array( 'title' => $this->l('Regenerate password'), - 'desc' => $this->l('Security minimum time to wait to regenerate the password'), + 'desc' => $this->l('Minimum time required to regenerate a password.'), 'validation' => 'isUnsignedInt', 'cast' => 'intval', 'size' => 5, @@ -83,7 +91,7 @@ class AdminCustomerPreferencesControllerCore extends AdminController ), 'PS_B2B_ENABLE' => array( 'title' => $this->l('Enable B2B mode'), - 'desc' => $this->l('Activate or deactivate B2B mode. When this option is enabled, some B2B features are available.'), + 'desc' => $this->l('Activate or deactivate B2B mode. When this option is enabled, B2B features will be made available.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' diff --git a/controllers/admin/AdminCustomerThreadsController.php b/controllers/admin/AdminCustomerThreadsController.php index 3431f6944..3714a0a17 100644 --- a/controllers/admin/AdminCustomerThreadsController.php +++ b/controllers/admin/AdminCustomerThreadsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -35,6 +35,7 @@ class AdminCustomerThreadsControllerCore extends AdminController $contact_array = array(); $contacts = Contact::getContacts($this->context->language->id); + foreach ($contacts as $contact) $contact_array[$contact['id_contact']] = $contact['name']; @@ -66,7 +67,7 @@ class AdminCustomerThreadsControllerCore extends AdminController 'tmpTableFilter' => true, ), 'email' => array( - 'title' => $this->l('E-mail'), + 'title' => $this->l('Email'), 'width' => 100, 'filter_key' => 'a!email', ), @@ -130,13 +131,13 @@ class AdminCustomerThreadsControllerCore extends AdminController 'title' => $this->l('Contact options'), 'fields' => array( 'PS_CUSTOMER_SERVICE_FILE_UPLOAD' => array( - 'title' => $this->l('Allow file upload'), - 'desc' => $this->l('Allow customers to upload file using contact page'), + 'title' => $this->l('Allow file uploading'), + 'desc' => $this->l('Allow customers to upload files using the contact page.'), 'type' => 'bool' ), 'PS_CUSTOMER_SERVICE_SIGNATURE' => array( 'title' => $this->l('Default message'), - 'desc' => $this->l('Please fill the message that appears by default when you answer a thread on the customer service page'), + 'desc' => $this->l('Please fill out the message fields that appear by default when you answer a thread on the customer service page.'), 'type' => 'textareaLang', 'lang' => true, 'rows' => 10, @@ -167,44 +168,49 @@ class AdminCustomerThreadsControllerCore extends AdminController ), 'PS_SAV_IMAP_PWD' => array( 'title' => $this->l('IMAP password'), - 'desc' => $this->l('Password to use to connect IMAP server'), + 'desc' => $this->l('Password used to connect IMAP server'), 'type' => 'text', 'size' => 40, ), 'PS_SAV_IMAP_DELETE_MSG' => array( 'title' => $this->l('Delete messages'), - 'desc' => $this->l('Delete messages after sync. If you do not active this option, the sync will be longer'), + 'desc' => $this->l('Delete messages after sync. If you do not active this option, the sync will take more time.'), + 'type' => 'bool', + ), + 'PS_SAV_IMAP_CREATE_THREADS' => array( + 'title' => $this->l('Create new threads'), + 'desc' => $this->l('Create new threads for unrecognized emails'), 'type' => 'bool', ), 'PS_SAV_IMAP_OPT_NORSH' => array( 'title' => $this->l('IMAP options').' (/norsh)', 'type' => 'bool', - 'desc' => $this->l('Do not use RSH or SSH to establish a preauthenticated IMAP session'), + 'desc' => $this->l('Do not use RSH or SSH to establish a preauthenticated IMAP sessions.'), ), 'PS_SAV_IMAP_OPT_SSL' => array( 'title' => $this->l('IMAP options').' (/ssl)', 'type' => 'bool', - 'desc' => $this->l('Use the Secure Socket Layer to encrypt the session'), + 'desc' => $this->l('Use the Secure Socket Layer to encrypt the session.'), ), 'PS_SAV_IMAP_OPT_VALIDATE-CERT' => array( 'title' => $this->l('IMAP options').' (/validate-cert)', 'type' => 'bool', - 'desc' => $this->l('Validate certificates from TLS/SSL server'), + 'desc' => $this->l('Validate certificates from the TLS/SSL server'), ), 'PS_SAV_IMAP_OPT_NOVALIDATE-CERT' => array( 'title' => $this->l('IMAP options').' (/novalidate-cert)', 'type' => 'bool', - 'desc' => $this->l('Do not validate certificates from TLS/SSL server, needed if server uses self-signed certificates'), + 'desc' => $this->l('Do not validate certificates from the TLS/SSL server. This is only needed if a server uses self-signed certificates'), ), 'PS_SAV_IMAP_OPT_TLS' => array( 'title' => $this->l('IMAP options').' (/tls)', 'type' => 'bool', - 'desc' => $this->l('Force use of start-TLS to encrypt the session, and reject connection to servers that do not support it'), + 'desc' => $this->l('Force use of start-TLS to encrypt the session, and reject connection to servers that do not support it.'), ), 'PS_SAV_IMAP_OPT_NOTLS' => array( 'title' => $this->l('IMAP options').' (/notls)', 'type' => 'bool', - 'desc' => $this->l('Do not use start-TLS to encrypt the session, even with servers that support it'), + 'desc' => $this->l('Do not use start-TLS to encrypt the session, even with servers that support it.'), ), ), 'submit' => array('title' => $this->l('Save'), 'class' => 'button'), @@ -250,8 +256,8 @@ class AdminCustomerThreadsControllerCore extends AdminController $params = array( $this->l('Total threads') => $all = CustomerThread::getTotalCustomerThreads(), $this->l('Threads pending') => $pending = CustomerThread::getTotalCustomerThreads('status LIKE "%pending%"'), - $this->l('Total customer messages') => CustomerMessage::getTotalCustomerMessages('id_employee = 0'), - $this->l('Total employee messages') => CustomerMessage::getTotalCustomerMessages('id_employee != 0'), + $this->l('Total number of customer messages') => CustomerMessage::getTotalCustomerMessages('id_employee = 0'), + $this->l('Total number of employee messages') => CustomerMessage::getTotalCustomerMessages('id_employee != 0'), $this->l('Unread threads') => $unread = CustomerThread::getTotalCustomerThreads('status = "open"'), $this->l('Closed threads') => $all - ($unread + $pending) ); @@ -342,7 +348,7 @@ class AdminCustomerThreadsControllerCore extends AdminController $cm->add(); } } - else if ($email && Validate::isEmail($email)) + elseif ($email && Validate::isEmail($email)) { $params = array( '{messages}' => Tools::nl2br(stripslashes($output)), @@ -362,19 +368,23 @@ class AdminCustomerThreadsControllerCore extends AdminController } } else - $this->errors[] = '
        '.Tools::displayError('E-mail invalid.').'
        '; + $this->errors[] = '
        '.Tools::displayError('The email address is invalid.').'
        '; } if (Tools::isSubmit('submitReply')) { $ct = new CustomerThread($id_customer_thread); + + ShopUrl::cacheMainDomainForShop((int)$ct->id_shop); + $cm = new CustomerMessage(); $cm->id_employee = (int)$this->context->employee->id; $cm->id_customer_thread = $ct->id; - $cm->message = Tools::nl2br(Tools::htmlentitiesutf8(Tools::getValue('reply_message'))); + + $cm->message = Tools::htmlentitiesutf8(Tools::getValue('reply_message')); $cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']); if (isset($_FILES) && !empty($_FILES['joinFile']['name']) && $_FILES['joinFile']['error'] != 0) - $this->errors[] = Tools::displayError('An error occurred with the file upload.'); - else if ($cm->add()) + $this->errors[] = Tools::displayError('An error occurred during the file upload process.'); + elseif ($cm->add()) { $file_attachment = null; if (!empty($_FILES['joinFile']['name'])) @@ -391,11 +401,22 @@ class AdminCustomerThreadsControllerCore extends AdminController ), ); //#ct == id_customer_thread #tc == token of thread <== used in the synchronization imap + $contact = new Contact((int)$ct->id_contact, (int)$ct->id_lang); + if (Validate::isLoadedObject($contact)) + { + $from_name = $contact->name[(int)$ct->id_lang]; + $from_email = $contact->email; + } + else + { + $from_name = null; + $from_email = null; + } if (Mail::Send( (int)$ct->id_lang, 'reply_msg', sprintf(Mail::l('An answer to your message is available #ct%1$s #tc%2$s', $ct->id_lang), $ct->id, $ct->token), - $params, Tools::getValue('msg_email'), null, null, null, $file_attachment, null, + $params, Tools::getValue('msg_email'), null, $from_email, $from_name, $file_attachment, null, _PS_MAIL_DIR_, true)) { $ct->status = 'closed'; @@ -406,7 +427,7 @@ class AdminCustomerThreadsControllerCore extends AdminController ); } else - $this->errors[] = Tools::displayError('An error occurred, your message was not sent. Please contact your system administrator.'); + $this->errors[] = Tools::displayError('An error occurred. Your message was not sent. Please contact your system administrator.'); } } @@ -440,7 +461,7 @@ class AdminCustomerThreadsControllerCore extends AdminController $extension = false; foreach ($extensions as $key => $val) - if (substr($filename, -4) == $key || substr($filename, -5) == $key) + if (substr(Tools::strtolower($filename), -4) == $key || substr(Tools::strtolower($filename), -5) == $key) { $extension = $val; break; @@ -477,40 +498,40 @@ class AdminCustomerThreadsControllerCore extends AdminController if ($next_thread) $actions['next_thread'] = array( 'href' => self::$currentIndex.'&id_customer_thread='.(int)$next_thread.'&viewcustomer_thread&token='.$this->token, - 'name' => $this->l('Reply to the next unanswered message in this category') + 'name' => $this->l('Reply to the next unanswered message in this category.') ); else $actions['next_thread'] = array( 'href' => false, - 'name' => $this->l('All other messages in this category have been answered') + 'name' => $this->l('All other messages in this category have been answered.') ); if ($thread->status != 'closed') $actions['closed'] = array( 'href' => self::$currentIndex.'&viewcustomer_thread&setstatus=2&id_customer_thread='.(int)Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token, - 'name' => $this->l('Mark this message as handled') + 'name' => $this->l('Mark this message as handled.') ); if ($thread->status != 'pending1') $actions['pending1'] = array( 'href' => self::$currentIndex.'&viewcustomer_thread&setstatus=3&id_customer_thread='.(int)Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token, - 'name' => $this->l('Mark this message as "pending 1" (will be answered later)') + 'name' => $this->l('Mark this message as "pending 1" (will be answered later).') ); else $actions['pending1'] = array( 'href' => self::$currentIndex.'&viewcustomer_thread&setstatus=1&id_customer_thread='.(int)Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token, - 'name' => $this->l('Disable pending status') + 'name' => $this->l('Disable pending status.') ); if ($thread->status != 'pending2') $actions['pending2'] = array( 'href' => self::$currentIndex.'&viewcustomer_thread&setstatus=4&id_customer_thread='.(int)Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token, - 'name' => $this->l('Mark this message as "pending 2" (will be answered later)') + 'name' => $this->l('Mark this message as "pending 2" (will be answered later).') ); else $actions['pending2'] = array( 'href' => self::$currentIndex.'&viewcustomer_thread&setstatus=1&id_customer_thread='.(int)Tools::getValue('id_customer_thread').'&viewmsg&token='.$this->token, - 'name' => $this->l('Disable pending status') + 'name' => $this->l('Disable pending status.') ); if ($thread->id_customer) @@ -528,7 +549,7 @@ class AdminCustomerThreadsControllerCore extends AdminController $orders_ok[] = $order; $total_ok += $order['total_paid_real']; } - $orders[$key]['date_add'] = Tools::displayDate($order['date_add'], $this->context->language->id); + $orders[$key]['date_add'] = Tools::displayDate($order['date_add']); $orders[$key]['total_paid_real'] = Tools::displayPrice($order['total_paid_real'], new Currency((int)$order['id_currency'])); } } @@ -536,7 +557,7 @@ class AdminCustomerThreadsControllerCore extends AdminController $products = $customer->getBoughtProducts(); if ($products && count($products)) foreach ($products as $key => $product) - $products[$key]['date_add'] = Tools::displayDate($product['date_add'], $this->context->language->id, true); + $products[$key]['date_add'] = Tools::displayDate($product['date_add'], null, true); } foreach ($messages as $key => $message) @@ -565,14 +586,16 @@ class AdminCustomerThreadsControllerCore extends AdminController $tpl = $this->createTemplate('message.tpl'); $contacts = Contact::getContacts($this->context->language->id); - + foreach ($contacts as $contact) + $contact_array[$contact['id_contact']] = array('id_contact' => $contact['id_contact'], 'name' => $contact['name']); + $contacts = $contact_array; + if (!$email) { if (!empty($message['id_product']) && empty($message['employee_name'])) $id_order_product = Order::getIdOrderProduct((int)$message['id_customer'], (int)$message['id_product']); } - - $message['date_add'] = Tools::displayDate($message['date_add'], $this->context->language->id, true); + $message['date_add'] = Tools::displayDate($message['date_add'], null, true); $message['user_agent'] = strip_tags($message['user_agent']); $message['message'] = preg_replace( '/(https?:\/\/[a-z0-9#%&_=\(\)\.\? \+\-@\/]{6,1000})([\s\n<])/Uui', @@ -638,15 +661,148 @@ class AdminCustomerThreadsControllerCore extends AdminController public function updateOptionPsSavImapOpt($value) { + if ($this->tabAccess['edit'] != '1') + throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.')); + if (!$this->errors && $value) Configuration::updateValue('PS_SAV_IMAP_OPT', implode('', $value)); } public function ajaxProcessMarkAsRead() { + if ($this->tabAccess['edit'] != '1') + throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.')); + $id_thread = Tools::getValue('id_thread'); $messages = CustomerThread::getMessageCustomerThreads($id_thread); if (count($messages)) Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'customer_message set `read` = 1'); } -} \ No newline at end of file + + public function ajaxProcessSyncImap() + { + if ($this->tabAccess['edit'] != '1') + throw new PrestaShopException(Tools::displayError('You do not have permission to edit this.')); + + if (Tools::isSubmit('syncImapMail')) + { + if (!($url = Configuration::get('PS_SAV_IMAP_URL')) + || !($port = Configuration::get('PS_SAV_IMAP_PORT')) + || !($user = Configuration::get('PS_SAV_IMAP_USER')) + || !($password = Configuration::get('PS_SAV_IMAP_PWD'))) + die('{"hasError" : true, "errors" : ["Configuration is not correct"]}'); + + $conf = Configuration::getMultiple(array( + 'PS_SAV_IMAP_OPT_NORSH', 'PS_SAV_IMAP_OPT_SSL', + 'PS_SAV_IMAP_OPT_VALIDATE-CERT', 'PS_SAV_IMAP_OPT_NOVALIDATE-CERT', + 'PS_SAV_IMAP_OPT_TLS', 'PS_SAV_IMAP_OPT_NOTLS')); + + $conf_str = ''; + if ($conf['PS_SAV_IMAP_OPT_NORSH']) + $conf_str .= '/norsh'; + if ($conf['PS_SAV_IMAP_OPT_SSL']) + $conf_str .= '/ssl'; + if ($conf['PS_SAV_IMAP_OPT_VALIDATE-CERT']) + $conf_str .= '/validate-cert'; + if ($conf['PS_SAV_IMAP_OPT_NOVALIDATE-CERT']) + $conf_str .= '/novalidate-cert'; + if ($conf['PS_SAV_IMAP_OPT_TLS']) + $conf_str .= '/tls'; + if ($conf['PS_SAV_IMAP_OPT_NOTLS']) + $conf_str .= '/notls'; + + if (!function_exists('imap_open')) + die('{"hasError" : true, "errors" : ["imap is not installed on this server"]}'); + + $mbox = @imap_open('{'.$url.':'.$port.$conf_str.'}', $user, $password); + + //checks if there is no error when connecting imap server + $errors = imap_errors(); + $str_errors = ''; + $str_error_delete = ''; + if (sizeof($errors) && is_array($errors)) + { + $str_errors = ''; + foreach($errors as $error) + $str_errors .= '"'.$error.'",'; + $str_errors = rtrim($str_errors, ',').''; + } + //checks if imap connexion is active + if (!$mbox) + die('{"hasError" : true, "errors" : ["Cannot connect to the mailbox:.
        '.addslashes($str_errors).'"]}'); + + //Returns information about the current mailbox. Returns FALSE on failure. + $check = imap_check($mbox); + if (!$check) + die('{"hasError" : true, "errors" : ["Fail to get information about the current mailbox"]}'); + + if ($check->Nmsgs == 0) + die('{"hasError" : true, "errors" : ["NO message to sync"]}'); + + $result = imap_fetch_overview($mbox,"1:{$check->Nmsgs}",0); + foreach ($result as $overview) + { + //check if message exist in database + if (isset($overview->subject)) + $subject = $overview->subject; + else + $subject = ''; + //Creating an md5 to check if message has been allready processed + $md5 = md5($overview->date.$overview->from.$subject.$overview->msgno); + $exist = Db::getInstance()->getValue( + 'SELECT `md5_header` + FROM `'._DB_PREFIX_.'customer_message_sync_imap` + WHERE `md5_header` = \''.pSQL($md5).'\''); + if ($exist) + { + if (Configuration::get('PS_SAV_IMAP_DELETE_MSG')) + if (!imap_delete($mbox, $overview->msgno)) + $str_error_delete = ', "Fail to delete message"'; + } + else + { + //check if subject has id_order + preg_match('/\#ct([0-9]*)/', $subject, $matches1); + preg_match('/\#tc([0-9-a-z-A-Z]*)/', $subject, $matches2); + $new_ct = (Configuration::get('PS_SAV_IMAP_CREATE_THREADS') && !isset($matches1[1]) && !isset($matches2[1]) && !preg_match('/[no_sync]/', $subject)); + if (isset($matches1[1]) && isset($matches2[1]) || $new_ct) + { + if ($new_ct) + { + if (!preg_match('/<('.Tools::cleanNonUnicodeSupport('[a-z\p{L}0-9!#$%&\'*+\/=?^`{}|~_-]+[.a-z\p{L}0-9!#$%&\'*+\/=?^`{}|~_-]*@[a-z\p{L}0-9]+[._a-z\p{L}0-9-]*\.[a-z0-9]+').')>/', $overview->from, $result) + || !Validate::isEmail($from = $result[1])) + continue; + + $contacts = Contact::getCategoriesContacts(); + if (!$contacts) + continue; + $id_contact = $contacts[0]['id_contact']; + + $ct = new CustomerThread(); + $ct->email = $from; + $ct->id_contact = $id_contact; + $ct->id_lang = (int)Configuration::get('PS_LANG_DEFAULT'); + $ct->status = 'open'; + $ct->token = Tools::passwdGen(12); + $ct->add(); + } + else + $ct = new CustomerThread((int)$matches1[1]); //check if order exist in database + + if (Validate::isLoadedObject($ct) && ((isset($matches2[1]) && $ct->token == $matches2[1]) || $new_ct)) + { + $cm = new CustomerMessage(); + $cm->id_customer_thread = $ct->id; + $cm->message = imap_fetchbody($mbox, $overview->msgno, 1); + $cm->add(); + } + } + Db::getInstance()->execute('INSERT INTO `'._DB_PREFIX_.'customer_message_sync_imap` (`md5_header`) VALUES (\''.pSQL($md5).'\')'); + } + } + imap_expunge($mbox); + imap_close($mbox); + die('{"hasError" : false, "errors" : ["'.$str_errors.$str_error_delete.'"]}'); + } + } +} diff --git a/controllers/admin/AdminCustomersController.php b/controllers/admin/AdminCustomersController.php index 6b9a8f54b..621e9b765 100644 --- a/controllers/admin/AdminCustomersController.php +++ b/controllers/admin/AdminCustomersController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -42,24 +42,27 @@ class AdminCustomersControllerCore extends AdminController $this->deleted = true; $this->explicitSelect = true; + $this->allow_export = true; + $this->addRowAction('edit'); $this->addRowAction('view'); $this->addRowAction('delete'); - $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); + $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Would you like to delete the selected items?'))); $this->context = Context::getContext(); $this->default_form_language = $this->context->language->id; $genders = array(); - $genders_icon = array('default' => 'unknown.gif'); + $genders_icon = array(); + $genders_icon[] = array('src' => '../genders/Unknown.jpg', 'alt' => ''); foreach (Gender::getGenders() as $gender) { $gender_file = 'genders/'.$gender->id.'.jpg'; if (file_exists(_PS_IMG_DIR_.$gender_file)) - $genders_icon[$gender->id] = '../'.$gender_file; + $genders_icon[$gender->id] = array('src' => '../'.$gender_file, 'alt' => $gender->name); else - $genders_icon[$gender->id] = $gender->name; + $genders_icon[$gender->id] = array('src' => '../genders/Unknown.jpg', 'alt' => $gender->name); $genders[$gender->id] = $gender->name; } @@ -79,7 +82,7 @@ class AdminCustomersControllerCore extends AdminController 'width' => 20 ), 'id_gender' => array( - 'title' => $this->l('Titles'), + 'title' => $this->l('Title'), 'width' => 70, 'align' => 'center', 'icon' => $genders_icon, @@ -89,15 +92,15 @@ class AdminCustomersControllerCore extends AdminController 'filter_key' => 'a!id_gender', ), 'lastname' => array( - 'title' => $this->l('Last Name'), + 'title' => $this->l('Last name'), 'width' => 'auto' ), 'firstname' => array( - 'title' => $this->l('First name'), + 'title' => $this->l('First Name'), 'width' => 'auto' ), 'email' => array( - 'title' => $this->l('E-mail address'), + 'title' => $this->l('Email address'), 'width' => 140, ), 'age' => array( @@ -174,7 +177,7 @@ class AdminCustomersControllerCore extends AdminController )); if (!$this->can_add_customer && !$this->display) - $this->informations[] = $this->l('You have to select a shop if you want to create a customer'); + $this->informations[] = $this->l('You have to select a shop if you want to create a customer.'); parent::initContent(); } @@ -184,6 +187,13 @@ class AdminCustomersControllerCore extends AdminController parent::initToolbar(); if (!$this->can_add_customer) unset($this->toolbar_btn['new']); + else if (!$this->display) //display import button only on listing + { + $this->toolbar_btn['import'] = array( + 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table, + 'desc' => $this->l('Import') + ); + } } public function initProcess() @@ -195,21 +205,21 @@ class AdminCustomersControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') $this->action = 'guest_to_customer'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::isSubmit('changeNewsletterVal') && $this->id_object) { if ($this->tabAccess['edit'] === '1') $this->action = 'change_newsletter_val'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::isSubmit('changeOptinVal') && $this->id_object) { if ($this->tabAccess['edit'] === '1') $this->action = 'change_optin_val'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } // When deleting, first display a form to select the type of deletion @@ -259,7 +269,7 @@ class AdminCustomersControllerCore extends AdminController 'input' => array( array( 'type' => 'radio', - 'label' => $this->l('Titles:'), + 'label' => $this->l('Title:'), 'name' => 'id_gender', 'required' => false, 'class' => 't', @@ -283,7 +293,7 @@ class AdminCustomersControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('E-mail address:'), + 'label' => $this->l('Email address:'), 'name' => 'email', 'size' => 33, 'required' => true @@ -294,7 +304,7 @@ class AdminCustomersControllerCore extends AdminController 'name' => 'passwd', 'size' => 33, 'required' => ($obj->id ? false : true), - 'desc' => ($obj->id ? $this->l('Leave blank if no change') : $this->l('5 characters min., only letters, numbers, or').' -_') + 'desc' => ($obj->id ? $this->l('Leave this field blank if there\'s no change') : $this->l('Minimum of five characters (only letters and numbers).').' -_') ), array( 'type' => 'birthday', @@ -325,7 +335,7 @@ class AdminCustomersControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Allow or disallow this customer to log in') + 'desc' => $this->l('Enable or disable customer login') ), array( 'type' => 'radio', @@ -346,11 +356,11 @@ class AdminCustomersControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Customer will receive your newsletter via e-mail') + 'desc' => $this->l('Customers will receive your newsletter via email.') ), array( 'type' => 'radio', - 'label' => $this->l('Opt-in:'), + 'label' => $this->l('Opt in:'), 'name' => 'optin', 'required' => false, 'class' => 't', @@ -367,7 +377,7 @@ class AdminCustomersControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Customer will receive your ads via e-mail') + 'desc' => $this->l('Customer will receive your ads via email.') ), ) ); @@ -390,7 +400,7 @@ class AdminCustomersControllerCore extends AdminController 'name' => 'groupBox', 'values' => $groups, 'required' => true, - 'desc' => $this->l('Select all customer groups you would like to apply to this customer') + 'desc' => $this->l('Select all the groups that you would like to apply to this customer.') ), array( 'type' => 'select', @@ -460,7 +470,7 @@ class AdminCustomersControllerCore extends AdminController ); $this->fields_form['input'][] = array( 'type' => 'text', - 'label' => $this->l('Max payment days:'), + 'label' => $this->l('Maximum number of payment days:'), 'name' => 'max_payment_days', 'size' => 10, 'hint' => $this->l('Valid characters:').' 0-9' @@ -480,7 +490,7 @@ class AdminCustomersControllerCore extends AdminController } $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); @@ -493,7 +503,10 @@ class AdminCustomersControllerCore extends AdminController ); // Added values of object Group - $customer_groups = $obj->getGroups(); + if (!Validate::isUnsignedId($obj->id)) + $customer_groups = array(); + else + $customer_groups = $obj->getGroups(); $customer_groups_ids = array(); if (is_array($customer_groups)) foreach ($customer_groups as $customer_group) @@ -542,7 +555,7 @@ class AdminCustomersControllerCore extends AdminController $total_orders = count($orders); for ($i = 0; $i < $total_orders; $i++) { - $orders[$i]['date_add'] = Tools::displayDate($orders[$i]['date_add'], $this->context->language->id); + $orders[$i]['date_add'] = Tools::displayDate($orders[$i]['date_add']); $orders[$i]['total_paid_real_not_formated'] = $orders[$i]['total_paid_real']; $orders[$i]['total_paid_real'] = Tools::displayPrice($orders[$i]['total_paid_real'], new Currency((int)$orders[$i]['id_currency'])); } @@ -552,7 +565,7 @@ class AdminCustomersControllerCore extends AdminController for ($i = 0; $i < $total_messages; $i++) { $messages[$i]['message'] = substr(strip_tags(html_entity_decode($messages[$i]['message'], ENT_NOQUOTES, 'UTF-8')), 0, 75); - $messages[$i]['date_add'] = Tools::displayDate($messages[$i]['date_add'], $this->context->language->id, true); + $messages[$i]['date_add'] = Tools::displayDate($messages[$i]['date_add'], null, true); } $groups = $customer->getGroups(); @@ -571,7 +584,7 @@ class AdminCustomersControllerCore extends AdminController foreach ($orders as $order) { if (!isset($order['order_state'])) - $order['order_state'] = $this->l('The state isn\'t still defined for this order'); + $order['order_state'] = $this->l('The state isn\'t defined for this order'); if ($order['valid']) { @@ -585,7 +598,7 @@ class AdminCustomersControllerCore extends AdminController $products = $customer->getBoughtProducts(); $total_products = count($products); for ($i = 0; $i < $total_products; $i++) - $products[$i]['date_add'] = Tools::displayDate($products[$i]['date_add'], $this->default_form_language, true); + $products[$i]['date_add'] = Tools::displayDate($products[$i]['date_add'], null, true); $carts = Cart::getCustomerCarts($customer->id); $total_carts = count($carts); @@ -597,7 +610,7 @@ class AdminCustomersControllerCore extends AdminController $currency = new Currency((int)$carts[$i]['id_currency']); $carrier = new Carrier((int)$carts[$i]['id_carrier']); $carts[$i]['id_cart'] = sprintf('%06d', $carts[$i]['id_cart']); - $carts[$i]['date_add'] = Tools::displayDate($carts[$i]['date_add'], $this->default_form_language, true); + $carts[$i]['date_add'] = Tools::displayDate($carts[$i]['date_add'], null, true); $carts[$i]['total_price'] = Tools::displayPrice($summary['total_price'], $currency); $carts[$i]['name'] = $carrier->name; } @@ -633,7 +646,7 @@ class AdminCustomersControllerCore extends AdminController $total_connections = count($connections); for ($i = 0; $i < $total_connections; $i++) { - $connections[$i]['date_add'] = Tools::displayDate($connections[$i]['date_add'], $this->default_form_language, true); + $connections[$i]['date_add'] = Tools::displayDate($connections[$i]['date_add'],null , true); $connections[$i]['http_referer'] = $connections[$i]['http_referer'] ? preg_replace('/^www./', '', parse_url($connections[$i]['http_referer'], PHP_URL_HOST)) : $this->l('Direct link'); @@ -642,7 +655,7 @@ class AdminCustomersControllerCore extends AdminController $referrers = Referrer::getReferrers($customer->id); $total_referrers = count($referrers); for ($i = 0; $i < $total_referrers; $i++) - $referrers[$i]['date_add'] = Tools::displayDate($referrers[$i]['date_add'], $this->default_form_language, true); + $referrers[$i]['date_add'] = Tools::displayDate($referrers[$i]['date_add'],null , true); $shop = new Shop($customer->id_shop); $this->tpl_view_vars = array( @@ -650,16 +663,17 @@ class AdminCustomersControllerCore extends AdminController 'gender_image' => $gender_image, // General information of the customer - 'registration_date' => Tools::displayDate($customer->date_add, $this->default_form_language, true), + 'registration_date' => Tools::displayDate($customer->date_add,null , true), 'customer_stats' => $customer_stats, - 'last_visit' => Tools::displayDate($customer_stats['last_visit'], $this->default_form_language, true), + 'last_visit' => Tools::displayDate($customer_stats['last_visit'],null , true), 'count_better_customers' => $count_better_customers, 'shop_is_feature_active' => Shop::isFeatureActive(), 'name_shop' => $shop->name, - 'customer_birthday' => Tools::displayDate($customer->birthday, $this->default_form_language), - 'last_update' => Tools::displayDate($customer->date_upd, $this->default_form_language, true), + 'customer_birthday' => Tools::displayDate($customer->birthday), + 'last_update' => Tools::displayDate($customer->date_upd,null , true), 'customer_exists' => Customer::customerExists($customer->email), - 'id_lang' => (int)(count($orders) ? $orders[0]['id_lang'] : Configuration::get('PS_LANG_DEFAULT')), + 'id_lang' => $customer->id_lang, + 'customerLanguage' => (new Language($customer->id_lang)), // Add a Private note 'customer_note' => Tools::htmlentitiesUTF8($customer->note), @@ -738,7 +752,7 @@ class AdminCustomersControllerCore extends AdminController $customer->getByEmail($customer_email); if ($customer->id) { - $this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$customer_email; + $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email; $this->display = 'edit'; return $customer; } @@ -762,13 +776,13 @@ class AdminCustomersControllerCore extends AdminController $customer = new Customer(); $customer->getByEmail($customer_email); if ($customer->id) - $this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$customer_email; + $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$customer_email; } return parent::processUpdate(); } else - $this->errors[] = Tools::displayError('An error occurred while loading object.').' + $this->errors[] = Tools::displayError('An error occurred while loading the object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); } @@ -776,7 +790,7 @@ class AdminCustomersControllerCore extends AdminController { // Check that default group is selected if (!is_array(Tools::getValue('groupBox')) || !in_array(Tools::getValue('id_default_group'), Tools::getValue('groupBox'))) - $this->errors[] = Tools::displayError('Default customer group must be selected in group box.'); + $this->errors[] = Tools::displayError('A default customer group must be selected in group box.'); // Check the requires fields which are settings in the BO $customer = new Customer(); @@ -810,7 +824,7 @@ class AdminCustomersControllerCore extends AdminController else if ($customer->transformToCustomer(Tools::getValue('id_lang', $this->context->language->id))) Tools::redirectAdmin(self::$currentIndex.'&'.$this->identifier.'='.$customer->id.'&conf=3&token='.$this->token); else - $this->errors[] = Tools::displayError('An error occurred while updating the customer.'); + $this->errors[] = Tools::displayError('An error occurred while updating customer information.'); } /** @@ -820,10 +834,10 @@ class AdminCustomersControllerCore extends AdminController { $customer = new Customer($this->id_object); if (!Validate::isLoadedObject($customer)) - $this->errors[] = Tools::displayError('An error occurred while updating the customer.'); + $this->errors[] = Tools::displayError('An error occurred while updating customer information.'); $customer->newsletter = $customer->newsletter ? 0 : 1; if (!$customer->update()) - $this->errors[] = Tools::displayError('An error occurred while updating the customer.'); + $this->errors[] = Tools::displayError('An error occurred while updating customer information.'); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token); } @@ -834,10 +848,10 @@ class AdminCustomersControllerCore extends AdminController { $customer = new Customer($this->id_object); if (!Validate::isLoadedObject($customer)) - $this->errors[] = Tools::displayError('An error occurred while updating the customer.'); + $this->errors[] = Tools::displayError('An error occurred while updating customer information.'); $customer->optin = $customer->optin ? 0 : 1; if (!$customer->update()) - $this->errors[] = Tools::displayError('An error occurred while updating the customer.'); + $this->errors[] = Tools::displayError('An error occurred while updating customer information.'); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token); } @@ -873,7 +887,7 @@ class AdminCustomersControllerCore extends AdminController $tpl->assign(array( 'href' => self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != null ? $token : $this->token), - 'confirm' => $this->l('Delete selected item?').$name, + 'confirm' => $this->l('Delete the selected item?').$name, 'action' => $this->l('Delete'), 'id' => $id, )); diff --git a/controllers/admin/AdminDeliverySlipController.php b/controllers/admin/AdminDeliverySlipController.php index f5156e169..c2cca91a9 100644 --- a/controllers/admin/AdminDeliverySlipController.php +++ b/controllers/admin/AdminDeliverySlipController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -44,7 +44,7 @@ class AdminDeliverySlipControllerCore extends AdminController ), 'PS_DELIVERY_NUMBER' => array( 'title' => $this->l('Delivery number:'), - 'desc' => $this->l('The next delivery slip will begin with this number, and then increase with each additional slip'), + 'desc' => $this->l('The next delivery slip will begin with this number and then increase with each additional slip.'), 'size' => 6, 'cast' => 'intval', 'type' => 'text' @@ -111,7 +111,7 @@ class AdminDeliverySlipControllerCore extends AdminController if (count(OrderInvoice::getByDeliveryDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')))) Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateDeliverySlipsPDF&date_from='.urlencode(Tools::getValue('date_from')).'&date_to='.urlencode(Tools::getValue('date_to'))); else - $this->errors[] = Tools::displayError('No delivery slip found for this period'); + $this->errors[] = Tools::displayError('No delivery slip was found for this period.'); } } else diff --git a/controllers/admin/AdminEmailsController.php b/controllers/admin/AdminEmailsController.php index e63b76d9d..1e1394b9f 100644 --- a/controllers/admin/AdminEmailsController.php +++ b/controllers/admin/AdminEmailsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -38,12 +38,12 @@ class AdminEmailsControllerCore extends AdminController $this->fields_options = array( 'email' => array( - 'title' => $this->l('E-mail'), + 'title' => $this->l('Email'), 'icon' => 'email', 'fields' => array( 'PS_MAIL_EMAIL_MESSAGE' => array( - 'title' => $this->l('Send e-mail to'), - 'desc' => $this->l('Where customers send messages from order page'), + 'title' => $this->l('Send email to'), + 'desc' => $this->l('Where customers send messages from the order page.'), 'validation' => 'isUnsignedId', 'type' => 'select', 'cast' => 'intval', @@ -56,7 +56,8 @@ class AdminEmailsControllerCore extends AdminController 'type' => 'radio', 'required' => true, 'choices' => array( - 1 => $this->l('Use PHP mail() function. Recommended; works in most cases'), + 3 => $this->l('Never send emails (may be useful for test purpose)'), + 1 => $this->l('Use PHP mail() function. Recommended; works in most cases'), 2 => $this->l('Set my own SMTP parameters. For advanced users ONLY') ), 'js' => array( @@ -66,8 +67,8 @@ class AdminEmailsControllerCore extends AdminController 'visibility' => Shop::CONTEXT_ALL ), 'PS_MAIL_TYPE' => array('title' => '', 'validation' => 'isGenericName', 'type' => 'radio', 'required' => true, 'choices' => array( - Mail::TYPE_HTML => $this->l('Send e-mail as HTML'), - Mail::TYPE_TEXT => $this->l('Send e-mail as Text'), + Mail::TYPE_HTML => $this->l('Send email in HTML format. '), + Mail::TYPE_TEXT => $this->l('Send email in text format'), Mail::TYPE_BOTH => $this->l('Both') ) ), @@ -75,14 +76,14 @@ class AdminEmailsControllerCore extends AdminController 'submit' => array() ), 'smtp' => array( - 'title' => $this->l('E-mail'), + 'title' => $this->l('Email'), 'icon' => 'email', 'top' => '
        ', 'bottom' => '
        ', 'fields' => array( 'PS_MAIL_DOMAIN' => array( 'title' => $this->l('Mail domain name:'), - 'desc' => $this->l('Fully qualified domain name (keep empty if you do not know)'), + 'desc' => $this->l('Fully qualified domain name (keep this field empty if you don\'t know).'), 'empty' => true, 'validation' => 'isUrl', 'size' => 30, 'type' => 'text', @@ -98,7 +99,7 @@ class AdminEmailsControllerCore extends AdminController ), 'PS_MAIL_USER' => array( 'title' => $this->l('SMTP user:'), - 'desc' => $this->l('Leave blank if not applicable'), + 'desc' => $this->l('Leave blank if not applicable.'), 'validation' => 'isGenericName', 'size' => 30, 'type' => 'text', @@ -106,7 +107,7 @@ class AdminEmailsControllerCore extends AdminController ), 'PS_MAIL_PASSWD' => array( 'title' => $this->l('SMTP password:'), - 'desc' => $this->l('Leave blank if not applicable'), + 'desc' => $this->l('Leave blank if not applicable.'), 'validation' => 'isAnything', 'size' => 30, 'type' => 'password', @@ -148,36 +149,46 @@ class AdminEmailsControllerCore extends AdminController 'submit' => array() ), 'test' => array( - 'title' => $this->l('Test your e-mail configuration'), + 'title' => $this->l('Test your email configuration'), 'icon' => 'email', 'fields' => array( 'PS_SHOP_EMAIL' => array( - 'title' => $this->l('Send a test e-mail to'), + 'title' => $this->l('Send a test email to'), 'type' => 'text', 'size' => 40, 'id' => 'testEmail' ), ), - 'bottom' => '

        + 'bottom' => '

        ', ) ); } + public function updateOptionPsMailPasswd($value) + { + if (Tools::getValue('PS_MAIL_PASSWD') == '' && Configuration::get('PS_MAIL_PASSWD')) + return true; + else + Configuration::updateValue('PS_MAIL_PASSWD', Tools::getValue('PS_MAIL_PASSWD')); + } + + /** * AdminController::initContent() override * @see AdminController::initContent() */ public function initContent() { + $this->initTabModuleList(); $this->initToolbar(); + $this->addToolBarModulesListButton(); unset($this->toolbar_btn['save']); - $back = $this->context->link->getAdminLink('AdminHome'); $this->toolbar_btn['back'] = array( 'href' => $back, - 'desc' => $this->l('Back to dashboard') + 'desc' => $this->l('Back to the dashboard') ); $this->content .= $this->renderOptions(); @@ -202,8 +213,8 @@ class AdminEmailsControllerCore extends AdminController if (isset($_POST['PS_SHOP_EMAIL'])) $_POST['PS_SHOP_EMAIL'] = Configuration::get('PS_SHOP_EMAIL'); - if ($_POST['PS_MAIL_METHOD'] == 2 && (empty($_POST['PS_MAIL_SERVER']) || empty($_POST['PS_MAIL_SMTP_PORT']))) - $this->errors[] = Tools::displayError('You must define an SMTP server and an SMTP port. If you do not know, use the PHP mail() function instead.'); + if (isset($_POST['PS_MAIL_METHOD']) && $_POST['PS_MAIL_METHOD'] == 2 && (empty($_POST['PS_MAIL_SERVER']) || empty($_POST['PS_MAIL_SMTP_PORT']))) + $this->errors[] = Tools::displayError('You must define an SMTP server and an SMTP port. If you do not know it, use the PHP mail() function instead.'); } public function ajaxProcessSendMailTest() @@ -217,7 +228,7 @@ class AdminEmailsControllerCore extends AdminController $smtpChecked = (trim(Tools::getValue('mailMethod')) == 'smtp'); $smtpServer = Tools::getValue('smtpSrv'); $content = urldecode(Tools::getValue('testMsg')); - $content = utf8_encode(html_entity_decode($content)); + $content = html_entity_decode($content); $subject = urldecode(Tools::getValue('testSubject')); $type = 'text/html'; $to = Tools::getValue('testEmail'); @@ -225,10 +236,16 @@ class AdminEmailsControllerCore extends AdminController $smtpLogin = Tools::getValue('smtpLogin'); $smtpPassword = Tools::getValue('smtpPassword'); $smtpPassword = (!empty($smtpPassword)) ? urldecode($smtpPassword) : Configuration::get('PS_MAIL_PASSWD'); + $smtpPassword = str_replace( + array('<', '>', '"', '&'), + array('<', '>', '"', '&'), + Tools::htmlentitiesUTF8($smtpPassword) + ); + $smtpPort = Tools::getValue('smtpPort'); $smtpEncryption = Tools::getValue('smtpEnc'); - - $result = Mail::sendMailTest(Tools::htmlentitiesUTF8($smtpChecked), Tools::htmlentitiesUTF8($smtpServer), Tools::htmlentitiesUTF8($content), Tools::htmlentitiesUTF8($subject), Tools::htmlentitiesUTF8($type), Tools::htmlentitiesUTF8($to), Tools::htmlentitiesUTF8($from), Tools::htmlentitiesUTF8($smtpLogin), Tools::htmlentitiesUTF8($smtpPassword), Tools::htmlentitiesUTF8($smtpPort), Tools::htmlentitiesUTF8($smtpEncryption)); + + $result = Mail::sendMailTest(Tools::htmlentitiesUTF8($smtpChecked), Tools::htmlentitiesUTF8($smtpServer), Tools::htmlentitiesUTF8($content), Tools::htmlentitiesUTF8($subject), Tools::htmlentitiesUTF8($type), Tools::htmlentitiesUTF8($to), Tools::htmlentitiesUTF8($from), Tools::htmlentitiesUTF8($smtpLogin), $smtpPassword, Tools::htmlentitiesUTF8($smtpPort), Tools::htmlentitiesUTF8($smtpEncryption)); die($result === true ? 'ok' : $result); } } diff --git a/controllers/admin/AdminEmployeesController.php b/controllers/admin/AdminEmployeesController.php index fbe815d6c..3c09f4cf1 100644 --- a/controllers/admin/AdminEmployeesController.php +++ b/controllers/admin/AdminEmployeesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -65,16 +65,16 @@ class AdminEmployeesControllerCore extends AdminController $profiles = Profile::getProfiles($this->context->language->id); if (!$profiles) - $this->errors[] = Tools::displayError('No profile'); + $this->errors[] = Tools::displayError('No profile.'); else foreach ($profiles as $profile) $this->profiles_array[$profile['name']] = $profile['name']; $this->fields_list = array( 'id_employee' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), - 'lastname' => array('title' => $this->l('Last name'), 'width' => 'auto'), - 'firstname' => array('title' => $this->l('First name'), 'width' => 130), - 'email' => array('title' => $this->l('E-mail address'), 'width' => 180), + 'lastname' => array('title' => $this->l('Last Name'), 'width' => 'auto'), + 'firstname' => array('title' => $this->l('First Name'), 'width' => 130), + 'email' => array('title' => $this->l('Email address'), 'width' => 180), 'profile' => array('title' => $this->l('Profile'), 'width' => 90, 'type' => 'select', 'list' => $this->profiles_array, 'filter_key' => 'pl!name'), 'active' => array('title' => $this->l('Can log in'), 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'width' => 30), ); @@ -85,7 +85,7 @@ class AdminEmployeesControllerCore extends AdminController 'fields' => array( 'PS_PASSWD_TIME_BACK' => array( 'title' => $this->l('Password regeneration'), - 'desc' => $this->l('Security: minimum time to wait between two password changes'), + 'desc' => $this->l('Security: Minimum time to wait between two password changes.'), 'cast' => 'intval', 'size' => 5, 'type' => 'text', @@ -93,8 +93,8 @@ class AdminEmployeesControllerCore extends AdminController 'visibility' => Shop::CONTEXT_ALL ), 'PS_BO_ALLOW_EMPLOYEE_FORM_LANG' => array( - 'title' => $this->l('Memorize language used in Admin panel forms'), - 'desc' => $this->l('Allow employees to select a specific language for Admin panel forms'), + 'title' => $this->l('Memorize the language used in Admin panel forms'), + 'desc' => $this->l('Allow employees to select a specific language for the Admin panel form.'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'value', @@ -158,7 +158,7 @@ class AdminEmployeesControllerCore extends AdminController if ($obj->id_profile == _PS_ADMIN_PROFILE_ && $this->context->employee->id_profile != _PS_ADMIN_PROFILE_) { - $this->errors[] = Tools::displayError('You cannot edit SuperAdmin profile.'); + $this->errors[] = Tools::displayError('You cannot edit the SuperAdmin profile.'); return parent::renderForm(); } @@ -170,14 +170,14 @@ class AdminEmployeesControllerCore extends AdminController 'input' => array( array( 'type' => 'text', - 'label' => $this->l('First name:'), + 'label' => $this->l('First Name:'), 'name' => 'firstname', 'size' => 33, 'required' => true ), array( 'type' => 'text', - 'label' => $this->l('Last name:'), + 'label' => $this->l('Last Name:'), 'name' => 'lastname', 'size' => 33, 'required' => true @@ -189,12 +189,12 @@ class AdminEmployeesControllerCore extends AdminController 'required' => true, 'size' => 33, 'desc' => ($obj->id ? - $this->l('Leave blank if you do not want to change your password') : - $this->l('Min. 8 characters; use only letters, numbers or').' -_') + $this->l('Leave this field blank if you do not want to change your password.') : + $this->l('Minimum of eight characters (use only letters and numbers)').' -_') ), array( 'type' => 'text', - 'label' => $this->l('E-mail address:'), + 'label' => $this->l('Email address:'), 'name' => 'email', 'size' => 33, 'required' => true @@ -205,7 +205,7 @@ class AdminEmployeesControllerCore extends AdminController 'name' => 'bo_color', 'class' => 'color mColorPickerInput', 'size' => 20, - 'desc' => $this->l('Admin panel background will be displayed in this color. HTML colors only (e.g.').' "lightblue", "#CC6600")' + 'desc' => $this->l('Admin panel background will be displayed in this color (HTML colors only).').' "lightblue", "#CC6600")' ), array( 'type' => 'default_tab', @@ -216,7 +216,7 @@ class AdminEmployeesControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('Back Office width:'), + 'label' => $this->l('Back Office width'), 'name' => 'bo_width', 'size' => 10, 'desc' => $this->l('Back Office width, in pixels. The value "0" means that the Back Office width will be flexible.') @@ -227,7 +227,7 @@ class AdminEmployeesControllerCore extends AdminController 'name' => 'id_lang', 'required' => true, 'options' => array( - 'query' => Language::getLanguages(), + 'query' => Language::getLanguages(false), 'id' => 'id_lang', 'name' => 'name' ) @@ -241,9 +241,9 @@ class AdminEmployeesControllerCore extends AdminController ), array( 'type' => 'radio', - 'label' => $this->l('Show screencast at log in:'), + 'label' => $this->l('Show screencast at login:'), 'name' => 'bo_show_screencast', - 'desc' => $this->l('Display the welcome video in the Admin panel dashboard at log in'), + 'desc' => $this->l('Display the welcome video in the Admin panel dashboard at log in.'), 'required' => false, 'class' => 't', 'is_bool' => true, @@ -284,7 +284,7 @@ class AdminEmployeesControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Allow or disallow this employee to log into the Admin panel') + 'desc' => $this->l('Allow or disallow this employee to log into the Admin panel.') ); // if employee is not SuperAdmin (id_profile = 1), don't make it possible to select the admin profile @@ -297,7 +297,7 @@ class AdminEmployeesControllerCore extends AdminController } $this->fields_form['input'][] = array( 'type' => 'select', - 'label' => $this->l('Profile:'), + 'label' => $this->l('Profile Permission:'), 'name' => 'id_profile', 'required' => true, 'options' => array( @@ -324,7 +324,7 @@ class AdminEmployeesControllerCore extends AdminController } $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); @@ -342,9 +342,9 @@ class AdminEmployeesControllerCore extends AdminController return false; $email = $this->getFieldValue($obj, 'email'); if (!Validate::isEmail($email)) - $this->errors[] = Tools::displayError('Invalid e-mail'); - else if (Employee::employeeExists($email) && !Tools::getValue('id_employee')) - $this->errors[] = Tools::displayError('An account already exists for this e-mail address:').' '.$email; + $this->errors[] = Tools::displayError('Invalid email address.'); + elseif (Employee::employeeExists($email) && (!Tools::getValue('id_employee') || ($employee = new Employee((int)Tools::getValue('id_employee'))) && $employee->email != $email)) + $this->errors[] = Tools::displayError('An account already exists for this email address:').' '.$email; } public function postProcess() @@ -367,7 +367,7 @@ class AdminEmployeesControllerCore extends AdminController $employee = new Employee(Tools::getValue('id_employee')); if ($employee->isLastAdmin()) { - $this->errors[] = Tools::displayError('You cannot disable or delete the last administrator account.'); + $this->errors[] = Tools::displayError('You cannot disable or delete the administrator account.'); return false; } @@ -436,21 +436,21 @@ class AdminEmployeesControllerCore extends AdminController if (Tools::getvalue('active') == 0) { - $this->errors[] = Tools::displayError('You cannot disable or delete the last administrator account.'); + $this->errors[] = Tools::displayError('You cannot disable or delete the administrator account.'); return false; } } if (!in_array(Tools::getValue('bo_theme'), $this->themes)) { - $this->errors[] = Tools::displayError('Invalid theme.'); + $this->errors[] = Tools::displayError('Invalid theme'); return false; } $assos = $this->getSelectedAssoShop($this->table); if (!$assos && $this->table = 'employee') if (Shop::isFeatureActive() && _PS_ADMIN_PROFILE_ != $_POST['id_profile']) - $this->errors[] = Tools::displayError('The employee must be associated with at least one shop'); + $this->errors[] = Tools::displayError('The employee must be associated with at least one shop.'); } return parent::postProcess(); } diff --git a/controllers/admin/AdminFeaturesController.php b/controllers/admin/AdminFeaturesController.php index e1d50d7a3..f63ceb83a 100644 --- a/controllers/admin/AdminFeaturesController.php +++ b/controllers/admin/AdminFeaturesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -77,12 +77,12 @@ class AdminFeaturesControllerCore extends AdminController // Added specific button in toolbar $this->toolbar_btn['newAttributes'] = array( 'href' => self::$currentIndex.'&addfeature_value&token='.$this->token, - 'desc' => $this->l('Add new feature value') + 'desc' => $this->l('Add new feature values') ); $this->toolbar_btn['new'] = array( 'href' => self::$currentIndex.'&addfeature&token='.$this->token, - 'desc' => $this->l('Add new feature') + 'desc' => $this->l('Add a new feature') ); return parent::renderList(); @@ -127,7 +127,7 @@ class AdminFeaturesControllerCore extends AdminController $this->addRowAction('delete'); if (!Validate::isLoadedObject($obj = new Feature((int)$id))) - $this->errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); $this->fields_list = array( 'id_feature_value' => array( @@ -239,7 +239,7 @@ class AdminFeaturesControllerCore extends AdminController $this->toolbar_btn['back'] = array( 'href' => $back, - 'desc' => $this->l('Back to list') + 'desc' => $this->l('Back to the list') ); break; @@ -353,7 +353,7 @@ class AdminFeaturesControllerCore extends AdminController } } else - $this->displayWarning($this->l('This feature has been disabled, you can activate it at:').''.$this->l('Performance').''); + $this->displayWarning($this->l('This feature has been disabled. You can activate it at:').''.$this->l('Performance').''); $this->context->smarty->assign(array( 'content' => $this->content, @@ -374,8 +374,6 @@ class AdminFeaturesControllerCore extends AdminController parent::initProcess(); - if ($this->table == 'feature_value' && ($this->display == 'edit' || $this->display == 'add')) - $this->display = 'editFeatureValue'; } public function postProcess() @@ -391,6 +389,9 @@ class AdminFeaturesControllerCore extends AdminController array('errors' => &$this->errors)); // send errors as reference to allow displayFeaturePostProcess to stop saving process parent::postProcess(); + + if ($this->table == 'feature_value' && ($this->display == 'edit' || $this->display == 'add')) + $this->display = 'editFeatureValue'; } /** @@ -403,7 +404,7 @@ class AdminFeaturesControllerCore extends AdminController if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && !count($this->errors)) $this->redirect_after = self::$currentIndex.'&'.$this->identifier.'=&conf=3&update'.$this->table.'&token='.$this->token; - else if (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && count($this->errors)) + elseif (Tools::isSubmit('submitAdd'.$this->table.'AndStay') && count($this->errors)) $this->display = 'editFeatureValue'; return $object; @@ -454,7 +455,7 @@ class AdminFeaturesControllerCore extends AdminController * AdminController::getList() override * @see AdminController::getList() */ - public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) + public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = false, $id_lang_shop = false) { if ($this->table == 'feature_value') $this->_where .= ' AND a.custom = 0'; diff --git a/controllers/admin/AdminGendersController.php b/controllers/admin/AdminGendersController.php index d4fa7af36..ef4cf1414 100644 --- a/controllers/admin/AdminGendersController.php +++ b/controllers/admin/AdminGendersController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -139,14 +139,14 @@ class AdminGendersControllerCore extends AdminController 'label' => $this->l('Image Width:'), 'name' => 'img_width', 'size' => 4, - 'desc' => $this->l('Image width in pixels. Enter "0" to use original size') + 'desc' => $this->l('Image width in pixels. Enter "0" to use the original size.') ), array( 'type' => 'text', 'label' => $this->l('Image Height:'), 'name' => 'img_height', 'size' => 4, - 'desc' => $this->l('Image height in pixels. Enter "0" to use original size') + 'desc' => $this->l('Image height in pixels. Enter "0" to use the original size.') ) ), 'submit' => array( @@ -177,7 +177,7 @@ class AdminGendersControllerCore extends AdminController if (isset($this->fieldImageSettings['name']) && isset($this->fieldImageSettings['dir'])) { if (!Validate::isInt(Tools::getValue('img_width')) || !Validate::isInt(Tools::getValue('img_height'))) - $this->errors[] = Tools::displayError('Width and height must be numeric values'); + $this->errors[] = Tools::displayError('Width and height must be numeric values.'); else { if ((int)Tools::getValue('img_width') > 0 && (int)Tools::getValue('img_height') > 0) diff --git a/controllers/admin/AdminGeolocationController.php b/controllers/admin/AdminGeolocationController.php index 63156dcde..b85e2481b 100755 --- a/controllers/admin/AdminGeolocationController.php +++ b/controllers/admin/AdminGeolocationController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -53,16 +53,16 @@ class AdminGeolocationControllerCore extends AdminController 'title' => $this->l('Geolocation behavior for restricted countries'), 'type' => 'select', 'identifier' => 'key', - 'list' => array(array('key' => _PS_GEOLOCATION_NO_CATALOG_, 'name' => $this->l('Visitors cannot see your catalog')), - array('key' => _PS_GEOLOCATION_NO_ORDER_, 'name' => $this->l('Visitors can see your catalog but cannot place an order'))), + 'list' => array(array('key' => _PS_GEOLOCATION_NO_CATALOG_, 'name' => $this->l('Visitors cannot see your catalog.')), + array('key' => _PS_GEOLOCATION_NO_ORDER_, 'name' => $this->l('Visitors can see your catalog but cannot place an order.'))), ), 'PS_GEOLOCATION_NA_BEHAVIOR' => array( 'title' => $this->l('Geolocation behavior for other countries'), 'type' => 'select', 'identifier' => 'key', 'list' => array(array('key' => '-1', 'name' => $this->l('All features are available')), - array('key' => _PS_GEOLOCATION_NO_CATALOG_, 'name' => $this->l('Visitors cannot see your catalog')), - array('key' => _PS_GEOLOCATION_NO_ORDER_, 'name' => $this->l('Visitors can see your catalog but cannot place an order'))) + array('key' => _PS_GEOLOCATION_NO_CATALOG_, 'name' => $this->l('Visitors cannot see your catalog.')), + array('key' => _PS_GEOLOCATION_NO_ORDER_, 'name' => $this->l('Visitors can see your catalog but cannot place an order.'))) ), ), ), @@ -87,12 +87,12 @@ class AdminGeolocationControllerCore extends AdminController Configuration::updateValue('PS_GEOLOCATION_ENABLED', (int)Tools::getValue('PS_GEOLOCATION_ENABLED')); // stop processing if geolocation is set to yes but geolite pack is not available elseif (Tools::getValue('PS_GEOLOCATION_ENABLED')) - $this->errors[] = Tools::displayError('Geolocation database is unavailable.'); + $this->errors[] = Tools::displayError('The geolocation database is unavailable.'); if (empty($this->errors)) { if (!is_array(Tools::getValue('countries')) || !count(Tools::getValue('countries'))) - $this->errors[] = Tools::displayError('Country selection is invalid'); + $this->errors[] = Tools::displayError('Country selection is invalid.'); else { Configuration::updateValue( @@ -121,7 +121,7 @@ class AdminGeolocationControllerCore extends AdminController { // This field is not declared in class constructor because we want it to be manually post processed $this->fields_options['geolocationCountries']['fields']['countries'] = array( - 'title' => $this->l('Select countries that can access your store:'), + 'title' => $this->l('Select the countries from which your store is accessible'), 'type' => 'checkbox_table', 'identifier' => 'iso_code', 'list' => Country::getCountries($this->context->language->id), @@ -139,7 +139,7 @@ class AdminGeolocationControllerCore extends AdminController if (!$this->isGeoLiteCityAvailable()) $this->displayWarning($this->l('In order to use Geolocation, please download').' '.$this->l('this file').' '. - $this->l('and extract it (using Winrar or Gzip) into the /tools/geoip/ directory')); + $this->l('and extract it (using Winrar or Gzip) into the /tools/geoip/ directory.')); parent::initContent(); } diff --git a/controllers/admin/AdminGroupsController.php b/controllers/admin/AdminGroupsController.php index ef8292c8d..3c8f26a79 100644 --- a/controllers/admin/AdminGroupsController.php +++ b/controllers/admin/AdminGroupsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -36,13 +36,6 @@ class AdminGroupsControllerCore extends AdminController $this->addRowAction('delete'); $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); - $this->_select = ' - (SELECT COUNT(jcg.`id_customer`) - FROM `'._DB_PREFIX_.'customer_group` jcg - LEFT JOIN `'._DB_PREFIX_.'customer` jc ON (jc.`id_customer` = jcg.`id_customer`) - WHERE jc.`deleted` != 1 - AND jcg.`id_group` = a.`id_group`) AS nb'; - $groups_to_keep = array( Configuration::get('PS_UNIDENTIFIED_GROUP'), Configuration::get('PS_GUEST_GROUP'), @@ -90,6 +83,48 @@ class AdminGroupsControllerCore extends AdminController $this->addRowActionSkipList('delete', $groups_to_keep); parent::__construct(); + + $this->_select .= '(SELECT COUNT(jcg.`id_customer`) + FROM `'._DB_PREFIX_.'customer_group` jcg + LEFT JOIN `'._DB_PREFIX_.'customer` jc ON (jc.`id_customer` = jcg.`id_customer`) + WHERE jc.`deleted` != 1 + '.Shop::addSqlRestriction(Shop::SHARE_CUSTOMER).' + AND jcg.`id_group` = a.`id_group`) AS nb'; + + $groups = Group::getGroups(Context::getContext()->language->id, true); + if (Shop::isFeatureActive()) + $this->fields_options = array( + 'general' => array( + 'title' => $this->l('Default groups options'), + 'fields' => array( + 'PS_UNIDENTIFIED_GROUP' => array( + 'title' => $this->l('Visitors group:'), + 'desc' => $this->l('The group defined for your un-identified visitors'), + 'cast' => 'intval', + 'type' => 'select', + 'list' => $groups, + 'identifier' => 'id_group' + ), + 'PS_GUEST_GROUP' => array( + 'title' => $this->l('Guests group:'), + 'desc' => $this->l('The group defined for your identified guest customers (used in guest checkout)'), + 'cast' => 'intval', + 'type' => 'select', + 'list' => $groups, + 'identifier' => 'id_group' + ), + 'PS_CUSTOMER_GROUP' => array( + 'title' => $this->l('Customers group:'), + 'desc' => $this->l('The group defined for your identified customers'), + 'cast' => 'intval', + 'type' => 'select', + 'list' => $groups, + 'identifier' => 'id_group' + ), + ), + 'submit' => array() + ), + ); } public function setMedia() @@ -105,7 +140,7 @@ class AdminGroupsControllerCore extends AdminController $this->toolbar_btn['save-and-stay'] = array( 'short' => 'SaveAndStay', 'href' => '#', - 'desc' => $this->l('Save then add a category reduction'), + 'desc' => $this->l('Save, then add a category reduction'), 'force_desc' => true, ); parent::initToolbar(); @@ -151,14 +186,14 @@ class AdminGroupsControllerCore extends AdminController 'id_gender' => array('title' => $this->l('Titles'), 'align' => 'center', 'width' => 50,'icon' => $genders_icon, 'list' => $genders), 'firstname' => array('title' => $this->l('Name'), 'align' => 'center'), 'lastname' => array('title' => $this->l('Name'), 'align' => 'center'), - 'email' => array('title' => $this->l('E-mail address'), 'width' => 150, 'align' => 'center'), + 'email' => array('title' => $this->l('Email address'), 'width' => 150, 'align' => 'center'), 'birthday' => array('title' => $this->l('Birth date'), 'width' => 150, 'align' => 'right', 'type' => 'date'), 'date_add' => array('title' => $this->l('Register date'), 'width' => 150, 'align' => 'right', 'type' => 'date'), 'orders' => array('title' => $this->l('Orders'), 'align' => 'center'), 'active' => array('title' => $this->l('Enabled'),'align' => 'center','width' => 20, 'active' => 'status','type' => 'bool') )); - $customer_list = $group->getCustomers(false); + $customer_list = $group->getCustomers(false, 0, 0, true); $helper = new HelperList(); $helper->currentIndex = Context::getContext()->link->getAdminLink('AdminCustomers', false); @@ -183,7 +218,7 @@ class AdminGroupsControllerCore extends AdminController 'image' => '../img/admin/tab-groups.gif' ), 'submit' => array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ), 'input' => array( @@ -201,7 +236,7 @@ class AdminGroupsControllerCore extends AdminController 'label' => $this->l('Discount (%):'), 'name' => 'reduction', 'size' => 33, - 'desc' => $this->l('Will automatically apply this value as a discount on all products for members of this customer group.') + 'desc' => $this->l('Automatically apply this value as a discount on all products for members of this customer group.') ), array( 'type' => 'select', @@ -242,7 +277,7 @@ class AdminGroupsControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Customers in this group can view price') + 'desc' => $this->l('Customers in this group can view prices') ), array( 'type' => 'group_discount_category', @@ -277,36 +312,32 @@ class AdminGroupsControllerCore extends AdminController return parent::renderForm(); } - protected function formatCategoryDiscountList($id) + protected function formatCategoryDiscountList($id_group) { - $category = GroupReduction::getGroupReductions((int)$id, $this->context->language->id); + $group_reductions = GroupReduction::getGroupReductions((int)$id_group, $this->context->language->id); $category_reductions = array(); $category_reduction = Tools::getValue('category_reduction'); - foreach ($category as $category) + foreach ($group_reductions as $category) { if (is_array($category_reduction) && array_key_exists($category['id_category'], $category_reduction)) $category['reduction'] = $category_reduction[$category['id_category']]; - $tmp = array(); - $tmp['path'] = getPath(self::$currentIndex.'?tab=AdminCategories', (int)$category['id_category']); - $tmp['reduction'] = (float)$category['reduction'] * 100; - $tmp['id_category'] = (int)$category['id_category']; - $category_reductions[(int)$category['id_category']] = $tmp; + $category_reductions[(int)$category['id_category']] = array( + 'path' => getPath(self::$currentIndex.'?tab=AdminCategories', (int)$category['id_category']), + 'reduction' => (float)$category['reduction'] * 100, + 'id_category' => (int)$category['id_category'] + ); } if (is_array($category_reduction)) foreach ($category_reduction as $key => $val) - { if (!array_key_exists($key, $category_reductions)) - { - $tmp = array(); - $tmp['path'] = getPath(self::$currentIndex.'?tab=AdminCategories', $key); - $tmp['reduction'] = (float)$val * 100; - $tmp['id_category'] = (int)$key; - $category_reductions[(int)$category['id_category']] = $tmp; - } - } + $category_reductions[(int)$key] = array( + 'path' => getPath(self::$currentIndex.'?tab=AdminCategories', $key), + 'reduction' => (float)$val * 100, + 'id_category' => (int)$key + ); return $category_reductions; } @@ -341,7 +372,8 @@ class AdminGroupsControllerCore extends AdminController $auth_modules = $modules; $auth_modules_tmp = array(); foreach ($auth_modules as $key => $val) - $auth_modules_tmp[] = Module::getInstanceById($val['id_module']); + if ($module = Module::getInstanceById($val['id_module'])) + $auth_modules_tmp[] = $module; $auth_modules = $auth_modules_tmp; @@ -358,7 +390,7 @@ class AdminGroupsControllerCore extends AdminController public function processSave() { if (!$this->validateDiscount(Tools::getValue('reduction'))) - $this->errors[] = Tools::displayError('Discount value is incorrect (must be a percentage)'); + $this->errors[] = Tools::displayError('The discount value is incorrect (must be a percentage).'); else { $this->updateCategoryReduction(); @@ -389,7 +421,7 @@ class AdminGroupsControllerCore extends AdminController } else if (!$this->validateDiscount($category_reduction)) { - $result['errors'][] = Tools::displayError('Discount value is incorrect (must be a percentage)'); + $result['errors'][] = Tools::displayError('The discount value is incorrect (must be a percentage).'); $result['hasError'] = true; } else @@ -434,7 +466,7 @@ class AdminGroupsControllerCore extends AdminController foreach ($category_reduction as $cat => $reduction) { if (!Validate::isUnsignedId($cat) || !$this->validateDiscount($reduction)) - $this->errors[] = Tools::displayError('Discount value is incorrect'); + $this->errors[] = Tools::displayError('The discount value is incorrect.'); else { $category = new Category((int)$cat); @@ -444,7 +476,7 @@ class AdminGroupsControllerCore extends AdminController $group_reduction->reduction = (float)($reduction / 100); $group_reduction->id_category = (int)$cat; if (!$group_reduction->save()) - $this->errors[] = Tools::displayError('Cannot save group reductions'); + $this->errors[] = Tools::displayError('You cannot save group reductions.'); } } } @@ -457,10 +489,10 @@ class AdminGroupsControllerCore extends AdminController { $group = new Group($this->id_object); if (!Validate::isLoadedObject($group)) - $this->errors[] = Tools::displayError('An error occurred while updating group.'); + $this->errors[] = Tools::displayError('An error occurred while updating this group.'); $update = Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'group` SET show_prices = '.($group->show_prices ? 0 : 1).' WHERE `id_group` = '.(int)$group->id); if (!$update) - $this->errors[] = Tools::displayError('An error occurred while updating group.'); + $this->errors[] = Tools::displayError('An error occurred while updating this group.'); Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token); } @@ -492,7 +524,7 @@ class AdminGroupsControllerCore extends AdminController ''.$unidentified->name[$this->context->language->id].'' ); $guest_group_information = sprintf( - $this->l('%s - Customer who placed an order with the Guest Checkout.'), + $this->l('%s - Customer who placed an order through Guest Checkout.'), ''.$guest->name[$this->context->language->id].'' ); $default_group_information = sprintf( @@ -500,7 +532,7 @@ class AdminGroupsControllerCore extends AdminController ''.$default->name[$this->context->language->id].'' ); - $this->displayInformation($this->l('You have now three default customer groups.')); + $this->displayInformation($this->l('You now have three default customer groups.')); $this->displayInformation($unidentified_group_information); $this->displayInformation($guest_group_information); $this->displayInformation($default_group_information); diff --git a/controllers/admin/AdminHomeController.php b/controllers/admin/AdminHomeController.php index dee062dfb..67ff97695 100644 --- a/controllers/admin/AdminHomeController.php +++ b/controllers/admin/AdminHomeController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -71,7 +71,7 @@ class AdminHomeControllerCore extends AdminController $indexRebuiltAfterUpdate = 2; $smartyOptimized = 0; - if (Configuration::get('PS_SMARTY_FORCE_COMPILE') == _PS_SMARTY_NO_COMPILE_) + if (in_array(Configuration::get('PS_SMARTY_FORCE_COMPILE'), array(_PS_SMARTY_CHECK_COMPILE_, _PS_SMARTY_NO_COMPILE_))) ++$smartyOptimized; if (Configuration::get('PS_SMARTY_CACHE')) ++$smartyOptimized; @@ -95,7 +95,6 @@ class AdminHomeControllerCore extends AdminController $opti_list = array(); if ($rewrite + $htaccessOptimized + $smartyOptimized + $cccOptimized + $shopEnabled + $htaccessAfterUpdate + $indexRebuiltAfterUpdate != 14) { - $this->context->smarty->assign('hide_tips', Configuration::get('PS_HIDE_OPTIMIZATION_TIPS')); $opti_list[] = array( 'title' => $this->l('URL rewriting'), 'href' => $link->getAdminLink('AdminMeta'), @@ -145,8 +144,12 @@ class AdminHomeControllerCore extends AdminController 'image' => $lights[$htaccessAfterUpdate]['image'], ); } - $this->context->smarty->assign('opti_list', $opti_list); - $this->context->smarty->assign('content', $content); + $this->context->smarty->assign(array( + 'opti_list' => $opti_list, + 'content' => $content, + 'hide_tips' => Configuration::get('PS_HIDE_OPTIMIZATION_TIPS')) + ); + $template = $this->createTemplate('optimizationTips.tpl'); return $template->fetch(); } @@ -166,11 +169,11 @@ class AdminHomeControllerCore extends AdminController return; $shop = Context::getContext()->shop; - if ($_SERVER['HTTP_HOST'] != $shop->domain && $_SERVER['HTTP_HOST'] != $shop->domain_ssl) - $this->displayWarning($this->l('You are currently connected with the following domain name:').' '.$_SERVER['HTTP_HOST'].'
        '. - $this->l('This is different from the main shop domain name set in "Multistore" page under the "Advanced Parameters" menu:').' '.$shop->domain.'
        + if ($_SERVER['HTTP_HOST'] != $shop->domain && $_SERVER['HTTP_HOST'] != $shop->domain_ssl && Tools::getValue('ajax') == false) + $this->displayWarning($this->l('You are currently connected under the following domain name:').' '.$_SERVER['HTTP_HOST'].'
        '. + $this->l('This is different from the main shop domain name set in the "Multistore" page under the "Advanced Parameters" menu:').' '.$shop->domain.'
        '. - $this->l('Click here if you want to modify the main shop domain name').''); + $this->l('Click here if you want to modify your main shop\'s domain name.').''); } protected function getQuickLinks() @@ -181,7 +184,7 @@ class AdminHomeControllerCore extends AdminController if ($profile_access[(int)Tab::getIdFromClassName('AdminStats')]['view']) $quick_links['first'] = array( 'href' => $this->context->link->getAdminLink('AdminStats').'&module=statsbestproducts', - 'title' => $this->l('Products sold recently'), + 'title' => $this->l('Recently sold products.'), 'description' => $this->l('Create a new category and organize your catalog.'), ); @@ -195,14 +198,14 @@ class AdminHomeControllerCore extends AdminController if ($profile_access[(int)Tab::getIdFromClassName('AdminSpecificPriceRule')]['add']) $quick_links['third'] = array( 'href' => $this->context->link->getAdminLink('AdminSpecificPriceRule').'&addspecific_price_rule', - 'title' => $this->l('New Price Rule for catalog'), + 'title' => $this->l('New price rule for catalog'), 'description' => $this->l('Monitor your activity with a thorough analysis of your shop.'), ); if ($profile_access[(int)Tab::getIdFromClassName('AdminProducts')]['add']) $quick_links['fourth'] = array( 'href' => $this->context->link->getAdminLink('AdminProducts').'&addproduct', - 'title' => $this->l('New Product'), + 'title' => $this->l('New product'), 'description' => $this->l('Add a new employee account and discharge a part of your duties as shop owner.'), ); @@ -210,28 +213,28 @@ class AdminHomeControllerCore extends AdminController $quick_links['fifth'] = array( 'href' => $this->context->link->getAdminLink('AdminModules'), 'title' => $this->l('New module'), - 'description' => $this->l('Configure your modules.'), + 'description' => $this->l('Configure your modules'), ); if ($profile_access[(int)Tab::getIdFromClassName('AdminCartRules')]['add']) $quick_links['sixth'] = array( 'href' => $this->context->link->getAdminLink('AdminCartRules').'&addcart_rule', - 'title' => $this->l('New Price Rule for cart'), - 'description' => $this->l('Add new cart rule.'), + 'title' => $this->l('New price rule for cart'), + 'description' => $this->l('Add new cart rule'), ); if ($profile_access[(int)Tab::getIdFromClassName('AdminCmsContent')]['add']) $quick_links['seventh'] = array( 'href' => $this->context->link->getAdminLink('AdminCmsContent').'&addcms', - 'title' => $this->l('New Page CMS'), + 'title' => $this->l('New CMS page'), 'description' => $this->l('Add a new CMS page.'), ); if ($profile_access[(int)Tab::getIdFromClassName('AdminCarts')]['view']) $quick_links['eighth'] = array( 'href' => $this->context->link->getAdminLink('AdminCarts').'&id_cart', - 'title' => $this->l('Abandoned Carts'), - 'description' => $this->l('View your customer carts.'), + 'title' => $this->l('Abandoned shopping carts'), + 'description' => $this->l('View your customer\'s carts.'), ); return $quick_links; } @@ -374,12 +377,13 @@ class AdminHomeControllerCore extends AdminController $chart = new Chart(); $chart->getCurve(1)->setType('bars'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT total_paid / conversion_rate as total_converted, left(invoice_date, 10) as invoice_date + SELECT SUM(total_paid / conversion_rate) as total_converted, left(invoice_date, 10) as invoice_date FROM '._DB_PREFIX_.'orders o WHERE valid = 1 AND total_paid > 0 AND invoice_date BETWEEN \''.date('Y-m-d', strtotime('-7 DAYS', time())).' 00:00:00\' AND \''.date('Y-m-d H:i:s').'\' - '.Shop::addSqlRestriction(Shop::SHARE_ORDER).' + '.Shop::addSqlRestriction(Shop::SHARE_ORDER).' + GROUP BY DATE(invoice_date) '); foreach ($result as $row) $chart->getCurve(1)->setPoint(strtotime($row['invoice_date'].' 02:00:00'), $row['total_converted']); @@ -454,7 +458,7 @@ class AdminHomeControllerCore extends AdminController if (Configuration::updateValue('PS_HIDE_OPTIMIZATION_TIPS', 1)) { $result['result'] = 'ok'; - $result['msg'] = $this->l('Optimization Tips will be hidden by default'); + $result['msg'] = $this->l('Optimization Tips will be hidden by default.'); } else { @@ -477,24 +481,18 @@ class AdminHomeControllerCore extends AdminController $stream_context = @stream_context_create(array('http' => array('method'=> 'GET', 'timeout' => 2))); // SCREENCAST - if (@fsockopen('screencasts.prestashop.com', 80, $errno, $errst, AdminHomeController::TIPS_TIMEOUT)) - $result['screencast'] = 'OK'; - else - $result['screencast'] = 'NOK'; + $result['screencast'] = 'OK'; + // PREACTIVATION $result['partner_preactivation'] = $this->getBlockPartners(); // DISCOVER PRESTASHOP $result['discover_prestashop'] = '
        '.$this->getBlockDiscover().'
        '; - - if (@fsockopen('api.prestashop.com', 80, $errno, $errst, AdminHomeController::TIPS_TIMEOUT)) - $result['discover_prestashop'] .= '
        '; - else - $result['discover_prestashop'] .= ''; + $result['discover_prestashop'] .= '
        '; // SHOW TIPS OF THE DAY - $content = @file_get_contents($protocol.'://api.prestashop.com/partner/tipsoftheday/?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser), false, $stream_context); + $content = Tools::file_get_contents($protocol.'://api.prestashop.com/partner/tipsoftheday/?protocol='.$protocol.'&iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser), false, $stream_context); $content = explode('|', $content); if ($content[0] == 'OK' && Validate::isCleanHtml($content[1])) $result['discover_prestashop'] .= '
        '.$content[1].'
        '; @@ -541,8 +539,12 @@ class AdminHomeControllerCore extends AdminController { // Cache the logo if (!file_exists('../img/tmp/preactivation_'.htmlentities((string)$partner->module).'.png')) - @copy(htmlentities((string)$partner->logo), '../img/tmp/preactivation_'.htmlentities((string)$partner->module).'.png'); - + { + $logo = Tools::file_get_contents(htmlentities((string)$partner->logo)); + if (sizeof($logo) > 0) + file_put_contents('../img/tmp/preactivation_'.htmlentities((string)$partner->module).'.png', $logo); + } + // Check if module is not already installed and configured $display = 0; if (file_exists('../config/xml/default_country_modules_list.xml') && filesize('../config/xml/default_country_modules_list.xml') > 10) @@ -564,12 +566,12 @@ class AdminHomeControllerCore extends AdminController if (empty($optional_final) && (string)$optional->attributes()->iso == $isoUser) $optional_final = (string)$optional; - $link = 'index.php?controller=adminmodules&install='.htmlentities((string)$partner->module).'&token='.Tools::getAdminTokenLite('AdminModules').'&module_name='.htmlentities((string)$partner->module).'&redirect=config'; + $link = 'index.php?controller=adminmodules&install='.Tools::htmlentitiesUTF8((string)$partner->module).'&token='.Tools::getAdminTokenLite('AdminModules').'&module_name='.Tools::htmlentitiesUTF8((string)$partner->module).'&redirect=config'; $return .= '

        - '.htmlentities((string)$partner->name).'
        - '.htmlentities(utf8_decode((string)$label_final)).' - '.(($optional_final != '') ? '' : '').' + '.htmlentities((string)$partner->name).'
        + '.Tools::htmlentitiesUTF8($label_final).' + '.(($optional_final != '') ? '' : '').'

        '; $count++; @@ -618,7 +620,7 @@ class AdminHomeControllerCore extends AdminController $firstname = $employee->firstname; $lastname = $employee->lastname; $email = $employee->email; - $return = @file_get_contents('http://api.prestashop.com/partner/premium/set_request.php?iso_country='.strtoupper($isoCountry).'&iso_lang='.strtolower($isoUser).'&host='.urlencode($_SERVER['HTTP_HOST']).'&ps_version='._PS_VERSION_.'&ps_creation='._PS_CREATION_DATE_.'&partner='.htmlentities(Tools::getValue('module')).'&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&email='.urlencode($email).'&firstname='.urlencode($firstname).'&lastname='.urlencode($lastname).'&type=home'); + $return = @Tools::file_get_contents('http://api.prestashop.com/partner/premium/set_request.php?iso_country='.strtoupper($isoCountry).'&iso_lang='.strtolower($isoUser).'&host='.urlencode($_SERVER['HTTP_HOST']).'&ps_version='._PS_VERSION_.'&ps_creation='._PS_CREATION_DATE_.'&partner='.htmlentities(Tools::getValue('module')).'&shop='.urlencode(Configuration::get('PS_SHOP_NAME')).'&email='.urlencode($email).'&firstname='.urlencode($firstname).'&lastname='.urlencode($lastname).'&type=home'); die($return); } @@ -631,7 +633,7 @@ class AdminHomeControllerCore extends AdminController $isoUser = Context::getContext()->language->iso_code; $isoCountry = Context::getContext()->country->iso_code; - $content = @file_get_contents($protocol.'://api.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&ps_version='.urlencode(_PS_VERSION_), false, $stream_context); + $content = @Tools::file_get_contents($protocol.'://api.prestashop.com/partner/prestashop/prestashop-link.php?iso_country='.$isoCountry.'&iso_lang='.Tools::strtolower($isoUser).'&id_lang='.(int)Context::getContext()->language->id.'&ps_version='.urlencode(_PS_VERSION_), false, $stream_context); if (!$content) return ''; // NOK @@ -667,7 +669,7 @@ class AdminHomeControllerCore extends AdminController } if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 86400)) - file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, $this->addonsRequest('native')); + file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native')); $tpl_vars['upgrade'] = $upgrade; diff --git a/controllers/admin/AdminImagesController.php b/controllers/admin/AdminImagesController.php index e5851926d..8791cd27f 100644 --- a/controllers/admin/AdminImagesController.php +++ b/controllers/admin/AdminImagesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -28,6 +28,7 @@ class AdminImagesControllerCore extends AdminController { protected $start_time = 0; protected $max_execution_time = 7200; + protected $display_move; public function __construct() { @@ -40,7 +41,7 @@ class AdminImagesControllerCore extends AdminController $this->fields_list = array( 'id_image_type' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), - 'name' => array('title' => $this->l('Name'), 'width' => 300), + 'name' => array('title' => $this->l('Name'), 'width' => 'auto'), 'width' => array('title' => $this->l('Width'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5), 'height' => array('title' => $this->l('Height'), 'align' => 'right', 'suffix' => ' px', 'width' => 50, 'size' => 5), 'products' => array('title' => $this->l('Products'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), @@ -50,26 +51,29 @@ class AdminImagesControllerCore extends AdminController 'scenes' => array('title' => $this->l('Scenes'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false), 'stores' => array('title' => $this->l('Stores'), 'width' => 50, 'align' => 'center', 'type' => 'bool', 'callback' => 'printEntityActiveIcon', 'orderby' => false) ); + + // No need to display the old image system if the install has been made later than 2013-03-26 + $this->display_move = (!Configuration::get('PS_LEGACY_IMAGES') && defined('_PS_CREATION_DATE_') && strtotime(_PS_CREATION_DATE_) > strtotime('2013-03-26')) ? false : true; $this->fields_options = array( 'images' => array( - 'title' => $this->l('Images'), + 'title' => $this->l('images'), 'icon' => 'tab-orders', 'top' => '', 'bottom' => '', - 'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a bigger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').' -

        '.$this->l('WARNING: This feature may not be compatible with your theme or with some modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'), + 'description' => $this->l('JPEG images have a small file size and standard quality. PNG images have a larger file size, a higher quality and support transparency. Note that in all cases the image files will have the .jpg extension.').' +

        '.$this->l('WARNING: This feature may not be compatible with your theme, or with some of your modules. In particular, PNG mode is not compatible with the Watermark module. If you encounter any issues, turn it off by selecting "Use JPEG".'), 'fields' => array( 'PS_IMAGE_QUALITY' => array( 'title' => $this->l('Image quality'), 'show' => true, 'required' => true, 'type' => 'radio', - 'choices' => array('jpg' => $this->l('Use JPEG'), 'png' => $this->l('Use PNG only if the base image is in PNG format'), 'png_all' => $this->l('Use PNG for all images')) + 'choices' => array('jpg' => $this->l('Use JPEG'), 'png' => $this->l('Use PNG only if the base image is in PNG format.'), 'png_all' => $this->l('Use PNG for all images')) ), 'PS_JPEG_QUALITY' => array( 'title' => $this->l('JPEG quality'), - 'desc' => $this->l('Ranges from 0 (worst quality, smallest file) to 100 (best quality, biggest file)'), + 'desc' => $this->l('Ranges from 0 (worst quality, smallest file) to 100 (best quality, biggest file).'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', @@ -77,7 +81,7 @@ class AdminImagesControllerCore extends AdminController ), 'PS_PNG_QUALITY' => array( 'title' => $this->l('PNG quality'), - 'desc' => $this->l('Ranges from 9 (worst quality, smallest file) to 0 (best quality, biggest file)'), + 'desc' => $this->l('Ranges from 9 (worst quality, smallest file) to 0 (best quality, biggest file).'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', @@ -98,15 +102,15 @@ class AdminImagesControllerCore extends AdminController 'list' => array( array( 'id' => '0', - 'name' => $this->l('auto') + 'name' => $this->l('Auto') ), array( 'id' => '1', - 'name' => $this->l('width') + 'name' => $this->l('Width') ), array( 'id' => '2', - 'name' => $this->l('height') + 'name' => $this->l('Height') ) ), 'identifier' => 'id', @@ -114,18 +118,18 @@ class AdminImagesControllerCore extends AdminController ), 'PS_PRODUCT_PICTURE_MAX_SIZE' => array( 'title' => $this->l('Maximum size of product pictures'), - 'desc' => $this->l('The maximum size of pictures uploadable by customers (in Bytes)'), - 'validation' => 'isUnsignedId', + 'desc' => $this->l('The maximum size of pictures uploadable by customers (in Bytes).'), + 'validation' => 'isUnsignedInt', 'required' => true, 'cast' => 'intval', 'type' => 'text', - 'suffix' => $this->l('bytes'), + 'suffix' => $this->l('Bytes'), 'visibility' => Shop::CONTEXT_ALL ), 'PS_PRODUCT_PICTURE_WIDTH' => array( 'title' => $this->l('Product picture width'), - 'desc' => $this->l('The maximum width of pictures uploadable by customers'), - 'validation' => 'isUnsignedId', + 'desc' => $this->l('The maximum width of pictures uploadable by customers.'), + 'validation' => 'isUnsignedInt', 'required' => true, 'cast' => 'intval', 'type' => 'text', @@ -134,44 +138,46 @@ class AdminImagesControllerCore extends AdminController ), 'PS_PRODUCT_PICTURE_HEIGHT' => array( 'title' => $this->l('Product picture height'), - 'desc' => $this->l('The maximum height of pictures uploadable by customers'), - 'validation' => 'isUnsignedId', + 'desc' => $this->l('The maximum height of pictures uploadable by customers.'), + 'validation' => 'isUnsignedInt', 'required' => true, 'cast' => 'intval', 'type' => 'text', 'height' => 'px', 'visibility' => Shop::CONTEXT_ALL - ), - 'PS_LEGACY_IMAGES' => array( - 'title' => $this->l('Use the legacy image filesystem'), - 'desc' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu'), - 'validation' => 'isBool', - 'cast' => 'intval', - 'required' => false, - 'type' => 'bool', - 'visibility' => Shop::CONTEXT_ALL - ), + ) ), - 'submit' => array('title' => $this->l(' Save '), 'class' => 'button'), + 'submit' => array('title' => $this->l('Save '), 'class' => 'button'), ), ); + + if ($this->display_move) + $this->fields_options['product_images']['fields']['PS_LEGACY_IMAGES'] = array( + 'title' => $this->l('Use the legacy image filesystem'), + 'desc' => $this->l('This should be set to yes unless you successfully moved images in "Images" page under the "Preferences" menu.'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'required' => false, + 'type' => 'bool', + 'visibility' => Shop::CONTEXT_ALL + ); $this->fields_form = array( 'legend' => array( - 'title' => $this->l('Images'), + 'title' => $this->l('images'), 'image' => '../img/admin/picture.gif' ), 'input' => array( array( 'type' => 'text', - 'label' => $this->l('Type name:'), + 'label' => $this->l('Type name'), 'name' => 'name', 'required' => true, - 'desc' => $this->l('Letters and minus sign (-) only (e.g. small, medium, large, extra-large)') + 'desc' => $this->l('Letters and hyphens only (e.g. small, medium, large, extra-large)') ), array( 'type' => 'text', - 'label' => $this->l('Width:'), + 'label' => $this->l('Width'), 'name' => 'width', 'required' => true, 'size' => 4, @@ -180,7 +186,7 @@ class AdminImagesControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('Height:'), + 'label' => $this->l('Height'), 'name' => 'height', 'required' => true, 'size' => 4, @@ -189,7 +195,7 @@ class AdminImagesControllerCore extends AdminController ), array( 'type' => 'radio', - 'label' => $this->l('Products:'), + 'label' => $this->l('Products'), 'name' => 'products', 'required' => false, 'class' => 't', @@ -210,12 +216,12 @@ class AdminImagesControllerCore extends AdminController ), array( 'type' => 'radio', - 'label' => $this->l('Categories:'), + 'label' => $this->l('Categories'), 'name' => 'categories', 'required' => false, 'class' => 't', 'is_bool' => true, - 'desc' => $this->l('This type will be applied to Category images'), + 'desc' => $this->l('This type will be applied to Category images.'), 'values' => array( array( 'id' => 'categories_on', @@ -231,12 +237,12 @@ class AdminImagesControllerCore extends AdminController ), array( 'type' => 'radio', - 'label' => $this->l('Manufacturers:'), + 'label' => $this->l('Manufacturers'), 'name' => 'manufacturers', 'required' => false, 'class' => 't', 'is_bool' => true, - 'desc' => $this->l('This type will be applied to Manufacturer images'), + 'desc' => $this->l('This type will be applied to Manufacturer images.'), 'values' => array( array( 'id' => 'manufacturers_on', @@ -252,12 +258,12 @@ class AdminImagesControllerCore extends AdminController ), array( 'type' => 'radio', - 'label' => $this->l('Suppliers:'), + 'label' => $this->l('Suppliers'), 'name' => 'suppliers', 'required' => false, 'class' => 't', 'is_bool' => true, - 'desc' => $this->l('This type will be used for Supplier images'), + 'desc' => $this->l('This type will be used for Supplier images.'), 'values' => array( array( 'id' => 'suppliers_on', @@ -273,12 +279,12 @@ class AdminImagesControllerCore extends AdminController ), array( 'type' => 'radio', - 'label' => $this->l('Scenes:'), + 'label' => $this->l('Scenes'), 'name' => 'scenes', 'required' => false, 'class' => 't', 'is_bool' => true, - 'desc' => $this->l('This type will be used for Scene images'), + 'desc' => $this->l('This type will be used for Scene images.'), 'values' => array( array( 'id' => 'scenes_on', @@ -294,12 +300,12 @@ class AdminImagesControllerCore extends AdminController ), array( 'type' => 'radio', - 'label' => $this->l('Stores:'), + 'label' => $this->l('Stores'), 'name' => 'stores', 'required' => false, 'class' => 't', 'is_bool' => true, - 'desc' => $this->l('This type will be used for Store images'), + 'desc' => $this->l('This type will be used for Store images.'), 'values' => array( array( 'id' => 'stores_on', @@ -315,7 +321,7 @@ class AdminImagesControllerCore extends AdminController ), ), 'submit' => array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ) ); @@ -329,9 +335,9 @@ class AdminImagesControllerCore extends AdminController // When moving images, if duplicate images were found they are moved to a folder named duplicates/ if (file_exists(_PS_PROD_IMG_DIR_.'duplicates/')) { - $this->warnings[] = $this->l('Duplicate images were found when moving the product images. This is likely caused by unused demonstration images. Please make sure that the folder '). + $this->warnings[] = $this->l('Duplicate images were found when moving the product images. This is likely caused by unused demonstration images. Please make sure that the folder'). _PS_PROD_IMG_DIR_.'duplicates/'. - $this->l('only contains demonstration images, and then delete this folder.'); + $this->l('only contains demonstration images, and then delete it.'); } if (Tools::getValue('submitRegenerate'.$this->table)) @@ -342,7 +348,7 @@ class AdminImagesControllerCore extends AdminController Tools::redirectAdmin(self::$currentIndex.'&conf=9'.'&token='.$this->token); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::getValue('submitMoveImages'.$this->table)) { @@ -352,7 +358,7 @@ class AdminImagesControllerCore extends AdminController Tools::redirectAdmin(self::$currentIndex.'&conf=25'.'&token='.$this->token); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::getValue('submitImagePreferences')) { @@ -360,23 +366,24 @@ class AdminImagesControllerCore extends AdminController { if ((int)Tools::getValue('PS_JPEG_QUALITY') < 0 || (int)Tools::getValue('PS_JPEG_QUALITY') > 100) - $this->errors[] = Tools::displayError('Incorrect value for JPEG image quality.'); + $this->errors[] = Tools::displayError('Incorrect value for the selected JPEG image quality.'); elseif ((int)Tools::getValue('PS_PNG_QUALITY') < 0 || (int)Tools::getValue('PS_PNG_QUALITY') > 9) - $this->errors[] = Tools::displayError('Incorrect value for PNG image quality.'); + $this->errors[] = Tools::displayError('Incorrect value for the selected PNG image quality.'); elseif (!Configuration::updateValue('PS_IMAGE_QUALITY', Tools::getValue('PS_IMAGE_QUALITY')) || !Configuration::updateValue('PS_JPEG_QUALITY', Tools::getValue('PS_JPEG_QUALITY')) || !Configuration::updateValue('PS_PNG_QUALITY', Tools::getValue('PS_PNG_QUALITY'))) $this->errors[] = Tools::displayError('Unknown error.'); else - Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); + $this->confirmations[] = $this->_conf[6]; + return parent::postProcess(); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else - parent::postProcess(); + return parent::postProcess(); } public static function printEntityActiveIcon($value, $object) @@ -613,12 +620,12 @@ class AdminImagesControllerCore extends AdminController $this->errors[] = sprintf(Tools::displayError('Cannot write %s images. Please check the folder\'s writing permissions %s.'), $proc['type'], $proc['dir']); } elseif ($return == 'timeout') - $this->errors[] = Tools::displayError('Only part of the images have been regenerated, server timed out before finishing.'); + $this->errors[] = Tools::displayError('Only part of the images have been regenerated. The server timed out before finishing.'); else { if ($proc['type'] == 'products') if ($this->_regenerateWatermark($proc['dir']) == 'timeout') - $this->errors[] = Tools::displayError('Server timed out, the watermark may not have been applied to all images.'); + $this->errors[] = Tools::displayError('Server timed out. The watermark may not have been applied to all images.'); if (!count($this->errors)) if ($this->_regenerateNoPictureImages($proc['dir'], $formats, $languages)) $this->errors[] = sprintf( @@ -647,16 +654,16 @@ class AdminImagesControllerCore extends AdminController protected function _moveImagesToNewFileSystem() { if (!Image::testFileSystem()) - $this->errors[] = Tools::displayError('Error: your server configuration is not compatible with the new image system. No images were moved'); + $this->errors[] = Tools::displayError('Error: Your server configuration is not compatible with the new image system. No images were moved.'); else { ini_set('max_execution_time', $this->max_execution_time); // ini_set may be disabled, we need the real value $this->max_execution_time = (int)ini_get('max_execution_time'); $result = Image::moveToNewFileSystem($this->max_execution_time); if ($result === 'timeout') - $this->errors[] = Tools::displayError('Not all images have been moved, server timed out before finishing. Click on "Move images" again to resume moving images'); + $this->errors[] = Tools::displayError('Not all images have been moved. The server timed out before finishing. Click on "Move images" again to resume the moving process.'); else if ($result === false) - $this->errors[] = Tools::displayError('Error: some or all images could not be moved.'); + $this->errors[] = Tools::displayError('Error: Some -- or all -- images can not be moved.'); } return (count($this->errors) > 0 ? false : true); } @@ -670,7 +677,7 @@ class AdminImagesControllerCore extends AdminController $this->context->smarty->assign(array( 'display_regenerate' => true, - 'display_move' => true + 'display_move' => $this->display_move )); } diff --git a/controllers/admin/AdminImportController.php b/controllers/admin/AdminImportController.php index a6c0ddcf1..e267e3b0f 100644 --- a/controllers/admin/AdminImportController.php +++ b/controllers/admin/AdminImportController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -96,8 +96,8 @@ class AdminImportControllerCore extends AdminController $this->entities = array_merge( $this->entities, array( - $this->l('SupplyOrders'), - $this->l('SupplyOrdersDetails'), + $this->l('Supply Orders'), + $this->l('Supply Order Details'), ) ); } @@ -142,7 +142,7 @@ class AdminImportControllerCore extends AdminController ), 'shop' => array( 'label' => $this->l('ID / Name of shop'), - 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, default shop will be used'), + 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.'), ) ); @@ -170,17 +170,17 @@ class AdminImportControllerCore extends AdminController 'parent' => array('label' => $this->l('Parent category')), 'is_root_category' => array( 'label' => $this->l('Root category (0/1)'), - 'help' => $this->l('A category root is where a category tree can begin. This is used with multistore') + 'help' => $this->l('A category root is where a category tree can begin. This is used with multistore.') ), 'description' => array('label' => $this->l('Description')), - 'meta_title' => array('label' => $this->l('Meta-title')), - 'meta_keywords' => array('label' => $this->l('Meta-keywords')), - 'meta_description' => array('label' => $this->l('Meta-description')), + 'meta_title' => array('label' => $this->l('Meta title')), + 'meta_keywords' => array('label' => $this->l('Meta keywords')), + 'meta_description' => array('label' => $this->l('Meta description')), 'link_rewrite' => array('label' => $this->l('URL rewritten')), 'image' => array('label' => $this->l('Image URL')), 'shop' => array( 'label' => $this->l('ID / Name of shop'), - 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, default shop will be used'), + 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.'), ), ); @@ -203,8 +203,8 @@ class AdminImportControllerCore extends AdminController 'active' => array('label' => $this->l('Active (0/1)')), 'name' => array('label' => $this->l('Name *')), 'category' => array('label' => $this->l('Categories (x,y,z...)')), - 'price_tex' => array('label' => $this->l('Price tax excl.')), - 'price_tin' => array('label' => $this->l('Price tax incl.')), + 'price_tex' => array('label' => $this->l('Price tax excluded')), + 'price_tin' => array('label' => $this->l('Price tax included')), 'id_tax_rules_group' => array('label' => $this->l('Tax rules ID')), 'wholesale_price' => array('label' => $this->l('Wholesale price')), 'on_sale' => array('label' => $this->l('On sale (0/1)')), @@ -224,9 +224,9 @@ class AdminImportControllerCore extends AdminController 'description_short' => array('label' => $this->l('Short description')), 'description' => array('label' => $this->l('Description')), 'tags' => array('label' => $this->l('Tags (x,y,z...)')), - 'meta_title' => array('label' => $this->l('Meta-title')), - 'meta_keywords' => array('label' => $this->l('Meta-keywords')), - 'meta_description' => array('label' => $this->l('Meta-description')), + 'meta_title' => array('label' => $this->l('Meta title')), + 'meta_keywords' => array('label' => $this->l('Meta keywords')), + 'meta_description' => array('label' => $this->l('Meta description')), 'link_rewrite' => array('label' => $this->l('URL rewritten')), 'available_now' => array('label' => $this->l('Text when in stock')), 'available_later' => array('label' => $this->l('Text when backorder allowed')), @@ -242,7 +242,7 @@ class AdminImportControllerCore extends AdminController 'condition' => array('label' => $this->l('Condition')), 'shop' => array( 'label' => $this->l('ID / Name of shop'), - 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, default shop will be used'), + 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.'), ) ); @@ -271,16 +271,16 @@ class AdminImportControllerCore extends AdminController 'id' => array('label' => $this->l('ID')), 'active' => array('label' => $this->l('Active (0/1)')), 'id_gender' => array('label' => $this->l('Titles ID (Mr = 1, Ms = 2, else 0)')), - 'email' => array('label' => $this->l('E-mail *')), + 'email' => array('label' => $this->l('Email *')), 'passwd' => array('label' => $this->l('Password *')), 'birthday' => array('label' => $this->l('Birthday (yyyy-mm-dd)')), - 'lastname' => array('label' => $this->l('Lastname *')), - 'firstname' => array('label' => $this->l('Firstname *')), + 'lastname' => array('label' => $this->l('Last Name *')), + 'firstname' => array('label' => $this->l('First Name *')), 'newsletter' => array('label' => $this->l('Newsletter (0/1)')), 'optin' => array('label' => $this->l('Opt-in (0/1)')), 'id_shop' => array( 'label' => $this->l('ID / Name of shop'), - 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, default shop will be used'), + 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.'), ), ); @@ -307,16 +307,16 @@ class AdminImportControllerCore extends AdminController 'id' => array('label' => $this->l('ID')), 'alias' => array('label' => $this->l('Alias *')), 'active' => array('label' => $this->l('Active (0/1)')), - 'customer_email' => array('label' => $this->l('Customer e-mail')), - 'id_customer' => array('label' => $this->l('Customer ID')), + 'customer_email' => array('label' => $this->l('Customer email')), + 'id_customer' => array('label' => $this->l('Customer ID:')), 'manufacturer' => array('label' => $this->l('Manufacturer')), 'supplier' => array('label' => $this->l('Supplier')), 'company' => array('label' => $this->l('Company')), - 'lastname' => array('label' => $this->l('Lastname *')), - 'firstname' => array('label' => $this->l('Firstname *')), + 'lastname' => array('label' => $this->l('Last Name *')), + 'firstname' => array('label' => $this->l('First Name *')), 'address1' => array('label' => $this->l('Address 1 *')), 'address2' => array('label' => $this->l('Address 2')), - 'postcode' => array('label' => $this->l('Postcode*/ Zipcode*')), + 'postcode' => array('label' => $this->l('Postal code / Zipcode*')), 'city' => array('label' => $this->l('City *')), 'country' => array('label' => $this->l('Country *')), 'state' => array('label' => $this->l('State')), @@ -350,12 +350,12 @@ class AdminImportControllerCore extends AdminController 'name' => array('label' => $this->l('Name *')), 'description' => array('label' => $this->l('Description')), 'short_description' => array('label' => $this->l('Short description')), - 'meta_title' => array('label' => $this->l('Meta-title')), - 'meta_keywords' => array('label' => $this->l('Meta-keywords')), - 'meta_description' => array('label' => $this->l('Meta-description')), + 'meta_title' => array('label' => $this->l('Meta title')), + 'meta_keywords' => array('label' => $this->l('Meta keywords')), + 'meta_description' => array('label' => $this->l('Meta description')), 'shop' => array( 'label' => $this->l('ID / Name of group shop'), - 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, default shop will be used'), + 'help' => $this->l('Ignore this field if you don\'t use the Multistore tool. If you leave this field empty, the default shop will be used.'), ), ); @@ -364,7 +364,7 @@ class AdminImportControllerCore extends AdminController ); break; // @since 1.5.0 - case $this->entities[$this->l('SupplyOrders')]: + case $this->entities[$this->l('Supply Orders')]: if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { // required fields @@ -397,7 +397,7 @@ class AdminImportControllerCore extends AdminController } break; // @since 1.5.0 - case $this->entities[$this->l('SupplyOrdersDetails')]: + case $this->entities[$this->l('Supply Order Details')]: if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { // required fields @@ -439,7 +439,7 @@ class AdminImportControllerCore extends AdminController public function renderForm() { if (!is_writable(_PS_ADMIN_DIR_.'/import/')) - $this->displayWarning($this->l('directory import on admin directory must be writable (CHMOD 755 / 777)')); + $this->displayWarning($this->l('Directory import on admin directory must be writable (CHMOD 755 / 777)')); if (isset($this->warnings) && count($this->warnings)) { @@ -601,7 +601,7 @@ class AdminImportControllerCore extends AdminController $this->content .= $this->renderView(); else { - $this->errors[] = $this->l('You must upload a file for go to the next step'); + $this->errors[] = $this->l('You must upload a file in order to proceed to the next step'); $this->content .= $this->renderForm(); } else @@ -638,20 +638,24 @@ class AdminImportControllerCore extends AdminController if (empty($field)) return array(); - if (is_null(Tools::getValue('multiple_value_separator')) || trim(Tools::getValue('multiple_value_separator')) == '') + $separator = Tools::getValue('multiple_value_separator'); + if (is_null($separator) || trim($separator) == '') $separator = ','; - else - $separator = Tools::getValue('multiple_value_separator'); - $temp = tmpfile(); - fwrite($temp, $field); - rewind($temp); - $tab = fgetcsv($temp, MAX_LINE_SIZE, $separator); - fclose($temp); + do $uniqid_path = _PS_UPLOAD_DIR_.uniqid(); while (file_exists($uniqid_path)); + file_put_contents($uniqid_path, $field); + $tab = ''; + if (!empty($uniqid_path)) + { + $fd = fopen($uniqid_path, 'r'); + $tab = fgetcsv($fd, MAX_LINE_SIZE, $separator); + fclose($fd); + unlink($uniqid_path); + } + if (empty($tab) || (!is_array($tab))) return array(); return $tab; - } protected static function createMultiLangField($field) @@ -727,8 +731,9 @@ class AdminImportControllerCore extends AdminController public static function getMaskedRow($row) { $res = array(); - foreach (self::$column_mask as $type => $nb) - $res[$type] = isset($row[$nb]) ? $row[$nb] : null; + if (is_array(self::$column_mask)) + foreach (self::$column_mask as $type => $nb) + $res[$type] = isset($row[$nb]) ? $row[$nb] : null; if (Tools::getValue('forceIds')) // if you choose to force table before import the column id is remove from the CSV file. unset($res['id']); @@ -814,7 +819,7 @@ class AdminImportControllerCore extends AdminController // 'file_exists' doesn't work on distant file, and getimagesize make the import slower. // Just hide the warning, the traitment will be the same. - if (@copy($url, $tmpfile)) + if (Tools::copy($url, $tmpfile)) { ImageManager::resize($tmpfile, $path.'.jpg'); $images_types = ImageType::getImagesTypes($entity); @@ -850,7 +855,7 @@ class AdminImportControllerCore extends AdminController $tab_categ = array(Configuration::get('PS_HOME_CATEGORY'), Configuration::get('PS_ROOT_CATEGORY')); if (isset($info['id']) && in_array((int)$info['id'], $tab_categ)) { - $this->errors[] = Tools::displayError('The ID category cannot be the same as the ID Root category, nor the ID Home category'); + $this->errors[] = Tools::displayError('The ID category cannot be the same as the ID Root category or the ID Home category.'); continue; } AdminImportController::setDefaultValues($info); @@ -899,7 +904,7 @@ class AdminImportControllerCore extends AdminController $category_to_create->name[$default_language_id], (isset($category_to_create->id) ? $category_to_create->id : 'null') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -949,6 +954,12 @@ class AdminImportControllerCore extends AdminController $cat_moved[$category->id] = (int)$category_already_created['id_category']; $category->id = (int)$category_already_created['id_category']; } + + if ($category->id && $category->id == $category->id_parent) + { + $this->errors[] = Tools::displayError('a category cannot be its own parent'); + continue; + } /* No automatic nTree regeneration for import */ $category->doNotRegenerateNTree = true; @@ -958,7 +969,7 @@ class AdminImportControllerCore extends AdminController if ($category->id && $category->categoryExists($category->id) && !in_array($category->id, $categories_home_root)) $res = $category->update(); if ($category->id == Configuration::get('PS_ROOT_CATEGORY')) - $this->errors[] = Tools::displayError('Root category cannot be modified'); + $this->errors[] = Tools::displayError('The root category cannot be modified.'); // If no id_category or update failed if (!$res) $res = $category->add(); @@ -966,16 +977,16 @@ class AdminImportControllerCore extends AdminController //copying images of categories if (isset($category->image) && !empty($category->image)) if (!(AdminImportController::copyImg($category->id, null, $category->image, 'categories'))) - $this->warnings[] = $category->image.' '.Tools::displayError('cannot be copied'); + $this->warnings[] = $category->image.' '.Tools::displayError('cannot be copied.'); // If both failed, mysql error if (!$res) { $this->errors[] = sprintf( Tools::displayError('%1$s (ID: %2$s) cannot be saved'), - $info['name'], - (isset($info['id']) ? $info['id'] : 'null') + (isset($info['name']) ? Tools::safeOutput($info['name']) : 'No Name'), + (isset($info['id']) ? Tools::safeOutput($info['id']) : 'No ID') ); - $error_tmp = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : '').Db::getInstance()->getMsgError(); + $error_tmp = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : '').Db::getInstance()->getMsgError(); if ($error_tmp != '') $this->errors[] = $error_tmp; } @@ -1018,6 +1029,7 @@ class AdminImportControllerCore extends AdminController $handle = $this->openCsvFile(); $default_language_id = (int)Configuration::get('PS_LANG_DEFAULT'); AdminImportController::setLocale(); + $shop_ids = Shop::getCompleteListOfShopsID(); for ($current_line = 0; $line = fgetcsv($handle, MAX_LINE_SIZE, $this->separator); $current_line++) { if (Tools::getValue('convert')) @@ -1076,7 +1088,7 @@ class AdminImportControllerCore extends AdminController $this->addProductWarning( 'id_tax_rules_group', $product->id_tax_rules_group, - Tools::displayError('Invalid tax rule group ID, you first need a group with this ID.') + Tools::displayError('Invalid tax rule group ID. You first need to create a group with this ID.') ); } if (isset($product->manufacturer) && is_numeric($product->manufacturer) && Manufacturer::manufacturerExists((int)$product->manufacturer)) @@ -1099,7 +1111,7 @@ class AdminImportControllerCore extends AdminController $manufacturer->name, (isset($manufacturer->id) ? $manufacturer->id : 'null') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -1130,7 +1142,7 @@ class AdminImportControllerCore extends AdminController $supplier->name, (isset($supplier->id) ? $supplier->id : 'null') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -1176,7 +1188,7 @@ class AdminImportControllerCore extends AdminController $category_to_create->name[$default_language_id], (isset($category_to_create->id) ? $category_to_create->id : 'null') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -1208,7 +1220,7 @@ class AdminImportControllerCore extends AdminController $category_to_create->name[$default_language_id], (isset($category_to_create->id) ? $category_to_create->id : 'null') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -1232,7 +1244,7 @@ class AdminImportControllerCore extends AdminController if (!$valid_link) $this->warnings[] = sprintf( Tools::displayError('Rewrite link for %1$s (ID: %2$s) was re-written as %3$s.'), - $link_rewrite, + $product->name[$default_language_id], (isset($info['id']) ? $info['id'] : 'null'), $link_rewrite ); @@ -1245,6 +1257,14 @@ class AdminImportControllerCore extends AdminController if (!empty($meta_keyword)) $meta_keyword = str_replace($this->multiple_value_separator, ',', $meta_keyword); + // Convert comma into dot for all floating values + foreach (Product::$definition['fields'] as $key => $array) + if ($array['type'] == Product::TYPE_FLOAT) + $product->{$key} = str_replace(',', '.', $product->{$key}); + + // Indexation is already 0 if it's a new product, but not if it's an update + $product->indexed = 0; + $res = false; $field_error = $product->validateFields(UNFRIENDLY_ERROR, true); $lang_field_error = $product->validateFieldsLang(UNFRIENDLY_ERROR, true); @@ -1293,8 +1313,12 @@ class AdminImportControllerCore extends AdminController { $shop = trim($shop); if (!is_numeric($shop)) - $shop = ShopGroup::getIdByName($shop); - $shops[] = $shop; + $shop = Shop::getIdByName($shop); + + if (in_array($shop, $shop_ids)) + $shops[] = $shop; + else + $this->addProductWarning(Tools::safeOutput($info['name']), $product->id, $this->l('Shop is not valid')); } if (empty($shops)) $shops = Shop::getContextListShopID(); @@ -1303,10 +1327,10 @@ class AdminImportControllerCore extends AdminController { $this->errors[] = sprintf( Tools::displayError('%1$s (ID: %2$s) cannot be saved'), - $info['name'], - (isset($info['id']) ? $info['id'] : 'null') + (isset($info['name']) ? Tools::safeOutput($info['name']) : 'No Name'), + (isset($info['id']) ? Tools::safeOutput($info['id']) : 'No ID') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } @@ -1347,7 +1371,7 @@ class AdminImportControllerCore extends AdminController $specific_price->from = (isset($info['reduction_from']) && Validate::isDate($info['reduction_from'])) ? $info['reduction_from'] : '0000-00-00 00:00:00'; $specific_price->to = (isset($info['reduction_to']) && Validate::isDate($info['reduction_to'])) ? $info['reduction_to'] : '0000-00-00 00:00:00'; if (!$specific_price->add()) - $this->addProductWarning($info['name'], $product->id, $this->l('Discount is invalid')); + $this->addProductWarning(Tools::safeOutput($info['name']), $product->id, $this->l('Discount is invalid')); } if (isset($product->tags) && !empty($product->tags)) @@ -1363,7 +1387,7 @@ class AdminImportControllerCore extends AdminController $is_tag_added = Tag::addTags($key, $product->id, $tags, $this->multiple_value_separator); if (!$is_tag_added) { - $this->addProductWarning($info['name'], $product->id, $this->l('Tags list is invalid')); + $this->addProductWarning(Tools::safeOutput($info['name']), $product->id, $this->l('Tags list is invalid')); break; } } @@ -1380,7 +1404,7 @@ class AdminImportControllerCore extends AdminController $is_tag_added = Tag::addTags($key, $product->id, $str, $this->multiple_value_separator); if (!$is_tag_added) { - $this->addProductWarning($info['name'], $product->id, 'Invalid tag(s) ('.$str.')'); + $this->addProductWarning(Tools::safeOutput($info['name']), (int)$product->id, 'Invalid tag(s) ('.$str.')'); break; } } @@ -1409,9 +1433,7 @@ class AdminImportControllerCore extends AdminController $image->position = Image::getHighestPosition($product->id) + 1; $image->cover = (!$key && !$product_has_images) ? true : false; // file_exists doesn't work with HTTP protocol - if (@fopen($url, 'r') == false) - $error = true; - else if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true && + if (($field_error = $image->validateFields(UNFRIENDLY_ERROR, true)) === true && ($lang_field_error = $image->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true && $image->add()) { // associate image to selected shops @@ -1445,9 +1467,12 @@ class AdminImportControllerCore extends AdminController $feature_name = trim($tab_feature[0]); $feature_value = trim($tab_feature[1]); $position = isset($tab_feature[2]) ? $tab_feature[2]: false; - $id_feature = Feature::addFeatureImport($feature_name, $position); - $id_feature_value = FeatureValue::addFeatureValueImport($id_feature, $feature_value); - Product::addFeatureProductImport($product->id, $id_feature, $id_feature_value); + if(!empty($feature_name) && !empty($feature_value)) + { + $id_feature = Feature::addFeatureImport($feature_name, $position); + $id_feature_value = FeatureValue::addFeatureValueImport($id_feature, $feature_value); + Product::addFeatureProductImport($product->id, $id_feature, $id_feature_value); + } } // clean feature positions to avoid conflict Feature::cleanPositions(); @@ -1464,9 +1489,6 @@ class AdminImportControllerCore extends AdminController } - if (Configuration::get('PS_SEARCH_INDEXATION')) - Search::indexation(true); - $this->closeCsvFile($handle); } @@ -1511,8 +1533,12 @@ class AdminImportControllerCore extends AdminController $id_shop_list[] = Shop::getIdByName($shop); else $id_shop_list[] = $shop; - - $product = new Product((int)$info['id_product'], false, $default_language); + + if(isset($info['id_product'])) + $product = new Product((int)$info['id_product'], false, $default_language); + else + continue; + $id_image = null; //delete existing images if "delete_existing_images" is set to 1 @@ -1552,7 +1578,7 @@ class AdminImportControllerCore extends AdminController Tools::displayError('%s cannot be saved'), (isset($image->id_product) ? ' ('.$image->id_product.')' : '') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : '').mysql_error(); + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : '').mysql_error(); } } elseif (isset($info['image_position']) && $info['image_position']) @@ -1568,7 +1594,7 @@ class AdminImportControllerCore extends AdminController } if (!$id_image) $this->warnings[] = sprintf( - Tools::displayError('No image found for combination with id_product = %s and image position = %s.'), + Tools::displayError('No image was found for combination with id_product = %s and image position = %s.'), $product->id, (int)$info['image_position'] ); @@ -1577,53 +1603,54 @@ class AdminImportControllerCore extends AdminController $id_attribute_group = 0; // groups $groups_attributes = array(); - foreach (explode($this->multiple_value_separator, $info['group']) as $key => $group) - { - $tab_group = explode(':', $group); - $group = trim($tab_group[0]); - if (!isset($tab_group[1])) - $type = 'select'; - else - $type = trim($tab_group[1]); - - // sets group - $groups_attributes[$key]['group'] = $group; - - // if position is filled - if (isset($tab_group[2])) - $position = trim($tab_group[2]); - else - $position = false; - - if (!isset($groups[$group])) + if(isset($info['group'])) + foreach (explode($this->multiple_value_separator, $info['group']) as $key => $group) { - $obj = new AttributeGroup(); - $obj->is_color_group = false; - $obj->group_type = pSQL($type); - $obj->name[$default_language] = $group; - $obj->public_name[$default_language] = $group; - $obj->position = (!$position) ? AttributeGroup::getHigherPosition() + 1 : $position; - - if (($field_error = $obj->validateFields(UNFRIENDLY_ERROR, true)) === true && - ($lang_field_error = $obj->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true) - { - $obj->add(); - $obj->associateTo($id_shop_list); - $groups[$group] = $obj->id; - } + $tab_group = explode(':', $group); + $group = trim($tab_group[0]); + if (!isset($tab_group[1])) + $type = 'select'; else - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''); - - // fils groups attributes - $id_attribute_group = $obj->id; - $groups_attributes[$key]['id'] = $id_attribute_group; + $type = trim($tab_group[1]); + + // sets group + $groups_attributes[$key]['group'] = $group; + + // if position is filled + if (isset($tab_group[2])) + $position = trim($tab_group[2]); + else + $position = false; + + if (!isset($groups[$group])) + { + $obj = new AttributeGroup(); + $obj->is_color_group = false; + $obj->group_type = pSQL($type); + $obj->name[$default_language] = $group; + $obj->public_name[$default_language] = $group; + $obj->position = (!$position) ? AttributeGroup::getHigherPosition() + 1 : $position; + + if (($field_error = $obj->validateFields(UNFRIENDLY_ERROR, true)) === true && + ($lang_field_error = $obj->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true) + { + $obj->add(); + $obj->associateTo($id_shop_list); + $groups[$group] = $obj->id; + } + else + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''); + + // fils groups attributes + $id_attribute_group = $obj->id; + $groups_attributes[$key]['id'] = $id_attribute_group; + } + else // alreay exists + { + $id_attribute_group = $groups[$group]; + $groups_attributes[$key]['id'] = $id_attribute_group; + } } - else // alreay exists - { - $id_attribute_group = $groups[$group]; - $groups_attributes[$key]['id'] = $id_attribute_group; - } - } // inits attribute $id_product_attribute = 0; @@ -1631,116 +1658,118 @@ class AdminImportControllerCore extends AdminController $attributes_to_add = array(); // for each attribute - foreach (explode($this->multiple_value_separator, $info['attribute']) as $key => $attribute) - { - $tab_attribute = explode(':', $attribute); - $attribute = trim($tab_attribute[0]); - // if position is filled - if (isset($tab_attribute[1])) - $position = trim($tab_attribute[1]); - else - $position = false; - - if (isset($groups_attributes[$key])) + if(isset($info['attribute'])) + foreach (explode($this->multiple_value_separator, $info['attribute']) as $key => $attribute) { - $group = $groups_attributes[$key]['group']; - if (!isset($attributes[$group.'_'.$attribute]) && count($groups_attributes[$key]) == 2) + $tab_attribute = explode(':', $attribute); + $attribute = trim($tab_attribute[0]); + // if position is filled + if (isset($tab_attribute[1])) + $position = trim($tab_attribute[1]); + else + $position = false; + + if (isset($groups_attributes[$key])) { - $id_attribute_group = $groups_attributes[$key]['id']; - $obj = new Attribute(); - // sets the proper id (corresponding to the right key) - $obj->id_attribute_group = $groups_attributes[$key]['id']; - $obj->name[$default_language] = str_replace('\n', '', str_replace('\r', '', $attribute)); - $obj->position = (!$position) ? Attribute::getHigherPosition($groups[$group]) + 1 : $position; - - if (($field_error = $obj->validateFields(UNFRIENDLY_ERROR, true)) === true && - ($lang_field_error = $obj->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true) + $group = $groups_attributes[$key]['group']; + if (!isset($attributes[$group.'_'.$attribute]) && count($groups_attributes[$key]) == 2) { - $obj->add(); - $obj->associateTo($id_shop_list); - $attributes[$group.'_'.$attribute] = $obj->id; - } - else - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''); - } - - $info['minimal_quantity'] = isset($info['minimal_quantity']) && $info['minimal_quantity'] ? (int)$info['minimal_quantity'] : 1; - - $info['wholesale_price'] = str_replace(',', '.', $info['wholesale_price']); - $info['price'] = str_replace(',', '.', $info['price']); - $info['ecotax'] = str_replace(',', '.', $info['ecotax']); - $info['weight'] = str_replace(',', '.', $info['weight']); - - // if a reference is specified for this product, get the associate id_product_attribute to UPDATE - if (isset($info['reference']) && !empty($info['reference'])) - { - $id_product_attribute = Combination::getIdByReference($product->id, strval($info['reference'])); - - // updates the attribute - if ($id_product_attribute) - { - // gets all the combinations of this product - $attribute_combinations = $product->getAttributeCombinations($default_language); - foreach ($attribute_combinations as $attribute_combination) + $id_attribute_group = $groups_attributes[$key]['id']; + $obj = new Attribute(); + // sets the proper id (corresponding to the right key) + $obj->id_attribute_group = $groups_attributes[$key]['id']; + $obj->name[$default_language] = str_replace('\n', '', str_replace('\r', '', $attribute)); + $obj->position = (!$position && isset($groups[$group])) ? Attribute::getHigherPosition($groups[$group]) + 1 : $position; + + if (($field_error = $obj->validateFields(UNFRIENDLY_ERROR, true)) === true && + ($lang_field_error = $obj->validateFieldsLang(UNFRIENDLY_ERROR, true)) === true) { - if ($id_product_attribute && in_array($id_product_attribute, $attribute_combination)) + $obj->add(); + $obj->associateTo($id_shop_list); + $attributes[$group.'_'.$attribute] = $obj->id; + } + else + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''); + } + + $info['minimal_quantity'] = isset($info['minimal_quantity']) && $info['minimal_quantity'] ? (int)$info['minimal_quantity'] : 1; + + $info['wholesale_price'] = str_replace(',', '.', $info['wholesale_price']); + $info['price'] = str_replace(',', '.', $info['price']); + $info['ecotax'] = str_replace(',', '.', $info['ecotax']); + $info['weight'] = str_replace(',', '.', $info['weight']); + + // if a reference is specified for this product, get the associate id_product_attribute to UPDATE + if (isset($info['reference']) && !empty($info['reference'])) + { + $id_product_attribute = Combination::getIdByReference($product->id, strval($info['reference'])); + + // updates the attribute + if ($id_product_attribute) + { + // gets all the combinations of this product + $attribute_combinations = $product->getAttributeCombinations($default_language); + foreach ($attribute_combinations as $attribute_combination) { - $product->updateAttribute( - $id_product_attribute, - (float)$info['wholesale_price'], - (float)$info['price'], - (float)$info['weight'], - 0, - (float)$info['ecotax'], - $id_image, - strval($info['reference']), - strval($info['ean13']), - (int)$info['default_on'], - 0, - strval($info['upc']), - (int)$info['minimal_quantity'], - 0, - null, - $id_shop_list - ); - - $id_product_attribute_update = true; + if ($id_product_attribute && in_array($id_product_attribute, $attribute_combination)) + { + $product->updateAttribute( + $id_product_attribute, + (float)$info['wholesale_price'], + (float)$info['price'], + (float)$info['weight'], + 0, + (float)$info['ecotax'], + $id_image, + strval($info['reference']), + strval($info['ean13']), + (int)$info['default_on'], + 0, + strval($info['upc']), + (int)$info['minimal_quantity'], + 0, + null, + $id_shop_list + ); + + $id_product_attribute_update = true; + } } } } + + // if no attribute reference is specified, creates a new one + if (!$id_product_attribute) + { + $id_product_attribute = $product->addCombinationEntity( + (float)$info['wholesale_price'], + (float)$info['price'], + (float)$info['weight'], + 0, + (float)$info['ecotax'], + (int)$info['quantity'], + $id_image, + strval($info['reference']), + 0, + strval($info['ean13']), + (int)$info['default_on'], + 0, + strval($info['upc']), + (int)$info['minimal_quantity'], + $id_shop_list + ); + } + + // fills our attributes array, in order to add the attributes to the product_attribute afterwards + if(isset($attributes[$group.'_'.$attribute])) + $attributes_to_add[] = (int)$attributes[$group.'_'.$attribute]; + + // after insertion, we clean attribute position and group attribute position + $obj = new Attribute(); + $obj->cleanPositions((int)$id_attribute_group, false); + AttributeGroup::cleanPositions(); } - - // if no attribute reference is specified, creates a new one - if (!$id_product_attribute) - { - $id_product_attribute = $product->addCombinationEntity( - (float)$info['wholesale_price'], - (float)$info['price'], - (float)$info['weight'], - 0, - (float)$info['ecotax'], - (int)$info['quantity'], - $id_image, - strval($info['reference']), - 0, - strval($info['ean13']), - (int)$info['default_on'], - 0, - strval($info['upc']), - (int)$info['minimal_quantity'], - $id_shop_list - ); - } - - // fills our attributes array, in order to add the attributes to the product_attribute afterwards - $attributes_to_add[] = (int)$attributes[$group.'_'.$attribute]; - - // after insertion, we clean attribute position and group attribute position - $obj = new Attribute(); - $obj->cleanPositions((int)$id_attribute_group, false); - AttributeGroup::cleanPositions(); } - } $product->checkDefaultAttributes(); if (!$product->cache_default_attribute) @@ -1907,7 +1936,7 @@ class AdminImportControllerCore extends AdminController $info['email'], (isset($info['id']) ? $info['id'] : 'null') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -1954,7 +1983,7 @@ class AdminImportControllerCore extends AdminController else { $this->errors[] = sprintf(Tools::displayError('%s cannot be saved'), $country->name[$default_language_id]); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -1984,7 +2013,7 @@ class AdminImportControllerCore extends AdminController else { $this->errors[] = sprintf(Tools::displayError('%s cannot be saved'), $state->name); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -2007,7 +2036,7 @@ class AdminImportControllerCore extends AdminController } else { - $this->errors[] = sprintf(Tools::displayError('"%s": Is not a valid e-mail address'), $address->customer_email); + $this->errors[] = sprintf(Tools::displayError('"%s": Is not a valid email address'), $address->customer_email); continue; } } @@ -2025,11 +2054,11 @@ class AdminImportControllerCore extends AdminController Tools::displayError('%1$s does not exist in database %2$s (ID: %3$s) cannot be saved'), Db::getInstance()->getMsgError(), $customer->email, - (int)$address->customer_id + (int)$address->id_customer ); } else - $this->errors[] = sprintf(Tools::displayError('The customer ID n.%d does not exist in database (ID: %d) cannot be saved'), $address->customer_id); + $this->errors[] = sprintf(Tools::displayError('The customer ID n.%d does not exist in the database (ID: %d) cannot be saved'), $address->id_customer); } else { @@ -2053,7 +2082,7 @@ class AdminImportControllerCore extends AdminController $manufacturer->name, (isset($manufacturer->id) ? $manufacturer->id : 'null') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -2074,7 +2103,7 @@ class AdminImportControllerCore extends AdminController $supplier->name, (isset($supplier->id) ? $supplier->id : 'null') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -2188,10 +2217,10 @@ class AdminImportControllerCore extends AdminController { $this->errors[] = Db::getInstance()->getMsgError().' '.sprintf( Tools::displayError('%1$s (ID: %2$s) cannot be saved'), - $info['name'], - (isset($info['id']) ? $info['id'] : 'null') + (isset($info['name']) ? Tools::safeOutput($info['name']) : 'No Name'), + (isset($info['id']) ? Tools::safeOutput($info['id']) : 'No ID') ); - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''). + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''). Db::getInstance()->getMsgError(); } } @@ -2235,8 +2264,8 @@ class AdminImportControllerCore extends AdminController if (!$res) $this->errors[] = Db::getInstance()->getMsgError().' '.sprintf( Tools::displayError('%1$s (ID: %2$s) cannot be saved'), - $info['name'], - (isset($info['id']) ? $info['id'] : 'null') + (isset($info['name']) ? Tools::safeOutput($info['name']) : 'No Name'), + (isset($info['id']) ? Tools::safeOutput($info['id']) : 'No ID') ); else { @@ -2263,7 +2292,7 @@ class AdminImportControllerCore extends AdminController else { $this->errors[] = $this->l('Supplier is invalid').' ('.$supplier->name.')'; - $this->errors[] = ($field_error !== true ? $field_error : '').($lang_field_error !== true ? $lang_field_error : ''); + $this->errors[] = ($field_error !== true ? $field_error : '').(isset($lang_field_error) && $lang_field_error !== true ? $lang_field_error : ''); } } $this->closeCsvFile($handle); @@ -2330,7 +2359,7 @@ class AdminImportControllerCore extends AdminController $current_line + 1, $this->l('YYYY-MM-DD')); if ($discount_rate < 0 || $discount_rate > 100) $this->errors[] = sprintf($this->l('Discount rate (%d) is not valid (at line %d). %s.'), $discount_rate, - $current_line + 1, $this->l('Format: between 0 and 100')); + $current_line + 1, $this->l('Format: Between 0 and 100')); if ($supply_order->id > 0 && !$supply_order->isEditable()) $this->errors[] = sprintf($this->l('Supply Order (%d) is not editable (at line %d).'), $supply_order->id, $current_line + 1); @@ -2428,10 +2457,10 @@ class AdminImportControllerCore extends AdminController $this->errors[] = sprintf($this->l('Quantity Expected (%d) is not valid (at line %d).'), $quantity_expected, $current_line + 1); if ($discount_rate < 0 || $discount_rate > 100) $this->errors[] = sprintf($this->l('Discount rate (%d) is not valid (at line %d). %s.'), $discount_rate, - $current_line + 1, $this->l('Format: between 0 and 100')); + $current_line + 1, $this->l('Format: Between 0 and 100')); if ($tax_rate < 0 || $tax_rate > 100) $this->errors[] = sprintf($this->l('Quantity Expected (%d) is not valid (at line %d).'), $tax_rate, - $current_line + 1, $this->l('Format: between 0 and 100')); + $current_line + 1, $this->l('Format: Between 0 and 100')); // if no errors, sets supply order details if (empty($this->errors)) @@ -2487,13 +2516,7 @@ class AdminImportControllerCore extends AdminController public function utf8EncodeArray($array) { - if (is_array($array)) - foreach ($array as $key => $value) - $array[$key] = utf8_encode($value); - else - $array = utf8_encode($array); - - return $array; + return (is_array($array) ? array_map('utf8_encode', $array) : utf8_encode($array)); } protected function getNbrColumn($handle, $glue) @@ -2668,14 +2691,14 @@ class AdminImportControllerCore extends AdminController break; break; case UPLOAD_ERR_NO_FILE: - $this->errors[] = Tools::displayError('No file was uploaded'); + $this->errors[] = Tools::displayError('No file was uploaded.'); break; break; } } else if (!file_exists($_FILES['file']['tmp_name']) || !@move_uploaded_file($_FILES['file']['tmp_name'], _PS_ADMIN_DIR_.'/import/'.date('Ymdhis').'-'.$_FILES['file']['name'])) - $this->errors[] = $this->l('an error occurred while uploading and copying file'); + $this->errors[] = $this->l('An error occurred while uploading / copying the file.'); else Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=18'); } @@ -2687,46 +2710,54 @@ class AdminImportControllerCore extends AdminController // If i am a superadmin, i can truncate table if (((Shop::isFeatureActive() && $this->context->employee->isSuperAdmin()) || !Shop::isFeatureActive()) && Tools::getValue('truncate')) $this->truncateTables((int)Tools::getValue('entity')); - + $import_type = false; switch ((int)Tools::getValue('entity')) { - case $this->entities[$this->l('Categories')]: + case $this->entities[$import_type = $this->l('Categories')]: $this->categoryImport(); break; - case $this->entities[$this->l('Products')]: + case $this->entities[$import_type = $this->l('Products')]: + $import_type = $this->l('Categories'); $this->productImport(); break; - case $this->entities[$this->l('Customers')]: + case $this->entities[$import_type = $this->l('Customers')]: $this->customerImport(); break; - case $this->entities[$this->l('Addresses')]: + case $this->entities[$import_type = $this->l('Addresses')]: $this->addressImport(); break; - case $this->entities[$this->l('Combinations')]: + case $this->entities[$import_type = $this->l('Combinations')]: $this->attributeImport(); break; - case $this->entities[$this->l('Manufacturers')]: + case $this->entities[$import_type = $this->l('Manufacturers')]: $this->manufacturerImport(); break; - case $this->entities[$this->l('Suppliers')]: + case $this->entities[$import_type = $this->l('Suppliers')]: $this->supplierImport(); break; // @since 1.5.0 - case $this->entities[$this->l('SupplyOrders')]: + case $this->entities[$import_type = $this->l('Supply Orders')]: if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) $this->supplyOrdersImport(); break; // @since 1.5.0 - case $this->entities[$this->l('SupplyOrdersDetails')]: + case $this->entities[$import_type = $this->l('Supply Order Details')]: if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) $this->supplyOrdersDetailsImport(); break; default: $this->errors[] = $this->l('Please select what you would like to import'); } + if ($import_type !== false) + { + $log_message = sprintf($this->l('%s import'), $import_type); + if (Tools::getValue('truncate')) + $log_message .= ' '.$this->l('with truncate'); + Logger::addLog($log_message, 1, null, $import_type, null, true, (int)$this->context->employee->id); + } } else - $this->errors[] = $this->l('You must upload a file for go to the next step'); + $this->errors[] = $this->l('You must upload a file in order to proceed to the next step'); } parent::postProcess(); @@ -2783,4 +2814,4 @@ class AdminImportControllerCore extends AdminController die; } } -} +} \ No newline at end of file diff --git a/controllers/admin/AdminInformationController.php b/controllers/admin/AdminInformationController.php index 2d1c205fc..a33dc07a4 100644 --- a/controllers/admin/AdminInformationController.php +++ b/controllers/admin/AdminInformationController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -89,23 +89,23 @@ class AdminInformationControllerCore extends AdminController $tests_errors = array( 'phpversion' => $this->l('Update your PHP version'), 'upload' => $this->l('Configure your server to allow file uploads'), - 'system' => $this->l('Configure your server to allow the creation of directories and files with write permissions'), - 'gd' => $this->l('Enable the GD library on your server'), - 'mysql_support' => $this->l('Enable the MySQL support on your server'), - 'config_dir' => $this->l('Set write permissions for "config" folder'), - 'cache_dir' => $this->l('Set write permissions for "cache" folder'), - 'sitemap' => $this->l('Set write permissions for "sitemap.xml" file'), - 'img_dir' => $this->l('Set write permissions for "img" folder and subfolders, recursively'), - 'log_dir' => $this->l('Set write permissions for "log" folder and subfolders, recursively'), - 'mails_dir' => $this->l('Set write permissions for "mails" folder and subfolders, recursively'), - 'module_dir' => $this->l('Set write permissions for "modules" folder and subfolders, recursively'), - 'theme_lang_dir' => $this->l('Set write permissions for "themes/')._THEME_NAME_.$this->l('/lang/" folder and subfolders, recursively'), - 'translations_dir' => $this->l('Set write permissions for "translations" folder and subfolders, recursively'), - 'customizable_products_dir' => $this->l('Set write permissions for "upload" folder and subfolders, recursively'), - 'virtual_products_dir' => $this->l('Set write permissions for "download" folder and subfolders, recursively'), + 'system' => $this->l('Configure your server to allow the creation of directories and files with write permissions.'), + 'gd' => $this->l('Enable the GD library on your server.'), + 'mysql_support' => $this->l('Enable the MySQL support on your server.'), + 'config_dir' => $this->l('Set write permissions for the "config" folder.'), + 'cache_dir' => $this->l('Set write permissions for the "cache" folder.'), + 'sitemap' => $this->l('Set write permissions for the "sitemap.xml" file.'), + 'img_dir' => $this->l('Set write permissions for the "img" folder and subfolders.'), + 'log_dir' => $this->l('Set write permissions for the "log" folder and subfolders.'), + 'mails_dir' => $this->l('Set write permissions for the "mails" folder and subfolders.'), + 'module_dir' => $this->l('Set write permissions for the "modules" folder and subfolders.'), + 'theme_lang_dir' => $this->l('Set the write permissions for the "themes')._THEME_NAME_.$this->l('/lang/" folder and subfolders, recursively.'), + 'translations_dir' => $this->l('Set write permissions for the "translations" folder and subfolders.'), + 'customizable_products_dir' => $this->l('Set write permissions for the "upload" folder and subfolders.'), + 'virtual_products_dir' => $this->l('Set write permissions for the "download" folder and subfolders.'), 'fopen' => $this->l('Allow the PHP fopen() function on your server'), 'register_globals' => $this->l('Set PHP "register_global" option to "Off"'), - 'gz' => $this->l('Enable GZIP compression on your server') + 'gz' => $this->l('Enable GZIP compression on your server.') ); $params_required_results = ConfigurationTest::check($tests); diff --git a/controllers/admin/AdminInvoicesController.php b/controllers/admin/AdminInvoicesController.php index c2658675a..4eee707a4 100644 --- a/controllers/admin/AdminInvoicesController.php +++ b/controllers/admin/AdminInvoicesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -38,7 +38,7 @@ class AdminInvoicesControllerCore extends AdminController 'fields' => array( 'PS_INVOICE' => array( 'title' => $this->l('Enable invoices:'), - 'desc' => $this->l('If enabled, your customers will be able to receive an invoice for their purchases'), + 'desc' => $this->l('If enabled, your customers will be able to receive an invoice for their purchase(s).'), 'cast' => 'intval', 'type' => 'bool' ), @@ -50,13 +50,13 @@ class AdminInvoicesControllerCore extends AdminController ), 'PS_INVOICE_START_NUMBER' => array( 'title' => $this->l('Invoice number:'), - 'desc' => $this->l('The next invoice will begin with this number, and then increase with each additional invoice. Set to 0 if you want to keep the current number (#').(Order::getLastInvoiceNumber() + 1).').', + 'desc' => $this->l('The next invoice will begin with this number, and then increase with each additional invoice. Set to 0 if you want to keep the current number.').(Order::getLastInvoiceNumber() + 1).').', 'size' => 6, 'type' => 'text', 'cast' => 'intval' ), 'PS_INVOICE_FREE_TEXT' => array( - 'title' => $this->l('Footer Text:'), + 'title' => $this->l('Footer text:'), 'desc' => $this->l('This text will appear at the bottom of the invoice'), 'size' => 6, 'type' => 'textareaLang', @@ -71,7 +71,7 @@ class AdminInvoicesControllerCore extends AdminController 'list' => $this->getInvoicesModels() ), 'PS_PDF_USE_CACHE' => array( - 'title' => $this->l('Use disk as cache for PDF invoices'), + 'title' => $this->l('Use disk as cache for PDF invoices:'), 'desc' => $this->l('Saves memory but slows down the rendering process.'), 'validation' => 'isBool', 'cast' => 'intval', @@ -144,11 +144,11 @@ class AdminInvoicesControllerCore extends AdminController 'id' => 'id_order_state', 'name' => 'name' ), - 'desc' => $this->l('You can also export orders which have not been charged yet').' ().' + 'desc' => $this->l('You can also export orders which have not been charged yet.').' ().' ) ), 'submit' => array( - 'title' => $this->l('Generate PDF file by status'), + 'title' => $this->l('Generate PDF file by status.'), 'class' => 'button', 'id' => 'submitPrint2' ) @@ -206,7 +206,7 @@ class AdminInvoicesControllerCore extends AdminController $this->toolbar_btn['save-status'] = array( 'href' => '#', - 'desc' => $this->l('Generate PDF file by status') + 'desc' => $this->l('Generate PDF file by status.') ); } @@ -215,30 +215,30 @@ class AdminInvoicesControllerCore extends AdminController if (Tools::getValue('submitAddinvoice_date')) { if (!Validate::isDate(Tools::getValue('date_from'))) - $this->errors[] = $this->l('Invalid "From:" date'); + $this->errors[] = $this->l('Invalid "From" date'); if (!Validate::isDate(Tools::getValue('date_to'))) - $this->errors[] = $this->l('Invalid "To:" date'); + $this->errors[] = $this->l('Invalid "To" date'); if (!count($this->errors)) { if (count(OrderInvoice::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')))) Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicesPDF&date_from='.urlencode(Tools::getValue('date_from')).'&date_to='.urlencode(Tools::getValue('date_to'))); - $this->errors[] = $this->l('No invoice found for this period'); + $this->errors[] = $this->l('No invoice has been found for this period.'); } } else if (Tools::isSubmit('submitAddinvoice_status')) { if (!is_array($status_array = Tools::getValue('id_order_state')) || !count($status_array)) - $this->errors[] = $this->l('You must select at least one order status'); + $this->errors[] = $this->l('You must select at least one order status.'); else { foreach ($status_array as $id_order_state) if (count(OrderInvoice::getByStatus((int)$id_order_state))) Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicesPDF2&id_order_state='.implode('-', $status_array)); - $this->errors[] = $this->l('No invoice found for this status'); + $this->errors[] = $this->l('No invoice has been found for this status.'); } } else @@ -248,7 +248,7 @@ class AdminInvoicesControllerCore extends AdminController public function beforeUpdateOptions() { if ((int)Tools::getValue('PS_INVOICE_START_NUMBER') != 0 && (int)Tools::getValue('PS_INVOICE_START_NUMBER') <= Order::getLastInvoiceNumber()) - $this->errors[] = $this->l('Invalid invoice number (must be > ').Order::getLastInvoiceNumber().')'; + $this->errors[] = $this->l('Invalid invoice number.').Order::getLastInvoiceNumber().')'; } protected function getInvoicesModels() @@ -273,11 +273,14 @@ class AdminInvoicesControllerCore extends AdminController protected function getInvoicesModelsFromDir($directory) { - $templates = array(); + $templates = false; if (is_dir($directory)) $templates = glob($directory.'invoice-*.tpl'); + if (!$templates) + $templates = array(); + return $templates; } } diff --git a/controllers/admin/AdminLanguagesController.php b/controllers/admin/AdminLanguagesController.php index aec4648ef..2112d1fbe 100644 --- a/controllers/admin/AdminLanguagesController.php +++ b/controllers/admin/AdminLanguagesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -93,7 +93,7 @@ class AdminLanguagesControllerCore extends AdminController 'enableSelection' => array('text' => $this->l('Enable selection')), 'disableSelection' => array('text' => $this->l('Disable selection')) ); - $this->specificConfirmDelete = $this->l('When you delete a language, all related translations in the database will be deleted. Are you sure you want to delete this language?'); + $this->specificConfirmDelete = $this->l('When you delete a language, all related translations in the database will be deleted. Are you sure you want to proceed?'); parent::__construct(); } @@ -135,7 +135,7 @@ class AdminLanguagesControllerCore extends AdminController 'required' => true, 'size' => 2, 'maxlength' => 2, - 'desc' => $this->l('2-letter ISO code (e.g. fr, en, de)') + 'desc' => $this->l('Two-letter ISO code (e.g. FR, EN, DE)') ), array( 'type' => 'text', @@ -144,7 +144,7 @@ class AdminLanguagesControllerCore extends AdminController 'required' => true, 'size' => 2, 'maxlength' => 5, - 'desc' => $this->l('Full language code (e.g. en-us, pt-br)') + 'desc' => $this->l('IETF language tag (e.g. en-US, pt-BR).').' '.sprintf('%s ', $this->l('IETF on Wikipedia')) ), array( 'type' => 'text', @@ -152,7 +152,7 @@ class AdminLanguagesControllerCore extends AdminController 'name' => 'date_format_lite', 'required' => true, 'size' => 15, - 'desc' => $this->l('Short date format (e.g. Y-m-d, d/m/Y)') + 'desc' => sprintf($this->l('Short date format (e.g., %s)'), 'Y-m-d') ), array( 'type' => 'text', @@ -160,20 +160,20 @@ class AdminLanguagesControllerCore extends AdminController 'name' => 'date_format_full', 'required' => true, 'size' => 25, - 'desc' => $this->l('Full date format (e.g., Y-m-d H:i:s, d/m/Y H:i)') + 'desc' => sprintf($this->l('Full date format (e.g., %s)'), 'Y-m-d H:i:s') ), array( 'type' => 'file', 'label' => $this->l('Flag:'), 'name' => 'flag', 'required' => true, - 'desc' => $this->l('Upload country flag from your computer') + 'desc' => $this->l('Upload the country flag from your computer') ), array( 'type' => 'file', 'label' => $this->l('"No-picture" image:'), 'name' => 'no-picture', - 'desc' => $this->l('Image displayed when "no picture found"') + 'desc' => $this->l('Image is displayed when "no picture is found"') ), array( 'type' => 'radio', @@ -216,12 +216,12 @@ class AdminLanguagesControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Allow or disallow this language to be selected by the customer') + 'desc' => $this->l('Activate this language') ), array( 'type' => 'special', 'name' => 'resultCheckLangPack', - 'text' => $this->l('Check if a language pack is available for this ISO code...'), + 'text' => $this->l('Check to see if a language pack is available for this ISO code.'), 'img' => 'ajax-loader.gif' ) ) @@ -237,7 +237,7 @@ class AdminLanguagesControllerCore extends AdminController } $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); @@ -277,127 +277,128 @@ class AdminLanguagesControllerCore extends AdminController return parent::renderForm(); } - public function postProcess() + public function processDelete() { - if (isset($_GET['delete'.$this->table])) - { - if ($this->tabAccess['delete'] === '1') - { - if (Validate::isLoadedObject($object = $this->loadObject()) && isset($this->fieldImageSettings)) - { - if ($object->id == Configuration::get('PS_LANG_DEFAULT')) - $this->errors[] = $this->l('You cannot delete the default language'); - else if ($object->id == $this->context->language->id) - $this->errors[] = $this->l('You cannot delete the language currently in use. Please change languages before deleting.'); - else if ($this->deleteNoPictureImages((int)Tools::getValue('id_lang')) && $object->delete()) - { - $this->checkEmployeeIdLang($object->id); - Tools::redirectAdmin(self::$currentIndex.'&conf=1'.'&token='.$this->token); - } - - } - else - $this->errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '. - Tools::displayError('(cannot load object)'); - } - else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); - } - else if (Tools::getValue('submitDel'.$this->table) && isset($_POST[$this->table.'Box'])) - { - if ($this->tabAccess['delete'] === '1') - { - if (in_array(Configuration::get('PS_LANG_DEFAULT'), $_POST[$this->table.'Box'])) - $this->errors[] = $this->l('You cannot delete the default language'); - else if (in_array($this->context->language->id, $_POST[$this->table.'Box'])) - $this->errors[] = $this->l('you cannot delete the language currently in use, please change languages before deleting'); - else - { - foreach ($_POST[$this->table.'Box'] as $language) - $this->deleteNoPictureImages($language); - if (Validate::isLoadedObject($object = $this->loadObject())) - $this->checkEmployeeIdLang($object->id); - parent::postProcess(); - } - } - else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); - } - else if (Tools::isSubmit('submitAddlang')) - { - /* New language */ - if ((int)Tools::getValue('id_'.$this->table) == 0) - { - if ($this->tabAccess['add'] === '1') - { - if (isset($_POST['iso_code']) && !empty($_POST['iso_code']) && Validate::isLanguageIsoCode(Tools::getValue('iso_code')) && Language::getIdByIso($_POST['iso_code'])) - $this->errors[] = Tools::displayError('This ISO code is already linked to another language.'); - if ((!empty($_FILES['no-picture']['tmp_name']) || !empty($_FILES['flag']['tmp_name'])) && Validate::isLanguageIsoCode(Tools::getValue('iso_code'))) - { - if ($_FILES['no-picture']['error'] == UPLOAD_ERR_OK) - $this->copyNoPictureImage(strtolower(Tools::getValue('iso_code'))); - // class AdminTab deal with every $_FILES content, don't do that for no-picture - unset($_FILES['no-picture']); - parent::postProcess(); - } - else - { - $this->validateRules(); - $this->errors[] = Tools::displayError('Flag and "No picture" image fields are required.'); - } - } - else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); - } - /* Language edition */ - else - { - if ($this->tabAccess['edit'] === '1') - { - if (( isset($_FILES['no-picture']) && !$_FILES['no-picture']['error'] || isset($_FILES['flag']) && !$_FILES['flag']['error']) - && Validate::isLanguageIsoCode(Tools::getValue('iso_code'))) - { - if ($_FILES['no-picture']['error'] == UPLOAD_ERR_OK) - $this->copyNoPictureImage(strtolower(Tools::getValue('iso_code'))); - // class AdminTab deal with every $_FILES content, don't do that for no-picture - unset($_FILES['no-picture']); - parent::postProcess(); - } + $object = $this->loadObject(); + if (!$this->checkDeletion($object)) + return false; + if (!$this->deleteNoPictureImages((int)$object->id)) + $this->errors[] = Tools::displayError('An error occurred while deleting the object.').' '.$this->table.' '; - if (!Validate::isLoadedObject($object = $this->loadObject())) - $this->errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); - if ((int)$object->id == (int)Configuration::get('PS_LANG_DEFAULT') && (int)$_POST['active'] != (int)$object->active) - $this->errors[] = Tools::displayError('You cannot change the status of the default language.'); - else - parent::postProcess(); + return parent::processDelete(); + } - $this->validateRules(); + protected function processBulkDelete() + { + $can_bulk = true; + if (is_array($this->boxes) && !empty($this->boxes)) + { + foreach ($this->boxes as $id_lang) + { + $object = new Language((int)$id_lang); + if (!$this->checkDeletion($object)) + return false; + if (!$this->deleteNoPictureImages((int)$object->id)) + { + $this->errors[] = Tools::displayError('An error occurred while deleting the object.').' '.$this->table.' '; + return false; } - else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); } } - else if (isset($_GET['status'.$this->table]) && isset($_GET['id_lang'])) + return parent::processBulkDelete(); + } + + protected function checkDeletion($object) + { + if (Validate::isLoadedObject($object)) { - if ($this->tabAccess['edit'] === '1') - { - if (!Validate::isLoadedObject($object = $this->loadObject())) - $this->errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); - if ((int)$object->id == (int)Configuration::get('PS_LANG_DEFAULT')) + if ($object->id == Configuration::get('PS_LANG_DEFAULT')) + $this->errors[] = $this->l('You cannot delete the default language.'); + elseif ($object->id == $this->context->language->id) + $this->errors[] = $this->l('You cannot delete the language currently in use. Please select a different language.'); + else + return true; + } + else + $this->errors[] = Tools::displayError('(cannot load object)'); + + return false; + } + + protected function checkDisableStatus($object) + { + if (!Validate::isLoadedObject($object)) + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + else + { + if ($object->id == (int)Configuration::get('PS_LANG_DEFAULT')) $this->errors[] = Tools::displayError('You cannot change the status of the default language.'); - else - { - if (Validate::isLoadedObject($object)) - $this->checkEmployeeIdLang($object->id); - return parent::postProcess(); - } - - } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + return true; + } + return false; + } + + public function processStatus() + { + $object = $this->loadObject(); + if ($this->checkDisableStatus($object)) + { + $this->checkEmployeeIdLang($object->id); + return parent::processStatus(); + } + return false; + } + + protected function processBulkDisableSelection() + { + if (is_array($this->boxes) && !empty($this->boxes)) + { + foreach ($this->boxes as $id_lang) + { + $object = new Language((int)$id_lang); + if (!$this->checkDisableStatus($object)) + return false; + $this->checkEmployeeIdLang($object->id); + } + } + return parent::processBulkDisableSelection(); + } + + public function processAdd() + { + if (isset($_POST['iso_code']) && !empty($_POST['iso_code']) && Validate::isLanguageIsoCode(Tools::getValue('iso_code')) && Language::getIdByIso($_POST['iso_code'])) + $this->errors[] = Tools::displayError('This ISO code is already linked to another language.'); + if ((!empty($_FILES['no-picture']['tmp_name']) || !empty($_FILES['flag']['tmp_name'])) && Validate::isLanguageIsoCode(Tools::getValue('iso_code'))) + { + if ($_FILES['no-picture']['error'] == UPLOAD_ERR_OK) + $this->copyNoPictureImage(strtolower(Tools::getValue('iso_code'))); + unset($_FILES['no-picture']); + return parent::processAdd(); } else - return parent::postProcess(); + $this->errors[] = Tools::displayError('Flag and "No picture" image fields are required.'); + + return false; + } + + public function processUpdate() + { + if (( isset($_FILES['no-picture']) && !$_FILES['no-picture']['error'] || isset($_FILES['flag']) && !$_FILES['flag']['error']) + && Validate::isLanguageIsoCode(Tools::getValue('iso_code'))) + { + if ($_FILES['no-picture']['error'] == UPLOAD_ERR_OK) + $this->copyNoPictureImage(strtolower(Tools::getValue('iso_code'))); + // class AdminTab deal with every $_FILES content, don't do that for no-picture + unset($_FILES['no-picture']); + } + $object = $this->loadObject(); + if (Tools::getValue('active') != (int)$object->active) + if (!$this->checkDisableStatus($object)) + return false; + + $this->checkEmployeeIdLang($object->id); + return parent::processUpdate(); } /** @@ -415,11 +416,11 @@ class AdminLanguagesControllerCore extends AdminController if (!($tmp_name = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['no-picture']['tmp_name'], $tmp_name)) return false; if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'p/'.$language.'.jpg')) - $this->errors[] = Tools::displayError('An error occurred while copying no-picture image to your product folder.'); + $this->errors[] = Tools::displayError('An error occurred while copying "No Picture" image to your product folder.'); if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'c/'.$language.'.jpg')) $this->errors[] = Tools::displayError('An error occurred while copying "No picture" image to your category folder.'); if (!ImageManager::resize($tmp_name, _PS_IMG_DIR_.'m/'.$language.'.jpg')) - $this->errors[] = Tools::displayError('An error occurred while copying "No picture" image to your manufacturer folder'); + $this->errors[] = Tools::displayError('An error occurred while copying "No picture" image to your manufacturer folder.'); else { $images_types = ImageType::getImagesTypes('products'); @@ -453,11 +454,11 @@ class AdminLanguagesControllerCore extends AdminController foreach ($images_types as $k => $image_type) if (file_exists($dir.$language.'-default-'.stripslashes($image_type['name']).'.jpg')) if (!unlink($dir.$language.'-default-'.stripslashes($image_type['name']).'.jpg')) - $this->errors[] = Tools::displayError('An error occurred during image deletion.'); + $this->errors[] = Tools::displayError('An error occurred during image deletion process.'); if (file_exists($dir.$language.'.jpg')) if (!unlink($dir.$language.'.jpg')) - $this->errors[] = Tools::displayError('An error occurred during image deletion.'); + $this->errors[] = Tools::displayError('An error occurred during image deletion process.'); } return !count($this->errors) ? true : false; @@ -474,22 +475,24 @@ class AdminLanguagesControllerCore extends AdminController public function ajaxProcessCheckLangPack() { $this->json = true; - if (empty($_GET['iso_lang'])) + if (!Tools::getValue('iso_lang') || !Validate::isLanguageIsoCode(Tools::getValue('iso_lang'))) { $this->status = 'error'; - $this->errors[] = '[TECHNICAL ERROR] iso_lang not set or empty'; + $this->errors[] = $this->l('Iso code is not valid'); + return; } - if (empty($_GET['ps_version'])) + if (!Tools::getValue('ps_version') || !Validate::isPrestaShopVersion(Tools::getValue('ps_version'))) { $this->status = 'error'; - $this->errors[] = '[TECHNICAL ERROR] ps_version not set or empty'; + $this->errors[] = $this->l('Technical Error: ps_version is not valid'); + return; } - if (@fsockopen('www.prestashop.com', 80)) + + // Get all iso code available + if ($lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.Tools::getValue('ps_version').'&iso_lang='.Tools::strtolower(Tools::getValue('iso_lang')))) { - // Get all iso code available - $lang_packs = Tools::file_get_contents('http://www.prestashop.com/download/lang_packs/get_language_pack.php?version='.(string)$_GET['ps_version'].'&iso_lang='.(string)$_GET['iso_lang']); - - if ($lang_packs !== '' && Tools::jsonDecode($lang_packs) !== null) + $result = Tools::jsonDecode($lang_packs); + if ($lang_packs !== '' && $result && !isset($result->error)) { $this->status = 'ok'; $this->content = $lang_packs; @@ -497,21 +500,19 @@ class AdminLanguagesControllerCore extends AdminController else { $this->status = 'error'; - $this->errors[] = $this->l('wrong ISO code or language pack unavailable'); + $this->errors[] = $this->l('Wrong ISO code, or the selected language pack is unavailable.'); } } else { $this->status = 'error'; - $this->errors[] = '[TECHNICAL ERROR] Server unreachable'; + $this->errors[] = $this->l('Technical Error: translation server unreachable'); } } - + protected function checkEmployeeIdLang($current_id_lang) { //update employee lang if current id lang is disabled Db::getInstance()->execute('UPDATE `'._DB_PREFIX_.'employee` set `id_lang`='.(int)Configuration::get('PS_LANG_DEFAULT').' WHERE `id_lang`='.(int)$current_id_lang); } -} - - +} \ No newline at end of file diff --git a/controllers/admin/AdminLocalizationController.php b/controllers/admin/AdminLocalizationController.php index 4641613f9..c5158f9fa 100644 --- a/controllers/admin/AdminLocalizationController.php +++ b/controllers/admin/AdminLocalizationController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -130,7 +130,7 @@ class AdminLocalizationControllerCore extends AdminController if (function_exists('date_default_timezone_set')) $this->fields_options['general']['fields']['PS_TIMEZONE'] = array( - 'title' => $this->l('Time Zone.'), + 'title' => $this->l('Time zone:'), 'validation' => 'isAnything', 'type' => 'select', 'list' => Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS('SELECT name FROM '._DB_PREFIX_.'timezone'), @@ -152,7 +152,7 @@ class AdminLocalizationControllerCore extends AdminController $pack = @Tools::file_get_contents('http://api.prestashop.com/localization/'.$version.'/'.Tools::getValue('iso_localization_pack').'.xml'); if (!$pack && !($pack = @Tools::file_get_contents(dirname(__FILE__).'/../../localization/'.Tools::getValue('iso_localization_pack').'.xml'))) - $this->errors[] = Tools::displayError('Cannot load localization pack (from prestashop.com and from your local folder "localization")'); + $this->errors[] = Tools::displayError('Cannot load the localization pack.'); if (!$selection = Tools::getValue('selection')) $this->errors[] = Tools::displayError('Please select at least one item to import.'); @@ -243,7 +243,7 @@ class AdminLocalizationControllerCore extends AdminController $this->fields_form = array( 'tinymce' => true, 'legend' => array( - 'title' => $this->l('Import localization pack'), + 'title' => $this->l('Import a localization pack'), 'image' => '../img/admin/localization.gif' ), 'input' => array( @@ -270,7 +270,7 @@ class AdminLocalizationControllerCore extends AdminController ) ), 'submit' => array( - 'title' => $this->l(' Import '), + 'title' => $this->l('Import '), 'class' => 'button', 'name' => 'submitLocalizationPack' ) @@ -323,6 +323,10 @@ class AdminLocalizationControllerCore extends AdminController public function updateOptionPsCurrencyDefault($value) { Configuration::updateValue('PS_CURRENCY_DEFAULT', $value); + + /* Set conversion rate of default currency to 1 */ + ObjectModel::updateMultishopTable('Currency', array('conversion_rate' => 1), 'a.id_currency'); + Currency::refreshCurrencies(); } } diff --git a/controllers/admin/AdminLoginController.php b/controllers/admin/AdminLoginController.php index ba64159b4..5ce949c00 100755 --- a/controllers/admin/AdminLoginController.php +++ b/controllers/admin/AdminLoginController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -37,8 +37,7 @@ class AdminLoginControllerCore extends AdminController parent::__construct(); } - - + public function setMedia() { $this->addJquery(); @@ -60,20 +59,35 @@ class AdminLoginControllerCore extends AdminController $clientIsMaintenanceOrLocal = in_array(Tools::getRemoteAddr(), array_merge(array('127.0.0.1'), explode(',', Configuration::get('PS_MAINTENANCE_IP')))); // If ssl is enabled, https protocol is required. Exception for maintenance and local (127.0.0.1) IP if ($clientIsMaintenanceOrLocal) - $this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to use unsecure mode (Maintenance or local IP).'); + $this->errors[] = Tools::displayError('SSL is activated. However, your IP is allowed to enter unsecure mode for maintenance or local IP issues.'); else { - $warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following url to log in in secure mode (https).'); + $warningSslMessage = Tools::displayError('SSL is activated. Please connect using the following URL to log into secure mode (https://).'); $warningSslMessage .= 'https://'.Tools::safeOutput(Tools::getServerName()).Tools::safeOutput($_SERVER['REQUEST_URI']).''; $this->context->smarty->assign(array('warningSslMessage' => $warningSslMessage)); } } - if (file_exists(_PS_ADMIN_DIR_.'/../install') || file_exists(_PS_ADMIN_DIR_.'/../admin')) - $this->context->smarty->assign(array( - 'randomNb' => rand(100, 999), - 'wrong_folder_name' => true - )); + if (file_exists(_PS_ADMIN_DIR_.'/../install')) + $this->context->smarty->assign('wrong_install_name', true); + + if (basename(_PS_ADMIN_DIR_) == 'admin' && file_exists(_PS_ADMIN_DIR_.'/../admin/')) + { + $rand = 'admin'.sprintf('%04d', rand(0, 9999)).'/'; + if (@rename(_PS_ADMIN_DIR_.'/../admin/', _PS_ADMIN_DIR_.'/../'.$rand)) + Tools::redirectAdmin('../'.$rand); + else + $this->context->smarty->assign(array( + 'wrong_folder_name' => true + )); + } + else + $rand = basename(_PS_ADMIN_DIR_).'/'; + + $this->context->smarty->assign(array( + 'randomNb' => $rand, + 'adminUrl' => Tools::getCurrentUrlProtocolPrefix().Tools::getShopDomain().__PS_BASE_URI__.$rand + )); // Redirect to admin panel if (Tools::isSubmit('redirect') && Validate::isControllerName(Tools::getValue('redirect'))) @@ -91,6 +105,7 @@ class AdminLoginControllerCore extends AdminController 'shop_name' => Tools::safeOutput(Configuration::get('PS_SHOP_NAME')), 'disableDefaultErrorOutPut' => true, )); + $this->setMedia(); $this->initHeader(); parent::initContent(); @@ -126,29 +141,29 @@ class AdminLoginControllerCore extends AdminController $passwd = trim(Tools::getValue('passwd')); $email = trim(Tools::getValue('email')); if (empty($email)) - $this->errors[] = Tools::displayError('E-mail is empty'); + $this->errors[] = Tools::displayError('Email is empty.'); elseif (!Validate::isEmail($email)) - $this->errors[] = Tools::displayError('Invalid e-mail address'); + $this->errors[] = Tools::displayError('Invalid email address.'); if (empty($passwd)) - $this->errors[] = Tools::displayError('Password is blank'); + $this->errors[] = Tools::displayError('The password field is blank.'); elseif (!Validate::isPasswd($passwd)) - $this->errors[] = Tools::displayError('Invalid password'); + $this->errors[] = Tools::displayError('Invalid password.'); if (!count($this->errors)) { // Find employee $this->context->employee = new Employee(); - $is_employee_loaded = $this->context->employee->getByemail($email, $passwd); + $is_employee_loaded = $this->context->employee->getByEmail($email, $passwd); $employee_associated_shop = $this->context->employee->getAssociatedShops(); if (!$is_employee_loaded) { - $this->errors[] = Tools::displayError('Employee does not exist or password is incorrect.'); + $this->errors[] = Tools::displayError('The Employee does not exist, or the password provided is incorrect.'); $this->context->employee->logout(); } elseif (empty($employee_associated_shop) && !$this->context->employee->isSuperAdmin()) { - $this->errors[] = Tools::displayError('Employee does not manage any shop anymore (shop has been deleted or permissions have been removed).'); + $this->errors[] = Tools::displayError('This employee does not manage the shop anymore (Either the shop has been deleted or permissions have been revoked).'); $this->context->employee->logout(); } else @@ -187,14 +202,14 @@ class AdminLoginControllerCore extends AdminController if (_PS_MODE_DEMO_) $this->errors[] = Tools::displayError('This functionality has been disabled.'); elseif (!($email = trim(Tools::getValue('email_forgot')))) - $this->errors[] = Tools::displayError('E-mail is empty'); + $this->errors[] = Tools::displayError('Email is empty.'); elseif (!Validate::isEmail($email)) - $this->errors[] = Tools::displayError('Invalid e-mail address'); + $this->errors[] = Tools::displayError('Invalid email address.'); else { $employee = new Employee(); - if (!$employee->getByemail($email) || !$employee) - $this->errors[] = Tools::displayError('This account does not exist'); + if (!$employee->getByEmail($email) || !$employee) + $this->errors[] = Tools::displayError('This account does not exist.'); elseif ((strtotime($employee->last_passwd_gen.'+'.Configuration::get('PS_PASSWD_TIME_BACK').' minutes') - time()) > 0) $this->errors[] = sprintf( Tools::displayError('You can regenerate your password only every %d minute(s)'), @@ -215,22 +230,22 @@ class AdminLoginControllerCore extends AdminController '{passwd}' => $pwd ); - if (Mail::Send((int)Configuration::get('PS_LANG_DEFAULT'), 'password', Mail::l('Your new password', (int)Configuration::get('PS_LANG_DEFAULT')), $params, $employee->email, $employee->firstname.' '.$employee->lastname)) + if (Mail::Send($employee->id_lang, 'password', Mail::l('Your new password', $employee->id_lang), $params, $employee->email, $employee->firstname.' '.$employee->lastname)) { // Update employee only if the mail can be sent $result = $employee->update(); if (!$result) - $this->errors[] = Tools::displayError('An error occurred during your password change.'); + $this->errors[] = Tools::displayError('An error occurred while attempting to change your password.'); else die(Tools::jsonEncode(array( 'hasErrors' => false, - 'confirm' => $this->l('Your password has been e-mailed to you', 'AdminTab', false, false) + 'confirm' => $this->l('Your password has been emailed to you.', 'AdminTab', false, false) ))); } else die(Tools::jsonEncode(array( 'hasErrors' => true, - 'errors' => array(Tools::displayError('An error occurred during your password change.')) + 'errors' => array(Tools::displayError('An error occurred while attempting to change your password.')) ))); } diff --git a/controllers/admin/AdminLogsController.php b/controllers/admin/AdminLogsController.php index 5f8808cba..265e420f1 100644 --- a/controllers/admin/AdminLogsController.php +++ b/controllers/admin/AdminLogsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -38,6 +38,7 @@ class AdminLogsControllerCore extends AdminController $this->fields_list = array( 'id_log' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), + 'employee' => array('title' => $this->l('Employee'), 'align' => 'center', 'width' => 100), 'severity' => array('title' => $this->l('Severity (1-4)'), 'align' => 'center', 'width' => 50), 'message' => array('title' => $this->l('Message')), 'object_type' => array('title' => $this->l('Object type'), 'width' => 75), @@ -48,11 +49,11 @@ class AdminLogsControllerCore extends AdminController $this->fields_options = array( 'general' => array( - 'title' => $this->l('Logs by e-mail'), + 'title' => $this->l('Logs by email'), 'fields' => array( 'PS_LOGS_BY_EMAIL' => array( 'title' => $this->l('Minimum severity level'), - 'desc' => $this->l('Enter "5" if you do not want to receive any e-mails.').'
        '.$this->l('E-mails will be sent to the shop owner.'), + 'desc' => $this->l('Enter "5" if you do not want to receive any emails.').'
        '.$this->l('Emails will be sent to the shop owner.'), 'cast' => 'intval', 'type' => 'text', 'size' => 5 @@ -61,7 +62,9 @@ class AdminLogsControllerCore extends AdminController 'submit' => array() ) ); - + $this->list_no_link = true; + $this->_select .= 'CONCAT(LEFT(e.firstname, 1), \'. \', e.lastname) employee'; + $this->_join .= ' LEFT JOIN '._DB_PREFIX_.'employee e ON (a.id_employee = e.id_employee)'; parent::__construct(); } diff --git a/controllers/admin/AdminMaintenanceController.php b/controllers/admin/AdminMaintenanceController.php index 8891c9ad5..687880ebd 100644 --- a/controllers/admin/AdminMaintenanceController.php +++ b/controllers/admin/AdminMaintenanceController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -40,14 +40,14 @@ class AdminMaintenanceControllerCore extends AdminController 'fields' => array( 'PS_SHOP_ENABLE' => array( 'title' => $this->l('Enable Shop'), - 'desc' => $this->l('Activate or deactivate your shop. It is a good idea to deactivate your shop while you perform maintenance on it. Please note that the webservice will not be disabled'), + 'desc' => $this->l('Activate or deactivate your shop (It is a good idea to deactivate your shop while you perform maintenance. Please note that the webservice will not be disabled).'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' ), 'PS_MAINTENANCE_IP' => array( 'title' => $this->l('Maintenance IP'), - 'desc' => $this->l('IP addresses allowed to access the Front Office even if the shop is disabled. Use a comma to separate them (e.g. 42.24.4.2,127.0.0.1,99.98.97.96)'), + 'desc' => $this->l('IP addresses allowed to access the Front Office even if the shop is disabled. Please use a comma to separate them (e.g. 42.24.4.2,127.0.0.1,99.98.97.96)'), 'validation' => 'isGenericName', 'type' => 'maintenance_ip', 'size' => 30, diff --git a/controllers/admin/AdminManufacturersController.php b/controllers/admin/AdminManufacturersController.php index 9f87624e2..469f02da5 100644 --- a/controllers/admin/AdminManufacturersController.php +++ b/controllers/admin/AdminManufacturersController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -35,6 +35,7 @@ class AdminManufacturersControllerCore extends AdminController $this->className = 'Manufacturer'; $this->lang = false; $this->deleted = false; + $this->allow_export = true; $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); @@ -69,7 +70,7 @@ class AdminManufacturersControllerCore extends AdminController 'havingFilter' => true ), 'products' => array( - 'title' => $this->l('Products'), + 'title' => $this->l('Products:'), 'havingFilter' => true, 'width' => 20, 'align' => 'center', @@ -114,6 +115,50 @@ class AdminManufacturersControllerCore extends AdminController $this->content .= parent::renderList(); } + + protected function getAddressFieldsList() + { + // Sub tab addresses + $countries = Country::getCountries($this->context->language->id); + foreach ($countries as $country) + $this->countries_array[$country['id_country']] = $country['name']; + + return array( + 'id_address' => array( + 'title' => $this->l('ID'), + 'width' => 25 + ), + 'manufacturer_name' => array( + 'title' => $this->l('Manufacturer'), + 'width' => 'auto' + ), + 'firstname' => array( + 'title' => $this->l('First name'), + 'width' => 80 + ), + 'lastname' => array( + 'title' => $this->l('Last name'), + 'width' => 100, + 'filter_key' => 'a!name' + ), + 'postcode' => array( + 'title' => $this->l('Zip Code/Postal Code'), + 'align' => 'right', + 'width' => 50 + ), + 'city' => array( + 'title' => $this->l('City'), + 'width' => 150 + ), + 'country' => array( + 'title' => $this->l('Country'), + 'width' => 100, + 'type' => 'select', + 'list' => $this->countries_array, + 'filter_key' => 'cl!id_country' + ) + ); + } public function initListManufacturerAddresses() { @@ -135,51 +180,9 @@ class AdminManufacturersControllerCore extends AdminController $this->filter = true; // test if a filter reset request is required for this list - if (isset($_POST['submitReset'.$this->table])) - $this->action = 'reset_filters'; - else - $this->action = ''; + $this->action = (isset($_POST['submitReset'.$this->table]) ? 'reset_filters' : ''); - // Sub tab addresses - $countries = Country::getCountries($this->context->language->id); - foreach ($countries as $country) - $this->countries_array[$country['id_country']] = $country['name']; - - $this->fields_list = array( - 'id_address' => array( - 'title' => $this->l('ID'), - 'width' => 25 - ), - 'manufacturer_name' => array( - 'title' => $this->l('Manufacturer'), - 'width' => 'auto' - ), - 'firstname' => array( - 'title' => $this->l('First name'), - 'width' => 80 - ), - 'lastname' => array( - 'title' => $this->l('Last name'), - 'width' => 100, - 'filter_key' => 'a!name' - ), - 'postcode' => array( - 'title' => $this->l('Postal Code/Zip Code'), - 'align' => 'right', - 'width' => 50 - ), - 'city' => array( - 'title' => $this->l('City'), - 'width' => 150 - ), - 'country' => array( - 'title' => $this->l('Country'), - 'width' => 100, - 'type' => 'select', - 'list' => $this->countries_array, - 'filter_key' => 'cl!id_country' - ) - ); + $this->fields_list = $this->getAddressFieldsList(); $this->_select = 'cl.`name` as country, m.`name` AS manufacturer_name'; $this->_join = ' @@ -188,7 +191,7 @@ class AdminManufacturersControllerCore extends AdminController $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'manufacturer` m ON (a.`id_manufacturer` = m.`id_manufacturer`)'; - $this->_where = 'AND a.`id_customer` = 0 AND a.`id_supplier` = 0 AND a.`id_warehouse` = 0'; + $this->_where = 'AND a.`id_customer` = 0 AND a.`id_supplier` = 0 AND a.`id_warehouse` = 0 AND a.`deleted`=0'; $this->context->smarty->assign('title_list', $this->l('Manufacturers addresses:')); @@ -232,7 +235,7 @@ class AdminManufacturersControllerCore extends AdminController $this->fields_form = array( 'tinymce' => true, 'legend' => array( - 'title' => $this->l('Manufacturers'), + 'title' => $this->l('Manufacturers:'), 'image' => '../img/admin/manufacturers.gif' ), 'input' => array( @@ -269,7 +272,7 @@ class AdminManufacturersControllerCore extends AdminController 'label' => $this->l('Logo:'), 'name' => 'logo', 'display_image' => true, - 'desc' => $this->l('Upload manufacturer logo from your computer') + 'desc' => $this->l('Upload a manufacturer logo from your computer.') ), array( 'type' => 'text', @@ -291,7 +294,7 @@ class AdminManufacturersControllerCore extends AdminController 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Forbidden characters:').' <>;=#{}', - 'desc' => $this->l('To add "tags" click in the field, write something, then press "Enter"') + 'desc' => $this->l('To add "tags," click inside the field, write something, and then press "Enter."') ), array( 'type' => 'radio', @@ -329,7 +332,7 @@ class AdminManufacturersControllerCore extends AdminController } $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); @@ -405,6 +408,12 @@ class AdminManufacturersControllerCore extends AdminController 'type' => 'hidden', 'name' => 'alias', ); + + $form['input'][] = array( + 'type' => 'hidden', + 'name' => 'id_address', + ); + $form['input'][] = array( 'type' => 'text', 'label' => $this->l('Last name:'), @@ -437,8 +446,9 @@ class AdminManufacturersControllerCore extends AdminController ); $form['input'][] = array( 'type' => 'text', - 'label' => $this->l('Postcode / Zip Code:'), + 'label' => $this->l('Zip Code/Postal Code'), 'name' => 'postcode', + 'required' => true, 'size' => 33, 'required' => false, ); @@ -496,14 +506,14 @@ class AdminManufacturersControllerCore extends AdminController 'hint' => $this->l('Forbidden characters:').' <>;=#{}' ); $form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); $this->fields_value = array( 'name' => Manufacturer::getNameById($address->id_manufacturer), 'alias' => 'manufacturer', - 'id_country' => Configuration::get('PS_COUNTRY_DEFAULT') + 'id_country' => $address->id_country ); $this->initToolbar(); @@ -557,6 +567,10 @@ class AdminManufacturersControllerCore extends AdminController default: parent::initToolbar(); + $this->toolbar_btn['import'] = array( + 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table, + 'desc' => $this->l('Import') + ); } } @@ -564,7 +578,12 @@ class AdminManufacturersControllerCore extends AdminController { if (!($manufacturer = $this->loadObject())) return; - + + $this->toolbar_btn['new'] = array( + 'href' => $this->context->link->getAdminLink('AdminManufacturers').'&addaddress=1&id_manufacturer='.(int)$manufacturer->id, + 'desc' => $this->l('Add address') + ); + $addresses = $manufacturer->getAddresses($this->context->language->id); $products = $manufacturer->getProductsLite($this->context->language->id); @@ -654,6 +673,8 @@ class AdminManufacturersControllerCore extends AdminController if (Tools::isSubmit('editaddresses')) $this->display = 'editaddresses'; + else if (Tools::isSubmit('updateaddress')) + $this->display = 'editaddresses'; else if (Tools::isSubmit('addaddress')) $this->display = 'addaddress'; else if (Tools::isSubmit('submitAddaddress')) @@ -664,12 +685,13 @@ class AdminManufacturersControllerCore extends AdminController public function initProcess() { - if (Tools::getValue('submitAddaddress') || Tools::isSubmit('deleteaddress') || Tools::isSubmit('submitBulkdeleteaddress')) + if (Tools::getValue('submitAddaddress') || Tools::isSubmit('deleteaddress') || Tools::isSubmit('submitBulkdeleteaddress') || Tools::isSubmit('exportaddress')) { $this->table = 'address'; $this->className = 'Address'; $this->identifier = 'id_address'; $this->deleted = true; + $this->fields_list = $this->getAddressFieldsList(); } parent::initProcess(); } @@ -697,10 +719,13 @@ class AdminManufacturersControllerCore extends AdminController } if (!$res) - $this->errors[] = Tools::displayError('Unable to resize one or more pictures'); + $this->errors[] = Tools::displayError('Unable to resize one or more of your pictures.'); return $res; } -} - - + + protected function beforeDelete($object) + { + return true; + } +} \ No newline at end of file diff --git a/controllers/admin/AdminMarketingController.php b/controllers/admin/AdminMarketingController.php new file mode 100644 index 000000000..97f1ff3e0 --- /dev/null +++ b/controllers/admin/AdminMarketingController.php @@ -0,0 +1,54 @@ + +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ + +class AdminMarketingControllerCore extends AdminController +{ + + public function initContent() + { + $this->display = 'view'; + return parent::initContent(); + } + + public function initToolbarTitle() + { + $this->toolbar_title = array_unique($this->breadcrumbs); + } + + public function initToolbar() + { + return false; + } + + public function renderView() + { + $this->tpl_view_vars = array( + 'modules_list' => $this->renderModulesList(), + ); + return parent::renderView(); + } +} + diff --git a/controllers/admin/AdminMetaController.php b/controllers/admin/AdminMetaController.php index a3031e89b..ec58e1e96 100644 --- a/controllers/admin/AdminMetaController.php +++ b/controllers/admin/AdminMetaController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -58,15 +58,22 @@ class AdminMetaControllerCore extends AdminController $general_fields = array( 'PS_REWRITING_SETTINGS' => array( 'title' => $this->l('Friendly URL'), - 'desc' => ($mod_rewrite ? $this->l('Enable only if your server allows URL rewriting (recommended)') : ''), + 'desc' => ($mod_rewrite ? $this->l('Enable only if your server allows URL rewriting (recommended).') : ''), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'rewriting_settings', 'mod_rewrite' => $mod_rewrite ), + 'PS_ALLOW_ACCENTED_CHARS_URL' => array( + 'title' => $this->l('Accented URL'), + 'desc' => $this->l('Enable if you want to allow accented characters in your friendly URLs.').' '.$this->l('You should only activate this option if you are using non-latin characters ; for all the latin charsets, your SEO will be better without this option.'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'type' => 'bool' + ), 'PS_CANONICAL_REDIRECT' => array( - 'title' => $this->l('Automatically redirect to Canonical URL'), - 'desc' => $this->l('Recommended, but your theme must be compliant'), + 'title' => $this->l('Automatically redirect to the canonical URL'), + 'desc' => $this->l('Recommended, but your theme must be compliant.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' @@ -75,32 +82,42 @@ class AdminMetaControllerCore extends AdminController $url_description = ''; if ($this->checkConfiguration($this->ht_file)) + { $general_fields['PS_HTACCESS_DISABLE_MULTIVIEWS'] = array( 'title' => $this->l('Disable apache multiviews'), - 'desc' => $this->l('Enable this option only if you have problems with URL rewriting on some pages.'), + 'desc' => $this->l('Enable this option only if you have problems with URL rewriting.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', ); + + $general_fields['PS_HTACCESS_DISABLE_MODSEC'] = array( + 'title' => $this->l('Disable apache mod security'), + 'desc' => $this->l('Some features could not work correctly with a specific configuration of apache mod security. We recommend to turn it off.'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'type' => 'bool', + ); + } else { $url_description = $this->l('Before being able to use this tool, you need to:'); - $url_description .= '
        - '.$this->l('create a blank .htaccess in your root directory'); - $url_description .= '
        - '.$this->l('give it write permissions (CHMOD 666 on Unix system)'); + $url_description .= '
        - '.$this->l('Create a blank .htaccess in your root directory.'); + $url_description .= '
        - '.$this->l('Give it write permissions (CHMOD 666 on Unix system)'); } // Options to generate robot.txt $robots_description = $this->l('Your robots.txt file MUST be in your website\'s root directory and nowhere else (e.g. http://www.yoursite.com/robots.txt).'); if ($this->checkConfiguration($this->rb_file)) { - $robots_description .= '
        '.$this->l('Generate your "robots.txt" file by clicking on the following button (this will erase your old robots.txt file):'); + $robots_description .= '
        '.$this->l('Generate your "robots.txt" file by clicking on the following button (this will erase the old robots.txt file)'); $robots_submit = array('name' => 'submitRobots', 'title' => $this->l('Generate robots.txt file')); } else { $robots_description .= '
        '.$this->l('Before being able to use this tool, you need to:'); - $robots_description .= '
        - '.$this->l('create a blank robots.txt file in your root directory'); - $robots_description .= '
        - '.$this->l('give it write permissions (CHMOD 666 on Unix system)'); + $robots_description .= '
        - '.$this->l('Create a blank robots.txt file in your root directory.'); + $robots_description .= '
        - '.$this->l('Give it write permissions (CHMOD 666 on Unix system)'); } $robots_options = array( @@ -122,7 +139,7 @@ class AdminMetaControllerCore extends AdminController $this->url = ShopUrl::getShopUrls($this->context->shop->id)->where('main', '=', 1)->getFirst(); if ($this->url) { - $shop_url_options['description'] = $this->l('You can set here the URL for your shop. If you migrate your shop to a new URL, remember to change the values bellow.'); + $shop_url_options['description'] = $this->l('Here you can set the URL for your shop. If you migrate your shop to a new URL, remember to change the values bellow.'); $shop_url_options['fields'] = array( 'domain' => array( 'title' => $this->l('Shop domain'), @@ -149,7 +166,7 @@ class AdminMetaControllerCore extends AdminController } } else - $shop_url_options['description'] = $this->l('Multistore option is enabled, if you want to change the URL of your shop you have to go to "Multistore" page under the "Advanced Parameters" menu.'); + $shop_url_options['description'] = $this->l('The multistore option is enabled. If you want to change the URL of your shop, you must go to the "Multistore" page under the "Advanced Parameters" menu.'); // List of options $this->fields_options = array( @@ -167,7 +184,7 @@ class AdminMetaControllerCore extends AdminController { $this->fields_options['routes'] = array( 'title' => $this->l('Schema of URLs'), - 'description' => $this->l('Change the pattern of your links. There are some available keywords for each route listed below, keywords with * are required. To add a keyword in your URL use {keyword} syntax. You can add some text before or after the keyword IF the keyword is not empty with syntax {prepend:keyword:append}, for example {-hey-:meta_title} will add "-hey-my-title" in URL if meta title is set, or nothing. Friendly URL and rewriting Apache option must be activated on your web server to use this functionality.'), + 'description' => $this->l('Change the pattern of your links. There are some available keywords for each route listed below, keywords with * are required. To add a keyword in your URL use {keyword} syntax. You can add text before or after the keyword if the keyword is not empty with syntax {prepend:keyword:append}. For example {-hey-:meta_title} will add "-hey-my-title" in the URL if the meta title is set. Friendly URL and rewriting Apache option must be activated on your web server to use this functionality.'), 'fields' => array() ); $this->addAllRouteFields(); @@ -232,7 +249,7 @@ class AdminMetaControllerCore extends AdminController $this->fields_form = array( 'legend' => array( - 'title' => $this->l('Meta-Tags'), + 'title' => $this->l('Meta tags'), 'image' => '../img/admin/metatags.gif' ), 'input' => array( @@ -284,7 +301,7 @@ class AdminMetaControllerCore extends AdminController 'name' => 'keywords', 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', - 'desc' => $this->l('List of keywords for search engines').' '.$this->l('To add "tags" click in the field, write something, then press "Enter"'), + 'desc' => $this->l('List of keywords for search engines').' '.$this->l('To add "tags," click in the field, write something, and then press "Enter."'), 'size' => 50 ), array( @@ -293,7 +310,7 @@ class AdminMetaControllerCore extends AdminController 'name' => 'url_rewrite', 'lang' => true, 'required' => true, - 'hint' => $this->l('Only letters and the minus (-) character are allowed'), + 'hint' => $this->l('Only letters and hyphens are allowed'), 'desc' => $this->l('e.g. "contacts" for http://mysite.com/shop/contacts to redirect to http://mysite.com/shop/contact-form.php'), 'size' => 50 ), @@ -326,7 +343,7 @@ class AdminMetaControllerCore extends AdminController if (!$defaultLangIsValidated && !$englishLangIsValidated) { - $this->errors[] = Tools::displayError('URL rewrite field must be filled at least in default or English language.'); + $this->errors[] = Tools::displayError('The URL rewrite field must be filled in either the default or English language.'); return false; } @@ -432,7 +449,7 @@ class AdminMetaControllerCore extends AdminController $rule = Tools::getValue('PS_ROUTE_'.$route_id); if (!Validate::isRoutePattern($rule)) - $this->errors[] = sprintf('The route %s is not valide', htmlspecialchars($rule)); + $this->errors[] = sprintf('The route %s is not valid', htmlspecialchars($rule)); else { if (!$rule || $rule == $default_routes[$route_id]['rule']) @@ -459,7 +476,7 @@ class AdminMetaControllerCore extends AdminController public function updateOptionPsRewritingSettings() { Configuration::updateValue('PS_REWRITING_SETTINGS', (int)Tools::getValue('PS_REWRITING_SETTINGS')); - Tools::generateHtaccess($this->ht_file, null, null, '', Tools::getValue('PS_HTACCESS_DISABLE_MULTIVIEWS')); + Tools::generateHtaccess($this->ht_file, null, null, '', Tools::getValue('PS_HTACCESS_DISABLE_MULTIVIEWS'), false, Tools::getValue('PS_HTACCESS_DISABLE_MODSEC')); Tools::enableCache(); Tools::clearCache($this->context->smarty); @@ -512,9 +529,10 @@ class AdminMetaControllerCore extends AdminController { $this->url->domain = $value; $this->url->update(); + Configuration::updateGlobalValue('PS_SHOP_DOMAIN', $value); } else - $this->errors[] = Tools::displayError('Domain is not valid'); + $this->errors[] = Tools::displayError('This domain is not valid.'); } } @@ -529,9 +547,10 @@ class AdminMetaControllerCore extends AdminController { $this->url->domain_ssl = $value; $this->url->update(); + Configuration::updateGlobalValue('PS_SHOP_DOMAIN_SSL', $value); } else - $this->errors[] = Tools::displayError('SSL Domain is not valid'); + $this->errors[] = Tools::displayError('The SSL domain is not valid.'); } } @@ -631,7 +650,7 @@ class AdminMetaControllerCore extends AdminController } $tab['GB'] = array( - 'orderby=','orderway=','tag=','id_currency=','search_query=','back=','utm_source=','utm_medium=','utm_campaign=','n=' + 'orderby=','orderway=','tag=','id_currency=','search_query=','back=','n=' ); foreach ($disallow_controllers as $controller) diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index b3bc20d79..5be50453c 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class AdminModulesControllerCore extends AdminController { - /* ** @var array map with $_GET keywords and their callback */ @@ -68,28 +67,30 @@ class AdminModulesControllerCore extends AdminController { parent::__construct(); + register_shutdown_function('displayFatalError'); + include_once(_PS_ADMIN_DIR_.'/../tools/tar/Archive_Tar.php'); // Set the modules categories $this->list_modules_categories['administration']['name'] = $this->l('Administration'); - $this->list_modules_categories['advertising_marketing']['name'] = $this->l('Advertising & Marketing'); - $this->list_modules_categories['analytics_stats']['name'] = $this->l('Analytics & Stats'); - $this->list_modules_categories['billing_invoicing']['name'] = $this->l('Billing & Invoicing'); + $this->list_modules_categories['advertising_marketing']['name'] = $this->l('Advertising and Marketing'); + $this->list_modules_categories['analytics_stats']['name'] = $this->l('Analytics and Stats'); + $this->list_modules_categories['billing_invoicing']['name'] = $this->l('Billing and Invoicing'); $this->list_modules_categories['checkout']['name'] = $this->l('Checkout'); $this->list_modules_categories['content_management']['name'] = $this->l('Content Management'); $this->list_modules_categories['export']['name'] = $this->l('Export'); - $this->list_modules_categories['emailing']['name'] = $this->l('E-mailing'); + $this->list_modules_categories['emailing']['name'] = $this->l('Emailing'); $this->list_modules_categories['front_office_features']['name'] = $this->l('Front Office Features'); - $this->list_modules_categories['i18n_localization']['name'] = $this->l('Internationalization & Localization'); + $this->list_modules_categories['i18n_localization']['name'] = $this->l('Internationalization and Localization'); $this->list_modules_categories['merchandizing']['name'] = $this->l('Merchandizing'); $this->list_modules_categories['migration_tools']['name'] = $this->l('Migration Tools'); - $this->list_modules_categories['payments_gateways']['name'] = $this->l('Payments & Gateways'); + $this->list_modules_categories['payments_gateways']['name'] = $this->l('Payments and Gateways'); $this->list_modules_categories['payment_security']['name'] = $this->l('Payment Security'); - $this->list_modules_categories['pricing_promotion']['name'] = $this->l('Pricing & Promotion'); + $this->list_modules_categories['pricing_promotion']['name'] = $this->l('Pricing and Promotion'); $this->list_modules_categories['quick_bulk_update']['name'] = $this->l('Quick / Bulk update'); - $this->list_modules_categories['search_filter']['name'] = $this->l('Search & Filter'); + $this->list_modules_categories['search_filter']['name'] = $this->l('Search and Filter'); $this->list_modules_categories['seo']['name'] = $this->l('SEO'); - $this->list_modules_categories['shipping_logistics']['name'] = $this->l('Shipping & Logistics'); + $this->list_modules_categories['shipping_logistics']['name'] = $this->l('Shipping and Logistics'); $this->list_modules_categories['slideshows']['name'] = $this->l('Slideshows'); $this->list_modules_categories['smart_shopping']['name'] = $this->l('Smart Shopping'); $this->list_modules_categories['market_place']['name'] = $this->l('Marketplace'); @@ -127,6 +128,12 @@ class AdminModulesControllerCore extends AdminController if (isset($this->context->cookie->username_addons) && isset($this->context->cookie->password_addons) && !empty($this->context->cookie->username_addons) && !empty($this->context->cookie->password_addons)) $this->logged_on_addons = true; } + + public function setMedia() + { + parent::setMedia(); + $this->addJqueryPlugin(array('autocomplete', 'fancybox')); + } public function ajaxProcessRefreshModuleList() { @@ -149,7 +156,7 @@ class AdminModulesControllerCore extends AdminController { if (!$this->isFresh(Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 86400)) { - if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, $this->addonsRequest('native'))) + if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, Tools::addonsRequest('native'))) $this->status = 'refresh'; else $this->status = 'error'; @@ -159,7 +166,7 @@ class AdminModulesControllerCore extends AdminController if (!$this->isFresh(Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, 86400)) { - if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, $this->addonsRequest('must-have'))) + if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_MUST_HAVE_MODULES_LIST, Tools::addonsRequest('must-have'))) $this->status = 'refresh'; else $this->status = 'error'; @@ -173,7 +180,7 @@ class AdminModulesControllerCore extends AdminController { if (!$this->isFresh(Module::CACHE_FILE_CUSTOMER_MODULES_LIST, 60)) { - if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_CUSTOMER_MODULES_LIST, $this->addonsRequest('customer'))) + if (file_put_contents(_PS_ROOT_DIR_.Module::CACHE_FILE_CUSTOMER_MODULES_LIST, Tools::addonsRequest('customer'))) $this->status = 'refresh'; else $this->status = 'error'; @@ -191,7 +198,7 @@ class AdminModulesControllerCore extends AdminController public function ajaxProcessLogOnAddonsWebservices() { - $content = $this->addonsRequest('check_customer', array('username_addons' => pSQL(trim(Tools::getValue('username_addons'))), 'password_addons' => pSQL(trim(Tools::getValue('password_addons'))))); + $content = Tools::addonsRequest('check_customer', array('username_addons' => pSQL(trim(Tools::getValue('username_addons'))), 'password_addons' => pSQL(trim(Tools::getValue('password_addons'))))); $xml = @simplexml_load_string($content, null, LIBXML_NOCDATA); if (!$xml) die('KO'); @@ -200,8 +207,10 @@ class AdminModulesControllerCore extends AdminController die ('KO'); if ($result == 'OK') { + Configuration::updateValue('PS_LOGGED_ON_ADDONS', 1); $this->context->cookie->username_addons = pSQL(trim(Tools::getValue('username_addons'))); $this->context->cookie->password_addons = pSQL(trim(Tools::getValue('password_addons'))); + $this->context->cookie->write(); } die($result); } @@ -210,6 +219,7 @@ class AdminModulesControllerCore extends AdminController { $this->context->cookie->username_addons = ''; $this->context->cookie->password_addons = ''; + $this->context->cookie->write(); die('OK'); } @@ -224,6 +234,52 @@ class AdminModulesControllerCore extends AdminController $this->smartyOutputContent('controllers/modules/list.tpl'); exit; } + + public function ajaxProcessGetTabModulesList() + { + $tab_modules_list = Tools::getValue('tab_modules_list'); + $back = Tools::getValue('back_tab_modules_list'); + if ($back) + $back .= '&tab_modules_open=1'; + $modules_list = array('installed' =>array(), 'not_installed' => array()); + if ($tab_modules_list) + { + $tab_modules_list = explode(',', $tab_modules_list); + $all_modules = Module::getModulesOnDisk(true, $this->logged_on_addons, $this->id_employee); + foreach($all_modules as $module) + { + if (in_array($module->name, $tab_modules_list)) + { + $perm = true; + if ($module->id) + $perm &= Module::getPermissionStatic($module->id, 'configure'); + else + { + $id_admin_module = Tab::getIdFromClassName('AdminModules'); + $access = Profile::getProfileAccess($this->context->employee->id_profile, $id_admin_module); + if (!$access['edit']) + $perm &= false; + } + if ($perm) + { + $this->fillModuleData($module, 'select', $back); + if ($module->id) + $modules_list['installed'][] = $module; + else + $modules_list['not_installed'][] = $module; + + } + } + } + } + $this->context->smarty->assign(array( + 'tab_modules_list' => $modules_list, + 'admin_module_favorites_view' => $this->context->link->getAdminLink('AdminModules').'&select=favorites' + )); + + $this->smartyOutputContent('controllers/modules/tab_modules_list.tpl'); + exit; + } public function ajaxProcessSetFilter() { @@ -256,66 +312,29 @@ class AdminModulesControllerCore extends AdminController } die('OK'); } - - - private function sendStatisticRequest($object_key) + + public function ajaxProcessSaveTabModulePreferences() { - $post_data = http_build_query(array( - 'key' => urlencode($object_key), - 'url' => urlencode(Tools::getShopDomain()), - 'mail' => urlencode(Configuration::get('PS_SHOP_EMAIL')), - 'version' => urlencode(_PS_VERSION_), - 'method' => 'product_key' - )); - - $opts = array( - 'http' => array( - 'method' => 'POST', - 'header' => 'Content-type: application/x-www-form-urlencoded', - 'content' => $post_data - ) - ); - - $context = stream_context_create($opts); - file_get_contents('http://api.addons.prestashop.com/', false, $context); + $values = Tools::getValue('value_pref'); + $module = Tools::getValue('module_pref'); + if (Validate::isModuleName($module)) + { + Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'tab_module_preference` WHERE `id_employee` = '.(int)$this->id_employee.' AND `module` = \''.pSQL($module).'\''); + if (is_array($values) && count($values)) + foreach($values as $value) + Db::getInstance()->execute(' + INSERT INTO `'._DB_PREFIX_.'tab_module_preference` (`id_tab_module_preference`, `id_employee`, `id_tab`, `module`) + VALUES (NULL, '.(int)$this->id_employee.', '.(int)$value.', \''.pSQL($module).'\');'); + } + die('OK'); } - - /** - * Ajax call for statistic - * - * @result : die the request - */ - public function ajaxProcessWsModuleCall() - { - if (($list = Tools::getValue('modules_list')) && is_array($list)) - foreach ($list as $id) - if (($obj = Module::getInstanceById($id)) && (isset($obj->module_key))) - $this->sendStatisticRequest($obj->module_key); - die(); - } - - /** - * Ajax call for statistic - * - * @result : die the request - */ - public function ajaxProcessWsThemeCall() - { - // Theme list contains just the key for each theme - if (($list = Tools::getValue('theme_list')) && is_array($list)) - foreach ($list as $theme_key) - if (!empty($theme_key)) - $this->sendStatisticRequest($theme_key); - die(); - } - + /* ** Get current URL ** ** @param array $remove List of keys to remove from URL ** @return string */ - protected function getCurrentUrl($remove = array()) { $url = $_SERVER['REQUEST_URI']; @@ -334,26 +353,46 @@ class AdminModulesControllerCore extends AdminController protected function extractArchive($file, $redirect = true) { + $zip_folders = array(); + $tmp_folder = _PS_MODULE_DIR_.md5(time()); + $success = false; if (substr($file, -4) == '.zip') { - if (Tools::ZipExtract($file, _PS_MODULE_DIR_)) - $success = true; - else - $this->errors[] = Tools::displayError('Error while extracting module (file may be corrupted).'); + if (Tools::ZipExtract($file, $tmp_folder)) + { + $zip_folders = scandir($tmp_folder); + if (Tools::ZipExtract($file, _PS_MODULE_DIR_)) + $success = true; + } } else { $archive = new Archive_Tar($file); - if ($archive->extract(_PS_MODULE_DIR_)) - $success = true; - else - $this->errors[] = Tools::displayError('Error while extracting module (file may be corrupted).'); + if ($archive->extract($tmp_folder)) + { + $zip_folders = scandir($tmp_folder); + if ($archive->extract(_PS_MODULE_DIR_)) + $success = true; + } } - + if (!$success) + $this->errors[] = Tools::displayError('There was an error while extracting the module (file may be corrupted).'); + + //check if it's a real module + foreach($zip_folders as $folder) + if (!in_array($folder, array('.', '..', '.svn', '.git', '__MACOSX')) && !Module::getInstanceByName($folder)) + { + $this->errors[] = Tools::displayError('The \'.$folder.\' you uploaded is not a module'); + $this->recursiveDeleteOnDisk(_PS_MODULE_DIR_.$folder); + } + @unlink($file); + $this->recursiveDeleteOnDisk($tmp_folder); if ($success && $redirect) - Tools::redirectAdmin(self::$currentIndex.'&conf=8'.'&token='.$this->token); + Tools::redirectAdmin(self::$currentIndex.'&conf=8&anchor=anchor'.ucfirst($folder).'&token='.$this->token); + + return $success; } protected function recursiveDeleteOnDisk($dir) @@ -442,23 +481,24 @@ class AdminModulesControllerCore extends AdminController if (Validate::isLoadedObject($module)) { if (!$module->getPermission('configure')) - $this->errors[] = Tools::displayError('You do not have the permission to use this module'); + $this->errors[] = Tools::displayError('You do not have the permission to use this module.'); else { if ($module->uninstall()) if ($module->install()) Tools::redirectAdmin(self::$currentIndex.'&conf=21'.'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name)); else - $this->errors[] = Tools::displayError('Cannot install module'); + $this->errors[] = Tools::displayError('Cannot install this module.'); else - $this->errors[] = Tools::displayError('Cannot uninstall module'); + $this->errors[] = Tools::displayError('Cannot uninstall this module.'); } } else - $this->errors[] = Tools::displayError('Cannot load module object'); + $this->errors[] = Tools::displayError('Cannot load the module\'s object.'); + $this->errors = array_merge($this->errors, $module->getErrors()); } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } public function postProcessDownload() @@ -473,18 +513,25 @@ class AdminModulesControllerCore extends AdminController // Try to upload and unarchive the module if ($this->tabAccess['add'] === '1') { + // UPLOAD_ERR_OK: 0 + // UPLOAD_ERR_INI_SIZE: 1 + // UPLOAD_ERR_FORM_SIZE: 2 + // UPLOAD_ERR_NO_TMP_DIR: 6 + // UPLOAD_ERR_CANT_WRITE: 7 + // UPLOAD_ERR_EXTENSION: 8 + // UPLOAD_ERR_PARTIAL: 3 if (!isset($_FILES['file']['tmp_name']) || empty($_FILES['file']['tmp_name'])) - $this->errors[] = $this->l('no file selected'); + $this->errors[] = $this->l('No file has been selected'); elseif (substr($_FILES['file']['name'], -4) != '.tar' && substr($_FILES['file']['name'], -4) != '.zip' && substr($_FILES['file']['name'], -4) != '.tgz' && substr($_FILES['file']['name'], -7) != '.tar.gz') - $this->errors[] = Tools::displayError('Unknown archive type'); + $this->errors[] = Tools::displayError('Unknown archive type.'); elseif (!@copy($_FILES['file']['tmp_name'], _PS_MODULE_DIR_.$_FILES['file']['name'])) - $this->errors[] = Tools::displayError('An error occurred while copying archive to module directory.'); + $this->errors[] = Tools::displayError('An error occurred while copying archive to the module directory.'); else $this->extractArchive(_PS_MODULE_DIR_.$_FILES['file']['name']); } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } public function postProcessEnable() @@ -495,7 +542,7 @@ class AdminModulesControllerCore extends AdminController if (Validate::isLoadedObject($module)) { if (!$module->getPermission('configure')) - $this->errors[] = Tools::displayError('You do not have the permission to use this module'); + $this->errors[] = Tools::displayError('You do not have the permission to use this module.'); else { if (Tools::getValue('enable')) @@ -506,10 +553,10 @@ class AdminModulesControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('Cannot load module object'); + $this->errors[] = Tools::displayError('Cannot load the module\'s object.'); } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } public function postProcessDelete() @@ -520,11 +567,12 @@ class AdminModulesControllerCore extends AdminController { $module = Module::getInstanceByName(Tools::getValue('module_name')); if (Validate::isLoadedObject($module) && !$module->getPermission('configure')) - $this->errors[] = Tools::displayError('You do not have the permission to use this module'); + $this->errors[] = Tools::displayError('You do not have the permission to use this module.'); else { // Uninstall the module before deleting the files, but do not block the process if uninstall returns false - $module->uninstall(); + if (Module::isInstalled($module->name)) + $module->uninstall(); $moduleDir = _PS_MODULE_DIR_.str_replace(array('.', '/', '\\'), array('', '', ''), Tools::getValue('module_name')); $this->recursiveDeleteOnDisk($moduleDir); Tools::redirectAdmin(self::$currentIndex.'&conf=22&token='.$this->token.'&tab_module='.Tools::getValue('tab_module').'&module_name='.Tools::getValue('module_name')); @@ -532,7 +580,7 @@ class AdminModulesControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } public function postProcessCallback() @@ -554,16 +602,15 @@ class AdminModulesControllerCore extends AdminController if ($modules) foreach ($modules as $name) { - if ($key == 'update') - Tools::deleteDirectory('../modules/'.$name.'/'); - + $full_report = null; // If Addons module, download and unzip it before installing it - if (!is_dir('../modules/'.$name.'/')) + if (!file_exists('../modules/'.$name.'/'.$name.'.php') || $key == 'update') { $filesList = array( array('type' => 'addonsNative', 'file' => Module::CACHE_FILE_DEFAULT_COUNTRY_MODULES_LIST, 'loggedOnAddons' => 0), array('type' => 'addonsBought', 'file' => Module::CACHE_FILE_CUSTOMER_MODULES_LIST, 'loggedOnAddons' => 1), ); + foreach ($filesList as $f) if (file_exists(_PS_ROOT_DIR_.$f['file'])) { @@ -573,21 +620,28 @@ class AdminModulesControllerCore extends AdminController foreach ($xml->module as $modaddons) if ($name == $modaddons->name && isset($modaddons->id) && ($this->logged_on_addons || $f['loggedOnAddons'] == 0)) { + $download_ok = false; if ($f['loggedOnAddons'] == 0) - if (file_put_contents('../modules/'.$modaddons->name.'.zip', $this->addonsRequest('module', array('id_module' => pSQL($modaddons->id))))) - $this->extractArchive('../modules/'.$modaddons->name.'.zip', false); - if ($f['loggedOnAddons'] == 1 && $this->logged_on_addons) - if (file_put_contents('../modules/'.$modaddons->name.'.zip', $this->addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons)))))) - $this->extractArchive('../modules/'.$modaddons->name.'.zip', false); + if (file_put_contents(_PS_MODULE_DIR_.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id))))) + $download_ok = true; + elseif ($f['loggedOnAddons'] == 1 && $this->logged_on_addons) + if (file_put_contents(_PS_MODULE_DIR_.$modaddons->name.'.zip', Tools::addonsRequest('module', array('id_module' => pSQL($modaddons->id), 'username_addons' => pSQL(trim($this->context->cookie->username_addons)), 'password_addons' => pSQL(trim($this->context->cookie->password_addons)))))) + $download_ok = true; + + if (!$download_ok) + $this->errors[] = $this->l('Error on downloading the lastest version'); + else + if(!$this->extractArchive(_PS_MODULE_DIR_.$modaddons->name.'.zip', false)) + $this->errors[] = $this->l(sprintf("Module %s can't be upgraded: ", $modaddons->name)); } } - } + // Check potential error if (!($module = Module::getInstanceByName(urldecode($name)))) - $this->errors[] = $this->l('module not found'); + $this->errors[] = $this->l('Module not found'); elseif ($key == 'install' && $this->tabAccess['add'] !== '1') - $this->errors[] = Tools::displayError('You do not have permission to install a module.'); + $this->errors[] = Tools::displayError('You do not have permission to install this module.'); elseif ($key == 'uninstall' && ($this->tabAccess['delete'] !== '1' || !$module->getPermission('configure'))) $this->errors[] = Tools::displayError('You do not have permission to delete this module.'); elseif ($key == 'configure' && ($this->tabAccess['edit'] !== '1' || !$module->getPermission('configure') || !Module::isInstalled(urldecode($name)))) @@ -595,9 +649,9 @@ class AdminModulesControllerCore extends AdminController elseif ($key == 'install' && Module::isInstalled($module->name)) $this->errors[] = Tools::displayError('This module is already installed:').' '.$module->name; elseif ($key == 'uninstall' && !Module::isInstalled($module->name)) - $this->errors[] = Tools::displayError('This module is already uninstalled:').' '.$module->name; + $this->errors[] = Tools::displayError('This module has already been uninstalled:').' '.$module->name; else if ($key == 'update' && !Module::isInstalled($module->name)) - $this->errors[] = Tools::displayError('This module need to be installed to be updated:').' '.$module->name; + $this->errors[] = Tools::displayError('This module need to be installed in order to be updated:').' '.$module->name; else { // If we install a module, force temporary global context for multishop @@ -620,6 +674,10 @@ class AdminModulesControllerCore extends AdminController // Get the return value of current method $echo = $module->{$method}(); + + // After a successful install of a single module that has a configuration method, to the configuration page + if ($key == 'install' && $echo === true && strpos(Tools::getValue('install'), '|') === false && method_exists($module, 'getContent')) + Tools::redirectAdmin(self::$currentIndex.'&token='.$this->token.'&configure='.$module->name.'&conf=12'); } // If the method called is "configure" (getContent method), we show the html code of configure page @@ -636,7 +694,7 @@ class AdminModulesControllerCore extends AdminController
      • - '; @@ -682,6 +740,7 @@ class AdminModulesControllerCore extends AdminController } elseif ($echo === false) $module_errors[] = array('name' => $name, 'message' => $module->getErrors()); + if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && isset(Context::getContext()->tmpOldShop)) { Context::getContext()->shop = clone(Context::getContext()->tmpOldShop); @@ -739,6 +798,9 @@ class AdminModulesControllerCore extends AdminController // Call appropriate module callback if (!isset($ppmReturn)) $this->postProcessCallback(); + + if ($back = Tools::getValue('back')) + Tools::redirectAdmin($back); } /** @@ -767,42 +829,6 @@ class AdminModulesControllerCore extends AdminController return $html_error; } - /* - ** Display Modules Lists - ** - */ - protected $translationsTab = array(); - public function displayModuleOptions($module) - { - if (!isset($this->translationsTab['Disable this module'])) - { - $this->translationsTab['Disable this module'] = $this->l('Disable this module'); - $this->translationsTab['Enable this module for all shops'] = $this->l('Enable this module for all shops'); - $this->translationsTab['Disable'] = $this->l('Disable'); - $this->translationsTab['Enable'] = $this->l('Enable'); - $this->translationsTab['Reset'] = $this->l('Reset'); - $this->translationsTab['Configure'] = $this->l('Configure'); - $this->translationsTab['Delete'] = $this->l('Delete'); - $this->translationsTab['This action will permanently remove the module from the server. Are you sure you want to do this?'] = $this->l('This action will permanently remove the module from the server. Are you sure you want to do this?'); - } - - $return = ''; - $href = self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&tab_module='.$module->tab; - if ($module->id) - $return .= ' active && method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('desactive', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab.'" '.((Shop::isFeatureActive()) ? 'title="'.htmlspecialchars($module->active ? $this->translationsTab['Disable this module'] : $this->translationsTab['Enable this module for all shops']).'"' : '').'>'.($module->active ? $this->translationsTab['Disable'] : $this->translationsTab['Enable']).''; - - if ($module->id && $module->active) - $return .= (!empty($result) ? '|' : '').' '.$this->translationsTab['Reset'].''; - - if ($module->id && isset($module->is_configurable) && $module->is_configurable) - $return .= (!empty($result) ? '|' : '').' '.$this->translationsTab['Configure'].''; - - $hrefDelete = self::$currentIndex.'&delete='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name); - $return .= (!empty($result) ? '|' : '').' '.$this->translationsTab['Delete'].''; - - return $return; - } - public function initModulesList(&$modules) { foreach ($modules as $k => $module) @@ -934,7 +960,7 @@ class AdminModulesControllerCore extends AdminController // Module has not been filtered return false; } - + public function initContent() { // Adding Css @@ -960,7 +986,13 @@ class AdminModulesControllerCore extends AdminController // Retrieve Modules Preferences $modules_preferences = ''; + $tab_modules_preferences = array(); $modules_preferences_tmp = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'module_preference` WHERE `id_employee` = '.(int)$this->id_employee); + $tab_modules_preferences_tmp = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'tab_module_preference` WHERE `id_employee` = '.(int)$this->id_employee); + + foreach($tab_modules_preferences_tmp as $i => $j) + $tab_modules_preferences[$j['module']][] = $j['id_tab']; + foreach ($modules_preferences_tmp as $k => $v) { if ($v['interest'] == null) @@ -976,10 +1008,18 @@ class AdminModulesControllerCore extends AdminController $this->nb_modules_total = count($modules); $module_errors = array(); $module_success = array(); + $upgrade_available = array(); // Browse modules list foreach ($modules as $km => $module) { + //if we are in favorites view we only display installed modules + if (Tools::getValue('select') == 'favorites' && !$module->id) + { + unset($modules[$km]); + continue; + } + // Upgrade Module process, init check if a module could be upgraded if (Module::initUpgradeModule($module)) { @@ -1012,7 +1052,7 @@ class AdminModulesControllerCore extends AdminController $object = new $module->name(); $module_success[] = array('name' => $module->name, 'message' => array( 0 => $this->l('Current version:').$object->version, - 1 => $this->l('No file upgrades applied (none exist)')) + 1 => $this->l('No file upgrades applied (none exist).')) ); } else @@ -1042,38 +1082,23 @@ class AdminModulesControllerCore extends AdminController unset($modules[$km]); else { - $obj = null; - if ($module->onclick_option) - $obj = new $module->name(); - - // Fill module data - $modules[$km]->logo = '../../img/questionmark.png'; - if (file_exists('../modules/'.$module->name.'/logo.gif')) - $modules[$km]->logo = 'logo.gif'; - if (file_exists('../modules/'.$module->name.'/logo.png')) - $modules[$km]->logo = 'logo.png'; - $modules[$km]->optionsHtml = $this->displayModuleOptions($module); - $modules[$km]->categoryName = (isset($this->list_modules_categories[$module->tab]['name']) ? $this->list_modules_categories[$module->tab]['name'] : $this->list_modules_categories['others']['name']); - $modules[$km]->options['install_url'] = self::$currentIndex.'&install='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name); - $modules[$km]->options['update_url'] = self::$currentIndex.'&update='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name); - $modules[$km]->options['uninstall_url'] = self::$currentIndex.'&uninstall='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name); - - $modules[$km]->options['uninstall_onclick'] = ((!$module->onclick_option) ? - ((empty($module->confirmUninstall)) ? '' : 'return confirm(\''.addslashes($module->confirmUninstall).'\');') : - $obj->onclickOption('uninstall', $modules[$km]->options['uninstall_url'])); - - if ((Tools::getValue('module_name') == $module->name || in_array($module->name, explode('|', Tools::getValue('modules_list')))) && (int)Tools::getValue('conf') > 0) - $modules[$km]->message = $this->_conf[(int)Tools::getValue('conf')]; - - if ((Tools::getValue('module_name') == $module->name || in_array($module->name, explode('|', Tools::getValue('modules_list')))) && (int)Tools::getValue('conf') > 0) + $this->fillModuleData($module); + $module->categoryName = (isset($this->list_modules_categories[$module->tab]['name']) ? $this->list_modules_categories[$module->tab]['name'] : $this->list_modules_categories['others']['name']); if (isset($modules_preferences[$modules[$km]->name])) $modules[$km]->preferences = $modules_preferences[$modules[$km]->name]; - unset($obj); } unset($object); + if (isset($module->version_addons)) + $upgrade_available[] = array('anchor' => ucfirst($module->name), 'name' => $module->displayName);; } + // Don't display categories without modules + $cleaned_list = array(); + foreach ($this->list_modules_categories as $k => $list) + if ($list['nb'] > 0) + $cleaned_list[$k] = $list; + // Actually used for the report of the upgraded errors if (count($module_errors)) { @@ -1090,6 +1115,7 @@ class AdminModulesControllerCore extends AdminController $tpl_vars = array(); $tpl_vars['token'] = $this->token; + $tpl_vars['upgrade_available'] = $upgrade_available; $tpl_vars['currentIndex'] = self::$currentIndex; $tpl_vars['dirNameCurrentIndex'] = dirname(self::$currentIndex); $tpl_vars['ajaxCurrentIndex'] = str_replace('index', 'ajax-tab', self::$currentIndex); @@ -1111,13 +1137,14 @@ class AdminModulesControllerCore extends AdminController $tpl_vars['nb_modules_uninstalled'] = $tpl_vars['nb_modules'] - $tpl_vars['nb_modules_installed']; $tpl_vars['nb_modules_activated'] = $this->nb_modules_activated; $tpl_vars['nb_modules_unactivated'] = $tpl_vars['nb_modules_installed'] - $tpl_vars['nb_modules_activated']; - $tpl_vars['list_modules_categories'] = $this->list_modules_categories; + $tpl_vars['list_modules_categories'] = $cleaned_list; $tpl_vars['list_modules_authors'] = $this->modules_authors; $tpl_vars['check_url_fopen'] = (ini_get('allow_url_fopen') ? 'ok' : 'ko'); $tpl_vars['check_openssl'] = (extension_loaded('openssl') ? 'ok' : 'ko'); $tpl_vars['add_permission'] = $this->tabAccess['add']; + $tpl_vars['tab_modules_preferences'] = $tab_modules_preferences; if ($this->logged_on_addons) { diff --git a/controllers/admin/AdminModulesPositionsController.php b/controllers/admin/AdminModulesPositionsController.php index d5effb528..8b7820b19 100644 --- a/controllers/admin/AdminModulesPositionsController.php +++ b/controllers/admin/AdminModulesPositionsController.php @@ -1,6 +1,6 @@ o -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -48,10 +48,10 @@ class AdminModulesPositionsControllerCore extends AdminController Tools::redirectAdmin(self::$currentIndex.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); } else - $this->errors[] = Tools::displayError('module cannot be loaded'); + $this->errors[] = Tools::displayError('This module cannot be loaded'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } // Add new module in hook @@ -66,18 +66,18 @@ class AdminModulesPositionsControllerCore extends AdminController $hook = new Hook($id_hook); if (!$id_module || !Validate::isLoadedObject($module)) - $this->errors[] = Tools::displayError('module cannot be loaded'); + $this->errors[] = Tools::displayError('This module cannot be loaded'); elseif (!$id_hook || !Validate::isLoadedObject($hook)) $this->errors[] = Tools::displayError('Hook cannot be loaded.'); elseif (Hook::getModulesFromHook($id_hook, $id_module)) - $this->errors[] = Tools::displayError('This module is already transplanted to this hook'); + $this->errors[] = Tools::displayError('This module has already been transplanted to this hook'); elseif (!$module->isHookableOn($hook->name)) $this->errors[] = Tools::displayError('This module cannot be transplanted to this hook.'); // Adding vars... else { if (!$module->registerHook($hook->name, Shop::getContextListShopID())) - $this->errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); + $this->errors[] = Tools::displayError('An error occurred while transplanting the module to its hook.'); else { $exceptions = Tools::getValue('exceptions'); @@ -89,17 +89,17 @@ class AdminModulesPositionsControllerCore extends AdminController if (empty($except)) unset($exceptions[$key]); else if (!Validate::isFileName($except)) - $this->errors[] = Tools::displayError('No valid value for field exceptions'); + $this->errors[] = Tools::displayError('No valid value for field exceptions has been defined.'); } if (!$this->errors && !$module->registerExceptions($id_hook, $exceptions, Shop::getContextListShopID())) - $this->errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); + $this->errors[] = Tools::displayError('An error occurred while transplanting the module to its hook.'); } if (!$this->errors) Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); } } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } // Edit module from hook @@ -114,7 +114,7 @@ class AdminModulesPositionsControllerCore extends AdminController $hook = new Hook($id_hook); if (!$id_module || !Validate::isLoadedObject($module)) - $this->errors[] = Tools::displayError('module cannot be loaded'); + $this->errors[] = Tools::displayError('This module cannot be loaded'); elseif (!$id_hook || !Validate::isLoadedObject($hook)) $this->errors[] = Tools::displayError('Hook cannot be loaded.'); else @@ -129,14 +129,14 @@ class AdminModulesPositionsControllerCore extends AdminController // Check files name foreach ($exception as $except) if (!Validate::isFileName($except)) - $this->errors[] = Tools::displayError('No valid value for field exceptions'); + $this->errors[] = Tools::displayError('No valid value for field exceptions has been defined.'); $exceptions[$id] = $exception; } // Add files exceptions if (!$module->editExceptions($id_hook, $exceptions)) - $this->errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); + $this->errors[] = Tools::displayError('An error occurred while transplanting the module to its hook.'); if (!$this->errors) Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); @@ -148,18 +148,18 @@ class AdminModulesPositionsControllerCore extends AdminController // Check files name foreach ($exceptions as $except) if (!Validate::isFileName($except)) - $this->errors[] = Tools::displayError('No valid value for field exceptions'); + $this->errors[] = Tools::displayError('No valid value for field exceptions has been defined.'); // Add files exceptions if (!$module->editExceptions($id_hook, $exceptions, Shop::getContextListShopID())) - $this->errors[] = Tools::displayError('An error occurred while transplanting module to hook.'); + $this->errors[] = Tools::displayError('An error occurred while transplanting the module to its hook.'); else Tools::redirectAdmin(self::$currentIndex.'&conf=16'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); } } } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } // Delete module from hook @@ -172,25 +172,25 @@ class AdminModulesPositionsControllerCore extends AdminController $id_hook = (int)Tools::getValue('id_hook'); $hook = new Hook($id_hook); if (!Validate::isLoadedObject($module)) - $this->errors[] = Tools::displayError('module cannot be loaded'); + $this->errors[] = Tools::displayError('This module cannot be loaded'); elseif (!$id_hook || !Validate::isLoadedObject($hook)) $this->errors[] = Tools::displayError('Hook cannot be loaded.'); else { if (!$module->unregisterHook($id_hook, Shop::getContextListShopID()) || !$module->unregisterExceptions($id_hook, Shop::getContextListShopID())) - $this->errors[] = Tools::displayError('An error occurred while deleting module from hook.'); + $this->errors[] = Tools::displayError('An error occurred while deleting the module from its hook.'); else Tools::redirectAdmin(self::$currentIndex.'&conf=17'.($this->display_key ? '&show_modules='.$this->display_key : '').'&token='.$this->token); } } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } elseif (Tools::isSubmit('unhookform')) { if (!($unhooks = Tools::getValue('unhooks')) || !is_array($unhooks)) - $this->errors[] = Tools::displayError('Select a module to unhook.'); + $this->errors[] = Tools::displayError('Please select a module to unhook.'); else { foreach ($unhooks as $unhook) @@ -201,13 +201,13 @@ class AdminModulesPositionsControllerCore extends AdminController $module = Module::getInstanceById((int)$id_module); $hook = new Hook((int)$id_hook); if (!Validate::isLoadedObject($module)) - $this->errors[] = Tools::displayError('module cannot be loaded'); + $this->errors[] = Tools::displayError('This module cannot be loaded'); elseif (!$id_hook || !Validate::isLoadedObject($hook)) $this->errors[] = Tools::displayError('Hook cannot be loaded.'); else { if (!$module->unregisterHook((int)$id_hook) || !$module->unregisterExceptions((int)$id_hook)) - $this->errors[] = Tools::displayError('An error occurred while deleting module from hook.'); + $this->errors[] = Tools::displayError('An error occurred while deleting the module from its hook.'); } } if (!count($this->errors)) @@ -301,9 +301,11 @@ class AdminModulesPositionsControllerCore extends AdminController public function getLiveEditUrl($live_edit_params) { - $url = $this->context->shop->getBaseURL().Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params); - if (Configuration::get('PS_REWRITING_SETTINGS')) - $url = str_replace('index.php', '', $url); + $lang = ''; + if (Configuration::get('PS_REWRITING_SETTINGS') && count(Language::getLanguages(true)) > 1) + $lang = Language::getIsoById($this->context->employee->id_lang).'/'; + $url = $this->context->shop->getBaseURL().$lang.Dispatcher::getInstance()->createUrl('index', (int)$this->context->language->id, $live_edit_params); + return $url; } diff --git a/controllers/admin/AdminNotFoundController.php b/controllers/admin/AdminNotFoundController.php index 9193581e4..d26e92827 100644 --- a/controllers/admin/AdminNotFoundController.php +++ b/controllers/admin/AdminNotFoundController.php @@ -1,4 +1,28 @@ +* @copyright 2007-2013 PrestaShop SA +* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) +* International Registered Trademark & Property of PrestaShop SA +*/ class AdminNotFoundControllerCore extends AdminController { @@ -15,8 +39,7 @@ class AdminNotFoundControllerCore extends AdminController public function initContent() { $this->errors[] = Tools::displayError('Controller not found'); - $tpl_vars['controller'] = Tools::getvalue('controller'); - + $tpl_vars['controller'] = Tools::getvalue('controllerUri', Tools::getvalue('controller')); $this->context->smarty->assign($tpl_vars); parent::initContent(); } diff --git a/controllers/admin/AdminOrderMessageController.php b/controllers/admin/AdminOrderMessageController.php index dea15a1d9..0eeb6f53a 100644 --- a/controllers/admin/AdminOrderMessageController.php +++ b/controllers/admin/AdminOrderMessageController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/controllers/admin/AdminOrderPreferencesController.php b/controllers/admin/AdminOrderPreferencesController.php index cd60f3cad..fdaa117f5 100644 --- a/controllers/admin/AdminOrderPreferencesController.php +++ b/controllers/admin/AdminOrderPreferencesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -45,19 +45,14 @@ class AdminOrderPreferencesControllerCore extends AdminController $order_process_type = array( array( 'value' => PS_ORDER_PROCESS_STANDARD, - 'name' => $this->l('Standard (5 steps)') + 'name' => $this->l('Standard (Five steps)') ), array( 'value' => PS_ORDER_PROCESS_OPC, - 'name' => $this->l('One page checkout') + 'name' => $this->l('One-page checkout') ) ); - // Tax list - $taxes[] = array('id' => 0, 'name' => $this->l('None')); - foreach (Tax::getTaxes($this->context->language->id) as $tax) - $taxes[] = array('id' => $tax['id_tax'], 'name' => $tax['name']); - $this->fields_options = array( 'general' => array( 'title' => $this->l('General'), @@ -65,7 +60,7 @@ class AdminOrderPreferencesControllerCore extends AdminController 'fields' => array( 'PS_ORDER_PROCESS_TYPE' => array( 'title' => $this->l('Order process type'), - 'desc' => $this->l('You can choose the order process type as either standard (5 steps) or One Page Checkout'), + 'desc' => $this->l('Please choose either the five-step, or one-page, checkout process.'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', @@ -80,29 +75,29 @@ class AdminOrderPreferencesControllerCore extends AdminController 'type' => 'bool' ), 'PS_PURCHASE_MINIMUM' => array( - 'title' => $this->l('Minimum purchase total required in order to validate order'), + 'title' => $this->l('Minimum purchase total required in order to validate the order'), 'desc' => $this->l('Set to 0 to disable this feature'), 'validation' => 'isFloat', 'cast' => 'floatval', 'type' => 'price' ), 'PS_ALLOW_MULTISHIPPING' => array( - 'title' => $this->l('Allow multi-shipping'), - 'desc' => $this->l('Allow the customer to ship his order to multiple addresses. This option will convert the customer\'s cart into one or more orders.'), + 'title' => $this->l('Allow multishipping'), + 'desc' => $this->l('Allow the customer to ship orders to multiple addresses. This option will convert the customer\'s cart into one or more orders.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' ), 'PS_SHIP_WHEN_AVAILABLE' => array( 'title' => $this->l('Delayed shipping'), - 'desc' => $this->l('Allow the customer to split his order: one with the products currently "in stock", and another with the other products. This option will convert the customer\'s cart into two orders.'), + 'desc' => $this->l('This option allows you to delay shipping at your customers\' request. '), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' ), 'PS_CONDITIONS' => array( 'title' => $this->l('Terms of service'), - 'desc' => $this->l('Require customers to accept or decline terms of service before processing the order'), + 'desc' => $this->l('Require customers to accept or decline terms of service before processing an order.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', @@ -112,8 +107,8 @@ class AdminOrderPreferencesControllerCore extends AdminController ) ), 'PS_CONDITIONS_CMS_ID' => array( - 'title' => $this->l('Conditions of use CMS page'), - 'desc' => $this->l('Choose the Conditions of use CMS page'), + 'title' => $this->l('Conditions of use for the CMS page'), + 'desc' => $this->l('Choose the conditions of use for the CMS page.'), 'validation' => 'isInt', 'type' => 'select', 'list' => $cms_tab, @@ -127,27 +122,27 @@ class AdminOrderPreferencesControllerCore extends AdminController 'icon' => 'tab-preferences', 'fields' => array( 'PS_GIFT_WRAPPING' => array( - 'title' => $this->l('Offer gift-wrapping'), - 'desc' => $this->l('Suggest gift-wrapping to customer and possibility of leaving a message'), + 'title' => $this->l('Offer gift wrapping'), + 'desc' => $this->l('Suggest gift-wrapping to customers.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' ), 'PS_GIFT_WRAPPING_PRICE' => array( 'title' => $this->l('Gift-wrapping price'), - 'desc' => $this->l('Set a price for gift-wrapping'), + 'desc' => $this->l('Set a price for gift wrapping'), 'validation' => 'isPrice', 'cast' => 'floatval', 'type' => 'price' ), - 'PS_GIFT_WRAPPING_TAX' => array( + 'PS_GIFT_WRAPPING_TAX_RULES_GROUP' => array( 'title' => $this->l('Gift-wrapping tax'), - 'desc' => $this->l('Set a tax for gift-wrapping'), + 'desc' => $this->l('Set a tax for gift wrapping'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', - 'list' => $taxes, - 'identifier' => 'id' + 'list' => array_merge(array(array('id_tax_rules_group' => 0, 'name' => $this->l('None'))), TaxRulesGroup::getTaxRulesGroups(true)), + 'identifier' => 'id_tax_rules_group' ), 'PS_RECYCLABLE_PACK' => array( 'title' => $this->l('Offer recycled packaging'), diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index c42c28797..857887689 100755 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -35,7 +35,7 @@ class AdminOrdersControllerCore extends AdminController $this->lang = false; $this->addRowAction('view'); $this->explicitSelect = true; - + $this->allow_export = true; $this->deleted = false; $this->context = Context::getContext(); @@ -100,7 +100,7 @@ class AdminOrdersControllerCore extends AdminController 'currency' => true ), 'payment' => array( - 'title' => $this->l('Payment'), + 'title' => $this->l('Payment: '), 'width' => 100 ), 'osname' => array( @@ -148,7 +148,7 @@ class AdminOrdersControllerCore extends AdminController public function renderForm() { if (Context::getContext()->shop->getContext() != Shop::CONTEXT_SHOP && Shop::isFeatureActive()) - $this->errors[] = $this->l('You have to select a shop in order to create new orders.'); + $this->errors[] = $this->l('You have to select a shop before creating new orders.'); $id_cart = (int)Tools::getValue('id_cart'); $cart = new Cart((int)$id_cart); @@ -183,7 +183,7 @@ class AdminOrdersControllerCore extends AdminController 'show_toolbar' => $this->show_toolbar, 'toolbar_btn' => $this->toolbar_btn, 'toolbar_scroll' => $this->toolbar_scroll, - 'title' => array($this->l('Orders'), $this->l('create order')) + 'title' => array($this->l('Orders'), $this->l('Create order')) )); $this->content .= $this->createTemplate('form.tpl')->fetch(); } @@ -266,6 +266,7 @@ class AdminOrdersControllerCore extends AdminController $order = new Order(Tools::getValue('id_order')); if (!Validate::isLoadedObject($order)) throw new PrestaShopException('Can\'t load Order object'); + ShopUrl::cacheMainDomainForShop((int)$order->id_shop); } /* Update shipping number */ @@ -275,9 +276,9 @@ class AdminOrdersControllerCore extends AdminController { $order_carrier = new OrderCarrier(Tools::getValue('id_order_carrier')); if (!Validate::isLoadedObject($order_carrier)) - $this->errors[] = Tools::displayError('Order carrier ID is invalid'); + $this->errors[] = Tools::displayError('The order carrier ID is invalid.'); elseif (!Validate::isTrackingNumber(Tools::getValue('tracking_number'))) - $this->errors[] = Tools::displayError('Tracking number is incorrect'); + $this->errors[] = Tools::displayError('The tracking number is incorrect.'); else { // update shipping number @@ -301,24 +302,25 @@ class AdminOrdersControllerCore extends AdminController '{firstname}' => $customer->firstname, '{lastname}' => $customer->lastname, '{id_order}' => $order->id, + '{shipping_number}' => $order->shipping_number, '{order_name}' => $order->getUniqReference() ); if (@Mail::Send((int)$order->id_lang, 'in_transit', Mail::l('Package in transit', (int)$order->id_lang), $templateVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop)) { - Hook::exec('actionAdminOrdersTrackingNumberUpdate', array('order' => $order)); + Hook::exec('actionAdminOrdersTrackingNumberUpdate', array('order' => $order, 'customer' => $customer, 'carrier' => $carrier)); Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else - $this->errors[] = Tools::displayError('An error occurred while sending e-mail to the customer.'); + $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.'); } else - $this->errors[] = Tools::displayError('Order carrier can\'t be updated'); + $this->errors[] = Tools::displayError('The order carrier cannot be updated.'); } } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } /* Change order state, add a new entry in order history and send an e-mail to the customer if needed */ @@ -329,7 +331,7 @@ class AdminOrdersControllerCore extends AdminController $order_state = new OrderState(Tools::getValue('id_order_state')); if (!Validate::isLoadedObject($order_state)) - $this->errors[] = Tools::displayError('Invalid new order status'); + $this->errors[] = Tools::displayError('The new order status is invalid.'); else { $current_order_state = $order->getCurrentOrderState(); @@ -364,14 +366,14 @@ class AdminOrdersControllerCore extends AdminController Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int)$order->id.'&vieworder&token='.$this->token); } - $this->errors[] = Tools::displayError('An error occurred while changing the status or was unable to send e-mail to the customer.'); + $this->errors[] = Tools::displayError('An error occurred while changing order status, or we were unable to send an email to the customer.'); } else - $this->errors[] = Tools::displayError('This order is already assigned this status'); + $this->errors[] = Tools::displayError('The order has already been assigned this status.'); } } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } /* Add a new message for the current order and send an e-mail to the customer if needed */ @@ -381,9 +383,9 @@ class AdminOrdersControllerCore extends AdminController { $customer = new Customer(Tools::getValue('id_customer')); if (!Validate::isLoadedObject($customer)) - $this->errors[] = Tools::displayError('Customer is invalid'); + $this->errors[] = Tools::displayError('The customer is invalid.'); elseif (!Tools::getValue('message')) - $this->errors[] = Tools::displayError('Message cannot be blank'); + $this->errors[] = Tools::displayError('The message cannot be blank.'); else { /* Get message rules and and check fields validity */ @@ -427,13 +429,13 @@ class AdminOrdersControllerCore extends AdminController $customer_message->private = Tools::getValue('visibility'); if (!$customer_message->add()) - $this->errors[] = Tools::displayError('An error occurred while saving message'); + $this->errors[] = Tools::displayError('An error occurred while saving the message.'); elseif ($customer_message->private) Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int)$order->id.'&vieworder&conf=11&token='.$this->token); else { $message = $customer_message->message; - if (Configuration::get('PS_MAIL_TYPE') != Mail::TYPE_TEXT) + if (Configuration::get('PS_MAIL_TYPE', null, null, $order->id_shop) != Mail::TYPE_TEXT) $message = Tools::nl2br($customer_message->message); $varsTpl = array( @@ -448,12 +450,12 @@ class AdminOrdersControllerCore extends AdminController $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, (int)$order->id_shop)) Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=11'.'&token='.$this->token); } - $this->errors[] = Tools::displayError('An error occurred while sending e-mail to the customer.'); + $this->errors[] = Tools::displayError('An error occurred while sending an email to the customer.'); } } } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } /* Partial refund from order */ @@ -487,16 +489,24 @@ class AdminOrdersControllerCore extends AdminController if ($shipping_cost_amount > 0) $amount += $shipping_cost_amount; + $order_carrier = new OrderCarrier((int)$order->getIdOrderCarrier()); + if (Validate::isLoadedObject($order_carrier)) + { + $order_carrier->weight = (float)$order->getTotalWeight(); + if ($order_carrier->update()) + $order->weight = sprintf("%.3f ".Configuration::get('PS_WEIGHT_UNIT'), $order_carrier->weight); + } + if ($amount > 0) { if (!OrderSlip::createPartialOrderSlip($order, $amount, $shipping_cost_amount, $order_detail_list)) - $this->errors[] = Tools::displayError('Cannot generate partial credit slip'); + $this->errors[] = Tools::displayError('You cannot generate a partial credit slip.'); // Generate voucher if (Tools::isSubmit('generateDiscountRefund') && !count($this->errors)) { $cart_rule = new CartRule(); - $cart_rule->description = sprintf($this->l('Credit Slip for order #%d'), $order->id); + $cart_rule->description = sprintf($this->l('Credit card slip for order #%d'), $order->id); $languages = Language::getLanguages(false); foreach ($languages as $language) // Define a temporary name @@ -512,6 +522,7 @@ class AdminOrdersControllerCore extends AdminController $now = time(); $cart_rule->date_from = date('Y-m-d H:i:s', $now); $cart_rule->date_to = date('Y-m-d H:i:s', $now + (3600 * 24 * 365.25)); /* 1 year */ + $cart_rule->partial_use = 1; $cart_rule->active = 1; $cart_rule->reduction_amount = $amount; @@ -520,7 +531,7 @@ class AdminOrdersControllerCore extends AdminController $cart_rule->reduction_currency = $order->id_currency; if (!$cart_rule->add()) - $this->errors[] = Tools::displayError('Cannot generate voucher'); + $this->errors[] = Tools::displayError('You cannot generate a voucher.'); else { // Update the voucher code and name @@ -529,7 +540,7 @@ class AdminOrdersControllerCore extends AdminController $cart_rule->code = sprintf('V%1$dC%2$dO%3$d', $cart_rule->id, $order->id_customer, $order->id); if (!$cart_rule->update()) - $this->errors[] = Tools::displayError('Cannot generate voucher'); + $this->errors[] = Tools::displayError('You cannot generate a voucher.'); else { $currency = $this->context->currency; @@ -549,17 +560,17 @@ class AdminOrdersControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('You have to write an amount if you want to do a partial credit slip'); + $this->errors[] = Tools::displayError('You have to enter an amount if you want to create a partial credit slip.'); // Redirect if no errors if (!count($this->errors)) Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=30&token='.$this->token); } else - $this->errors[] = Tools::displayError('Partial refund data is incorrect'); + $this->errors[] = Tools::displayError('The partial refund data is incorrect.'); } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } /* Cancel product from order */ @@ -567,10 +578,10 @@ class AdminOrdersControllerCore extends AdminController { if ($this->tabAccess['delete'] === '1') { - if (!Tools::isSubmit('id_order_detail')) - $this->errors[] = Tools::displayError('You must select a product'); - elseif (!Tools::isSubmit('cancelQuantity')) - $this->errors[] = Tools::displayError('You must enter a quantity'); + if (!Tools::isSubmit('id_order_detail') && !Tools::isSubmit('id_customization')) + $this->errors[] = Tools::displayError('You must select a product.'); + elseif (!Tools::isSubmit('cancelQuantity') && !Tools::isSubmit('cancelCustomizationQuantity')) + $this->errors[] = Tools::displayError('You must enter a quantity.'); else { $productList = Tools::getValue('id_order_detail'); @@ -596,7 +607,8 @@ class AdminOrdersControllerCore extends AdminController foreach ($customizationList as $key => $id_order_detail) { $full_product_list[(int)$id_order_detail] = $id_order_detail; - $full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key]; + if (isset($customizationQtyList[$key])) + $full_quantity_list[(int)$id_order_detail] += $customizationQtyList[$key]; } if ($productList || $customizationList) @@ -610,7 +622,7 @@ class AdminOrdersControllerCore extends AdminController { $qtyCancelProduct = abs($qtyList[$key]); if (!$qtyCancelProduct) - $this->errors[] = Tools::displayError('No quantity selected for product.'); + $this->errors[] = Tools::displayError('No quantity has been selected for this product.'); $order_detail = new OrderDetail($id_order_detail); $customization_quantity = 0; @@ -618,7 +630,7 @@ class AdminOrdersControllerCore extends AdminController $customization_quantity = (int)$customization_quantities[$order_detail->product_id][$order_detail->product_attribute_id]; if (($order_detail->product_quantity - $customization_quantity - $order_detail->product_quantity_refunded - $order_detail->product_quantity_return) < $qtyCancelProduct) - $this->errors[] = Tools::displayError('Invalid quantity selected for product.'); + $this->errors[] = Tools::displayError('An invalid quantity was selected for this product.'); } } @@ -632,10 +644,10 @@ class AdminOrdersControllerCore extends AdminController $customization_quantity = $customization_quantities[$id_customization]; if (!$qtyCancelProduct) - $this->errors[] = Tools::displayError('No quantity selected for product.'); + $this->errors[] = Tools::displayError('No quantity has been selected for this product.'); if ($qtyCancelProduct > ($customization_quantity['quantity'] - ($customization_quantity['quantity_refunded'] + $customization_quantity['quantity_returned']))) - $this->errors[] = Tools::displayError('Invalid quantity selected for product.'); + $this->errors[] = Tools::displayError('An invalid quantity was selected for this product.'); } } @@ -650,8 +662,16 @@ class AdminOrdersControllerCore extends AdminController // Delete product $order_detail = new OrderDetail((int)$id_order_detail); - if (!$order->deleteProduct($order, $order_detail, $qtyCancelProduct)) - $this->errors[] = Tools::displayError('An error occurred during deletion of the product.').' '.$order_detail->product_name.''; + if (!$order->deleteProduct($order, $order_detail, $qty_cancel_product)) + $this->errors[] = Tools::displayError('An error occurred while attempting to delete the product.').' '.$order_detail->product_name.''; + // Update weight SUM + $order_carrier = new OrderCarrier((int)$order->getIdOrderCarrier()); + if (Validate::isLoadedObject($order_carrier)) + { + $order_carrier->weight = (float)$order->getTotalWeight(); + if ($order_carrier->update()) + $order->weight = sprintf("%.3f ".Configuration::get('PS_WEIGHT_UNIT'), $order_carrier->weight); + } Hook::exec('actionProductCancel', array('order' => $order, 'id_order_detail' => (int)$id_order_detail)); } if (!count($this->errors) && $customizationList) @@ -660,7 +680,7 @@ class AdminOrdersControllerCore extends AdminController $order_detail = new OrderDetail((int)($id_order_detail)); $qtyCancelProduct = abs($customizationQtyList[$id_customization]); if (!$order->deleteCustomization($id_customization, $qtyCancelProduct, $order_detail)) - $this->errors[] = Tools::displayError('An error occurred during deletion of product customization.').' '.$id_customization; + $this->errors[] = Tools::displayError('An error occurred while attempting to delete product customization.').' '.$id_customization; } // E-mail params if ((Tools::isSubmit('generateCreditSlip') || Tools::isSubmit('generateDiscount')) && !count($this->errors)) @@ -676,7 +696,7 @@ class AdminOrdersControllerCore extends AdminController if (Tools::isSubmit('generateCreditSlip') && !count($this->errors)) { if (!OrderSlip::createOrderSlip($order, $full_product_list, $full_quantity_list, Tools::isSubmit('shippingBack'))) - $this->errors[] = Tools::displayError('Cannot generate credit slip'); + $this->errors[] = Tools::displayError('A credit slip cannot be generated. '); else { Hook::exec('actionOrderSlipAdd', array('order' => $order, 'productList' => $full_product_list, 'qtyList' => $full_quantity_list)); @@ -703,7 +723,7 @@ class AdminOrdersControllerCore extends AdminController { $cartrule = new CartRule(); $languages = Language::getLanguages($order); - $cartrule->description = sprintf($this->l('Credit Slip for order #%d'), $order->id); + $cartrule->description = sprintf($this->l('Credit card slip for order #%d'), $order->id); foreach ($languages as $language) { // Define a temporary name @@ -736,7 +756,7 @@ class AdminOrdersControllerCore extends AdminController $cartrule->reduction_currency = $order->id_currency; if (!$cartrule->add()) - $this->errors[] = Tools::displayError('Cannot generate voucher'); + $this->errors[] = Tools::displayError('You cannot generate a voucher.'); else { // Update the voucher code and name @@ -744,7 +764,7 @@ class AdminOrdersControllerCore extends AdminController $cartrule->name[$language['id_lang']] = 'V'.(int)($cartrule->id).'C'.(int)($order->id_customer).'O'.$order->id; $cartrule->code = 'V'.(int)($cartrule->id).'C'.(int)($order->id_customer).'O'.$order->id; if (!$cartrule->update()) - $this->errors[] = Tools::displayError('Cannot generate voucher'); + $this->errors[] = Tools::displayError('You cannot generate a voucher.'); else { $currency = $this->context->currency; @@ -758,7 +778,7 @@ class AdminOrdersControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('No product or quantity selected.'); + $this->errors[] = Tools::displayError('No product or quantity has been selected.'); // Redirect if no errors if (!count($this->errors)) @@ -766,7 +786,7 @@ class AdminOrdersControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } elseif (Tools::isSubmit('messageReaded')) Message::markAsReaded(Tools::getValue('messageReaded'), $this->context->employee->id); @@ -783,29 +803,29 @@ class AdminOrdersControllerCore extends AdminController $order_invoice = null; if (!Validate::isLoadedObject($order)) - $this->errors[] = Tools::displayError('Order can\'t be found'); + $this->errors[] = Tools::displayError('The order cannot be found'); elseif (!Validate::isNegativePrice($amount)) - $this->errors[] = Tools::displayError('Amount is invalid'); + $this->errors[] = Tools::displayError('The amount is invalid.'); elseif (!Validate::isString(Tools::getValue('payment_method'))) - $this->errors[] = Tools::displayError('Payment method is invalid'); + $this->errors[] = Tools::displayError('The selected payment method is invalid.'); elseif (!Validate::isString(Tools::getValue('payment_transaction_id'))) - $this->errors[] = Tools::displayError('Transaction ID is invalid'); + $this->errors[] = Tools::displayError('The transaction ID is invalid.'); elseif (!Validate::isLoadedObject($currency)) - $this->errors[] = Tools::displayError('Currency is invalid'); + $this->errors[] = Tools::displayError('The selected currency is invalid.'); elseif ($order_has_invoice && !Validate::isLoadedObject($order_invoice)) - $this->errors[] = Tools::displayError('Invoice is invalid'); + $this->errors[] = Tools::displayError('The invoice is invalid.'); elseif (!Validate::isDate(Tools::getValue('payment_date'))) - $this->errors[] = Tools::displayError('Date is invalid'); + $this->errors[] = Tools::displayError('The date is invalid'); else { if (!$order->addOrderPayment($amount, Tools::getValue('payment_method'), Tools::getValue('payment_transaction_id'), $currency, Tools::getValue('payment_date'), $order_invoice)) - $this->errors[] = Tools::displayError('An error occurred on adding order payment'); + $this->errors[] = Tools::displayError('An error occurred during payment.'); else Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::isSubmit('submitEditNote')) { @@ -819,13 +839,13 @@ class AdminOrdersControllerCore extends AdminController if ($order_invoice->save()) Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order_invoice->id_order.'&vieworder&conf=4&token='.$this->token); else - $this->errors[] = Tools::displayError('Unable to save invoice note.'); + $this->errors[] = Tools::displayError('The invoice note was not saved.'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else - $this->errors[] = Tools::displayError('Unable to load invoice for edit note.'); + $this->errors[] = Tools::displayError('The invoice for edit note was unable to load. '); } elseif (Tools::isSubmit('submitAddOrder') && ($id_cart = Tools::getValue('id_cart')) && ($module_name = Tools::getValue('payment_module_name')) && @@ -840,14 +860,14 @@ class AdminOrdersControllerCore extends AdminController $employee = new Employee((int)Context::getContext()->cookie->id_employee); $payment_module->validateOrder( (int)$cart->id, (int)$id_order_state, - $cart->getOrderTotal(true, Cart::BOTH), $payment_module->displayName, $this->l('Manual order - Employee:'). + $cart->getOrderTotal(true, Cart::BOTH), $payment_module->displayName, $this->l('Manual order -- Employee:'). Tools::safeOutput(substr($employee->firstname, 0, 1).'. '.$employee->lastname), array(), null, false, $cart->secure_key ); if ($payment_module->currentOrder) Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token); } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } elseif ((Tools::isSubmit('submitAddressShipping') || Tools::isSubmit('submitAddressInvoice')) && isset($order)) { @@ -868,7 +888,7 @@ class AdminOrdersControllerCore extends AdminController $this->errors[] = Tools::displayErrror('This address can\'t be loaded'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::isSubmit('submitChangeCurrency') && isset($order)) { @@ -910,13 +930,10 @@ class AdminOrdersControllerCore extends AdminController $order_detail->updateTaxAmount($order); } - $id_order_carrier = Db::getInstance()->getValue(' - SELECT `id_order_carrier` - FROM `'._DB_PREFIX_.'order_carrier` - WHERE `id_order` = '.(int)$order->id); + $id_order_carrier = (int)$order->getIdOrderCarrier(); if ($id_order_carrier) { - $order_carrier = new OrderCarrier($id_order_carrier); + $order_carrier = $order_carrier = new OrderCarrier((int)$order->getIdOrderCarrier()); $order_carrier->shipping_cost_tax_excl = (float)Tools::convertPriceFull($order_carrier->shipping_cost_tax_excl, $old_currency, $currency); $order_carrier->shipping_cost_tax_incl = (float)Tools::convertPriceFull($order_carrier->shipping_cost_tax_incl, $old_currency, $currency); $order_carrier->update(); @@ -959,22 +976,22 @@ class AdminOrdersControllerCore extends AdminController // Update currency in order $order->id_currency = $currency->id; - // Update conversion rate + // Update exchange rate $order->conversion_rate = (float)$currency->conversion_rate; $order->update(); } else - $this->errors[] = Tools::displayError('You cannot change the currency'); + $this->errors[] = Tools::displayError('You cannot change the currency.'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::isSubmit('submitGenerateInvoice') && isset($order)) { - if (!Configuration::get('PS_INVOICE')) - $this->errors[] = Tools::displayError('Invoice management has been disabled'); + if (!Configuration::get('PS_INVOICE', null, null, $order->id_shop)) + $this->errors[] = Tools::displayError('Invoice management has been disabled.'); elseif ($order->hasInvoice()) - $this->errors[] = Tools::displayError('This order already has an invoice'); + $this->errors[] = Tools::displayError('This order already has an invoice.'); else { $order->setInvoice(true); @@ -1020,17 +1037,17 @@ class AdminOrdersControllerCore extends AdminController Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); } else - $this->errors[] = Tools::displayError('Cannot edit this Order Cart Rule'); + $this->errors[] = Tools::displayError('You cannot edit this cart rule.'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::getValue('submitNewVoucher') && isset($order)) { if ($this->tabAccess['edit'] === '1') { if (!Tools::getValue('discount_name')) - $this->errors[] = Tools::displayError('You must specify a name in order to create a new discount'); + $this->errors[] = Tools::displayError('You must specify a name in order to create a new discount.'); else { if ($order->hasInvoice()) @@ -1045,16 +1062,17 @@ class AdminOrdersControllerCore extends AdminController } $cart_rules = array(); + $discount_value = (float)str_replace(',', '.', Tools::getValue('discount_value')); switch (Tools::getValue('discount_type')) { // Percent type case 1: - if (Tools::getValue('discount_value') < 100) + if ($discount_value < 100) { if (isset($order_invoice)) { - $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($order_invoice->total_paid_tax_incl * Tools::getValue('discount_value') / 100, 2); - $cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($order_invoice->total_paid_tax_excl * Tools::getValue('discount_value') / 100, 2); + $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($order_invoice->total_paid_tax_incl * $discount_value / 100, 2); + $cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($order_invoice->total_paid_tax_excl * $discount_value / 100, 2); // Update OrderInvoice $this->applyDiscountOnInvoice($order_invoice, $cart_rules[$order_invoice->id]['value_tax_incl'], $cart_rules[$order_invoice->id]['value_tax_excl']); @@ -1064,8 +1082,8 @@ class AdminOrdersControllerCore extends AdminController $order_invoices_collection = $order->getInvoicesCollection(); foreach ($order_invoices_collection as $order_invoice) { - $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($order_invoice->total_paid_tax_incl * Tools::getValue('discount_value') / 100, 2); - $cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($order_invoice->total_paid_tax_excl * Tools::getValue('discount_value') / 100, 2); + $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($order_invoice->total_paid_tax_incl * $discount_value / 100, 2); + $cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($order_invoice->total_paid_tax_excl * $discount_value / 100, 2); // Update OrderInvoice $this->applyDiscountOnInvoice($order_invoice, $cart_rules[$order_invoice->id]['value_tax_incl'], $cart_rules[$order_invoice->id]['value_tax_excl']); @@ -1073,23 +1091,23 @@ class AdminOrdersControllerCore extends AdminController } else { - $cart_rules[0]['value_tax_incl'] = Tools::ps_round($order->total_paid_tax_incl * Tools::getValue('discount_value') / 100, 2); - $cart_rules[0]['value_tax_excl'] = Tools::ps_round($order->total_paid_tax_excl * Tools::getValue('discount_value') / 100, 2); + $cart_rules[0]['value_tax_incl'] = Tools::ps_round($order->total_paid_tax_incl * $discount_value / 100, 2); + $cart_rules[0]['value_tax_excl'] = Tools::ps_round($order->total_paid_tax_excl * $discount_value / 100, 2); } } else - $this->errors[] = Tools::displayError('Discount value is invalid'); + $this->errors[] = Tools::displayError('The discount value is invalid.'); break; // Amount type case 2: if (isset($order_invoice)) { - if (Tools::getValue('discount_value') > $order_invoice->total_paid_tax_incl) - $this->errors[] = Tools::displayError('Discount value is greater than the order invoice total'); + if ($discount_value > $order_invoice->total_paid_tax_incl) + $this->errors[] = Tools::displayError('The discount value is greater than the order invoice total.'); else { - $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2); - $cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round(Tools::getValue('discount_value') / (1 + ($order->getTaxesAverageUsed() / 100)), 2); + $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($discount_value, 2); + $cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($discount_value / (1 + ($order->getTaxesAverageUsed() / 100)), 2); // Update OrderInvoice $this->applyDiscountOnInvoice($order_invoice, $cart_rules[$order_invoice->id]['value_tax_incl'], $cart_rules[$order_invoice->id]['value_tax_excl']); @@ -1100,12 +1118,12 @@ class AdminOrdersControllerCore extends AdminController $order_invoices_collection = $order->getInvoicesCollection(); foreach ($order_invoices_collection as $order_invoice) { - if (Tools::getValue('discount_value') > $order_invoice->total_paid_tax_incl) - $this->errors[] = Tools::displayError('Discount value is greater than the order invoice total (Invoice:').$order_invoice->getInvoiceNumberFormatted(Context::getContext()->language->id).')'; + if ($discount_value > $order_invoice->total_paid_tax_incl) + $this->errors[] = Tools::displayError('The discount value is greater than the order invoice total.').$order_invoice->getInvoiceNumberFormatted(Context::getContext()->language->id, (int)$order->id_shop).')'; else { - $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2); - $cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round(Tools::getValue('discount_value') / (1 + ($order->getTaxesAverageUsed() / 100)), 2); + $cart_rules[$order_invoice->id]['value_tax_incl'] = Tools::ps_round($discount_value, 2); + $cart_rules[$order_invoice->id]['value_tax_excl'] = Tools::ps_round($discount_value / (1 + ($order->getTaxesAverageUsed() / 100)), 2); // Update OrderInvoice $this->applyDiscountOnInvoice($order_invoice, $cart_rules[$order_invoice->id]['value_tax_incl'], $cart_rules[$order_invoice->id]['value_tax_excl']); @@ -1114,12 +1132,12 @@ class AdminOrdersControllerCore extends AdminController } else { - if (Tools::getValue('discount_value') > $order->total_paid_tax_incl) - $this->errors[] = Tools::displayError('Discount value is greater than the order total'); + if ($discount_value > $order->total_paid_tax_incl) + $this->errors[] = Tools::displayError('The discount value is greater than the order total.'); else { - $cart_rules[0]['value_tax_incl'] = Tools::ps_round(Tools::getValue('discount_value'), 2); - $cart_rules[0]['value_tax_excl'] = Tools::ps_round(Tools::getValue('discount_value') / (1 + ($order->getTaxesAverageUsed() / 100)), 2); + $cart_rules[0]['value_tax_incl'] = Tools::ps_round($discount_value, 2); + $cart_rules[0]['value_tax_excl'] = Tools::ps_round($discount_value / (1 + ($order->getTaxesAverageUsed() / 100)), 2); } } break; @@ -1157,7 +1175,7 @@ class AdminOrdersControllerCore extends AdminController } break; default: - $this->errors[] = Tools::displayError('Discount type is invalid'); + $this->errors[] = Tools::displayError('The discount type is invalid.'); } $res = true; @@ -1170,7 +1188,7 @@ class AdminOrdersControllerCore extends AdminController $cartRuleObj->quantity = 0; $cartRuleObj->quantity_per_user = 1; if (Tools::getValue('discount_type') == 1) - $cartRuleObj->reduction_percent = Tools::getValue('discount_value'); + $cartRuleObj->reduction_percent = $discount_value; elseif (Tools::getValue('discount_type') == 2) $cartRuleObj->reduction_amount = $cart_rule['value_tax_excl']; elseif (Tools::getValue('discount_type') == 3) @@ -1211,11 +1229,11 @@ class AdminOrdersControllerCore extends AdminController if ($res) Tools::redirectAdmin(self::$currentIndex.'&id_order='.$order->id.'&vieworder&conf=4&token='.$this->token); else - $this->errors[] = Tools::displayError('An error occurred on OrderCartRule creation'); + $this->errors[] = Tools::displayError('An error occurred during the OrderCartRule creation'); } } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } parent::postProcess(); @@ -1259,6 +1277,11 @@ class AdminOrdersControllerCore extends AdminController } $this->toolbar_title = sprintf($this->l('Order #%1$d (%2$s) - %3$s %4$s'), $order->id, $order->reference, $customer->firstname, $customer->lastname); + if (Shop::isFeatureActive()) + { + $shop = new Shop((int)$order->id_shop); + $this->toolbar_title .= ' - '.sprintf($this->l('Shop: %s'), $shop->name); + } // gets warehouses to ship products, if and only if advanced stock management is activated $warehouse_list = null; @@ -1284,14 +1307,14 @@ class AdminOrdersControllerCore extends AdminController foreach (PaymentModule::getInstalledPaymentModules() as $payment) { $module = Module::getInstanceByName($payment['name']); - if (Validate::isLoadedObject($module)) + if (Validate::isLoadedObject($module) && $module->active) $payment_methods[] = $module->displayName; } // display warning if there are products out of stock $display_out_of_stock_warning = false; $current_order_state = $order->getCurrentOrderState(); - if ($current_order_state->delivery != 1 && $current_order_state->shipped != 1) + if (Configuration::get('PS_STOCK_MANAGEMENT') && (!Validate::isLoadedObject($current_order_state) || ($current_order_state->delivery != 1 && $current_order_state->shipped != 1))) $display_out_of_stock_warning = true; // products current stock (from stock_available) @@ -1351,7 +1374,7 @@ class AdminOrdersControllerCore extends AdminController 'invoices_collection' => $order->getInvoicesCollection(), 'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(), 'payment_methods' => $payment_methods, - 'invoice_management_active' => Configuration::get('PS_INVOICE') + 'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $order->id_shop) ); return parent::renderView(); @@ -1463,10 +1486,10 @@ class AdminOrdersControllerCore extends AdminController ); if (Mail::Send((int)$cart->id_lang, 'backoffice_order', Mail::l('Process the payment of your order', (int)$cart->id_lang), $mailVars, $customer->email, $customer->firstname.' '.$customer->lastname, null, null, null, null, _PS_MAIL_DIR_, true, $cart->id_shop)) - die(Tools::jsonEncode(array('errors' => false, 'result' => $this->l('The mail was sent to your customer.')))); + die(Tools::jsonEncode(array('errors' => false, 'result' => $this->l('The email was sent to your customer.')))); } } - $this->content = Tools::jsonEncode(array('errors' => true, 'result' => $this->l('Error in sending the e-mail to your customer.'))); + $this->content = Tools::jsonEncode(array('errors' => true, 'result' => $this->l('Error in sending the email to your customer.'))); } } @@ -1477,13 +1500,13 @@ class AdminOrdersControllerCore extends AdminController if (!Validate::isLoadedObject($order)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Order object') + 'error' => Tools::displayError('The order object cannot be loaded.') ))); if ($order->hasBeenShipped()) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t add a product on delivered order') + 'error' => Tools::displayError('You cannot add products to delivered orders. ') ))); $product_informations = $_POST['add_product']; @@ -1495,7 +1518,7 @@ class AdminOrdersControllerCore extends AdminController if (!Validate::isLoadedObject($product)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Product object') + 'error' => Tools::displayError('The product object cannot be loaded.') ))); if (isset($product_informations['product_attribute_id']) && $product_informations['product_attribute_id']) @@ -1504,7 +1527,7 @@ class AdminOrdersControllerCore extends AdminController if (!Validate::isLoadedObject($combination)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Combination object') + 'error' => Tools::displayError('The combination object cannot be loaded.') ))); } @@ -1520,9 +1543,7 @@ class AdminOrdersControllerCore extends AdminController $cart->id_address_delivery = $order->id_address_delivery; $cart->id_address_invoice = $order->id_address_invoice; $cart->id_currency = $order->id_currency; - $cart->id_customer = $order->id_customer; $cart->id_lang = $order->id_lang; - $cart->id_carrier = $order->id_carrier; $cart->secure_key = $order->secure_key; // Save new cart @@ -1536,7 +1557,7 @@ class AdminOrdersControllerCore extends AdminController $use_taxes = true; $initial_product_price_tax_incl = Product::getPriceStatic($product->id, $use_taxes, isset($combination) ? $combination->id : null, 2, null, false, true, 1, - false, $order->id_customer, $cart->id, $order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + false, $order->id_customer, $cart->id, $order->{Configuration::get('PS_TAX_ADDRESS_TYPE', null, null, $order->id_shop)}); // Creating specific price if needed if ($product_informations['product_price_tax_incl'] != $initial_product_price_tax_incl) @@ -1613,11 +1634,11 @@ class AdminOrdersControllerCore extends AdminController $order_invoice->id_order = $order->id; if ($order_invoice->number) - Configuration::updateValue('PS_INVOICE_START_NUMBER', false); + Configuration::updateValue('PS_INVOICE_START_NUMBER', false, false, null, $order->id_shop); else $order_invoice->number = Order::getLastInvoiceNumber() + 1; - $invoice_address = new Address((int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE')}); + $invoice_address = new Address((int)$order->{Configuration::get('PS_TAX_ADDRESS_TYPE', null, null, $order->id_shop)}); $carrier = new Carrier((int)$order->id_carrier); $tax_calculator = $carrier->getTaxCalculator($invoice_address); @@ -1689,6 +1710,15 @@ class AdminOrdersControllerCore extends AdminController // Save changes of order $order->update(); + + // Update weight SUM + $order_carrier = new OrderCarrier((int)$order->getIdOrderCarrier()); + if (Validate::isLoadedObject($order_carrier)) + { + $order_carrier->weight = (float)$order->getTotalWeight(); + if ($order_carrier->update()) + $order->weight = sprintf("%.3f ".Configuration::get('PS_WEIGHT_UNIT'), $order_carrier->weight); + } // Update Tax lines $order_detail->updateTaxAmount($order); @@ -1714,7 +1744,7 @@ class AdminOrdersControllerCore extends AdminController $invoice_array = array(); foreach ($invoice_collection as $invoice) { - $invoice->name = $invoice->getInvoiceNumberFormatted(Context::getContext()->language->id); + $invoice->name = $invoice->getInvoiceNumberFormatted(Context::getContext()->language->id, (int)$order->id_shop); $invoice_array[] = $invoice; } @@ -1772,21 +1802,21 @@ class AdminOrdersControllerCore extends AdminController if (!Validate::isLoadedObject($order_detail)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load OrderDetail object') + 'error' => Tools::displayError('The OrderDetail object cannot be loaded.') ))); $product = new Product($order_detail->product_id); if (!Validate::isLoadedObject($product)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Product object') + 'error' => Tools::displayError('The product object cannot be loaded.') ))); $address = new Address(Tools::getValue('id_address')); if (!Validate::isLoadedObject($address)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Address object') + 'error' => Tools::displayError('The address object cannot be loaded.') ))); die(Tools::jsonEncode(array( @@ -1896,6 +1926,17 @@ class AdminOrdersControllerCore extends AdminController // Save order detail $res &= $order_detail->update(); + + // Update weight SUM + $order_carrier = new OrderCarrier((int)$order->getIdOrderCarrier()); + if (Validate::isLoadedObject($order_carrier)) + { + $order_carrier->weight = (float)$order->getTotalWeight(); + $res &= $order_carrier->update(); + if ($res) + $order->weight = sprintf("%.3f ".Configuration::get('PS_WEIGHT_UNIT'), $order_carrier->weight); + } + // Save order invoice if (isset($order_invoice)) $res &= $order_invoice->update(); @@ -1910,14 +1951,14 @@ class AdminOrdersControllerCore extends AdminController $product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity']; $product['amount_refundable'] = $product['total_price_tax_incl'] - $resume['amount_tax_incl']; $product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl']); - + $product['refund_history'] = OrderSlip::getProductSlipDetail($order_detail->id); // Get invoices collection $invoice_collection = $order->getInvoicesCollection(); $invoice_array = array(); foreach ($invoice_collection as $invoice) { - $invoice->name = $invoice->getInvoiceNumberFormatted(Context::getContext()->language->id); + $invoice->name = $invoice->getInvoiceNumberFormatted(Context::getContext()->language->id, (int)$order->id_shop); $invoice_array[] = $invoice; } @@ -1936,7 +1977,7 @@ class AdminOrdersControllerCore extends AdminController if (!$res) die(Tools::jsonEncode(array( 'result' => $res, - 'error' => Tools::displayError('Error occurred while editing this product line') + 'error' => Tools::displayError('An error occurred while editing the product line.') ))); @@ -1964,8 +2005,8 @@ class AdminOrdersControllerCore extends AdminController { $res = true; - $order_detail = new OrderDetail(Tools::getValue('id_order_detail')); - $order = new Order(Tools::getValue('id_order')); + $order_detail = new OrderDetail((int)Tools::getValue('id_order_detail')); + $order = new Order((int)Tools::getValue('id_order')); $this->doDeleteProductLineValidation($order_detail, $order); @@ -1989,13 +2030,26 @@ class AdminOrdersControllerCore extends AdminController $res &= $order->update(); + // Reinject quantity in stock + $this->reinjectQuantity($order_detail, $order_detail->product_quantity); + // Delete OrderDetail $res &= $order_detail->delete(); + + // Update weight SUM + $order_carrier = new OrderCarrier((int)$order->getIdOrderCarrier()); + if (Validate::isLoadedObject($order_carrier)) + { + $order_carrier->weight = (float)$order->getTotalWeight(); + $res &= $order_carrier->update(); + if ($res) + $order->weight = sprintf("%.3f ".Configuration::get('PS_WEIGHT_UNIT'), $order_carrier->weight); + } if (!$res) die(Tools::jsonEncode(array( 'result' => $res, - 'error' => Tools::displayError('Error occurred on deletion of this product line') + 'error' => Tools::displayError('An error occurred while attempting to delete the product line.') ))); // Get invoices collection @@ -2004,7 +2058,7 @@ class AdminOrdersControllerCore extends AdminController $invoice_array = array(); foreach ($invoice_collection as $invoice) { - $invoice->name = $invoice->getInvoiceNumberFormatted(Context::getContext()->language->id); + $invoice->name = $invoice->getInvoiceNumberFormatted(Context::getContext()->language->id, (int)$order->id_shop); $invoice_array[] = $invoice; } @@ -2034,38 +2088,38 @@ class AdminOrdersControllerCore extends AdminController if (!Validate::isLoadedObject($order_detail)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Order Detail object') + 'error' => Tools::displayError('The Order Detail object could not be loaded.') ))); if (!empty($order_invoice) && !Validate::isLoadedObject($order_invoice)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Invoice object') + 'error' => Tools::displayError('The invoice object cannot be loaded.') ))); if (!Validate::isLoadedObject($order)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Order object') + 'error' => Tools::displayError('The order object cannot be loaded.') ))); if ($order_detail->id_order != $order->id) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t edit this Order Detail for this order') + 'error' => Tools::displayError('You cannot edit the order detail for this order.') ))); // We can't edit a delivered order if ($order->hasBeenDelivered()) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t edit a delivered order') + 'error' => Tools::displayError('You cannot edit a delivered order.') ))); if (!empty($order_invoice) && $order_invoice->id_order != Tools::getValue('id_order')) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t use this invoice for this order') + 'error' => Tools::displayError('You cannot use this invoice for the order') ))); // Clean price @@ -2097,26 +2151,26 @@ class AdminOrdersControllerCore extends AdminController if (!Validate::isLoadedObject($order_detail)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Order Detail object') + 'error' => Tools::displayError('The Order Detail object could not be loaded.') ))); if (!Validate::isLoadedObject($order)) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t load Order object') + 'error' => Tools::displayError('The order object cannot be loaded.') ))); if ($order_detail->id_order != $order->id) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t delete this Order Detail for this order') + 'error' => Tools::displayError('You cannot delete the order detail.') ))); // We can't edit a delivered order if ($order->hasBeenDelivered()) die(Tools::jsonEncode(array( 'result' => false, - 'error' => Tools::displayError('Can\'t edit a delivered order') + 'error' => Tools::displayError('You cannot edit a delivered order.') ))); } @@ -2190,7 +2244,7 @@ class AdminOrdersControllerCore extends AdminController ); } else - $this->errors[] = Tools::displayError('Cannot re-stock product'); + $this->errors[] = Tools::displayError('This product cannot be re-stocked.'); } protected function applyDiscountOnInvoice($order_invoice, $value_tax_incl, $value_tax_excl) diff --git a/controllers/admin/AdminOutstandingController.php b/controllers/admin/AdminOutstandingController.php index d7ea74bfe..357b8249f 100644 --- a/controllers/admin/AdminOutstandingController.php +++ b/controllers/admin/AdminOutstandingController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/controllers/admin/AdminPPreferencesController.php b/controllers/admin/AdminPPreferencesController.php index f701401e7..ee69e93ea 100644 --- a/controllers/admin/AdminPPreferencesController.php +++ b/controllers/admin/AdminPPreferencesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -39,15 +39,15 @@ class AdminPPreferencesControllerCore extends AdminController 'fields' => array( 'PS_CATALOG_MODE' => array( 'title' => $this->l('Catalog mode'), - 'desc' => $this->l('When active, all shopping features will be disabled'), + 'desc' => $this->l('When active, all shopping features will be disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, 'type' => 'bool' ), 'PS_COMPARATOR_MAX_ITEM' => array( - 'title' => $this->l('Products comparison'), - 'desc' => $this->l('Set the maximum number of products that can be selected for comparison.').' '.$this->l('Set to 0 to disable this feature'), + 'title' => $this->l('Product comparison'), + 'desc' => $this->l('Set the maximum number of products that can be selected for comparison.').' '.$this->l('Set to "0" to disable this feature.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', @@ -60,21 +60,21 @@ class AdminPPreferencesControllerCore extends AdminController 'type' => 'text' ), 'PS_CART_REDIRECT' => array( - 'title' => $this->l('Redirection after adding product to cart'), - 'desc' => $this->l('Only for non-AJAX version of the cart'), + 'title' => $this->l('Redirect after adding product to cart'), + 'desc' => $this->l('Only for non-AJAX versions of the cart.'), 'cast' => 'intval', 'show' => true, 'required' => false, 'type' => 'radio', 'validation' => 'isBool', 'choices' => array( - 0 => $this->l('previous page'), - 1 => $this->l('cart summary') + 0 => $this->l('Previous page'), + 1 => $this->l('Cart summary') ) ), 'PS_PRODUCT_SHORT_DESC_LIMIT' => array( - 'title' => $this->l('Short description max size'), - 'desc' => $this->l('Set the maximum size of product short description (in characters)'), + 'title' => $this->l('Max size of short description'), + 'desc' => $this->l('Set the maximum size of product short description (in characters).'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'text', @@ -89,7 +89,7 @@ class AdminPPreferencesControllerCore extends AdminController 'type' => 'radio', 'validation' => 'isBool', 'choices' => array( - 0 => $this->l('Products'), + 0 => $this->l('Products:'), 1 => $this->l('Combinations') ) ) @@ -107,12 +107,12 @@ class AdminPPreferencesControllerCore extends AdminController ), 'PS_PRODUCTS_ORDER_BY' => array( 'title' => $this->l('Default order by'), - 'desc' => $this->l('The order in which products are displayed in the product list'), + 'desc' => $this->l('The order in which products are displayed in the product list.'), 'type' => 'select', 'list' => array( array('id' => '0', 'name' => $this->l('Product name')), array('id' => '1', 'name' => $this->l('Product price')), - array('id' => '2', 'name' => $this->l('Product added date')), + array('id' => '2', 'name' => $this->l('Product add date')), array('id' => '3', 'name' => $this->l('Product modified date')), array('id' => '4', 'name' => $this->l('Position inside category')), array('id' => '5', 'name' => $this->l('Manufacturer')), @@ -142,7 +142,7 @@ class AdminPPreferencesControllerCore extends AdminController 'title' => $this->l('Product page'), 'fields' => array( 'PS_DISPLAY_QTIES' => array( - 'title' => $this->l('Display available quantities on product page'), + 'title' => $this->l('Display available quantities on the product page'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', @@ -150,15 +150,15 @@ class AdminPPreferencesControllerCore extends AdminController 'type' => 'bool' ), 'PS_LAST_QTIES' => array( - 'title' => $this->l('Display remaining quantities when qty is lower than'), - 'desc' => $this->l('Set to 0 to disable this feature'), + 'title' => $this->l('Display remaining quantities when the qty is lower than'), + 'desc' => $this->l('Set to "0" to disable this feature.'), 'validation' => 'isUnsignedId', 'required' => true, 'cast' => 'intval', 'type' => 'text' ), 'PS_DISPLAY_JQZOOM' => array( - 'title' => $this->l('Enable JqZoom instead of Thickbox on product page'), + 'title' => $this->l('Enable JqZoom instead of Thickbox on the product page'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', @@ -166,7 +166,7 @@ class AdminPPreferencesControllerCore extends AdminController 'type' => 'bool' ), 'PS_DISP_UNAVAILABLE_ATTR' => array( - 'title' => $this->l('Display unavailable product attributes on product page'), + 'title' => $this->l('Display unavailable product attributes on the product page'), 'desc' => '', 'validation' => 'isBool', 'cast' => 'intval', @@ -174,8 +174,8 @@ class AdminPPreferencesControllerCore extends AdminController 'type' => 'bool' ), 'PS_ATTRIBUTE_CATEGORY_DISPLAY' => array( - 'title' => $this->l('Display "add to cart" button when product has attributes'), - 'desc' => $this->l('Display or hide the "add to cart" button on category pages for products that have attributes to force customers to see the product detail'), + 'title' => $this->l('Display the "add to cart" button when a product has attributes'), + 'desc' => $this->l('Display or hide the "add to cart" button on category pages for products that have attributes forcing customers to see product details.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' @@ -187,7 +187,7 @@ class AdminPPreferencesControllerCore extends AdminController 'fields' => array( 'PS_ORDER_OUT_OF_STOCK' => array( 'title' => $this->l('Allow ordering of out-of-stock products'), - 'desc' => $this->l('Add to cart button is hidden when product is unavailable'), + 'desc' => $this->l('Add to cart button is hidden when a product is unavailable'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, @@ -206,7 +206,7 @@ class AdminPPreferencesControllerCore extends AdminController ) ), 'PS_ADVANCED_STOCK_MANAGEMENT' => array( - 'title' => $this->l('Enable advanced stock management'), + 'title' => $this->l('Enable advanced-stock management'), 'desc' => $this->l('Allows you to manage physical stock, warehouses and supply orders.'), 'validation' => 'isBool', 'cast' => 'intval', @@ -223,7 +223,7 @@ class AdminPPreferencesControllerCore extends AdminController public function beforeUpdateOptions() { - if (!Tools::getValue('PS_STOCK_MANAGEMENT')) + if (!Tools::getValue('PS_STOCK_MANAGEMENT', true)) { $_POST['PS_ORDER_OUT_OF_STOCK'] = 1; $_POST['PS_DISPLAY_QTIES'] = 0; @@ -231,7 +231,7 @@ class AdminPPreferencesControllerCore extends AdminController // if advanced stock management is disabled, updates concerned tables if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 1 && - (int)Tools::getValue('PS_ADVANCED_STOCK_MANAGEMENT') == 0) + (int)Tools::getValue('PS_ADVANCED_STOCK_MANAGEMENT') == 0 && Context::getContext()->shop->getContext() == Shop::CONTEXT_ALL) { ObjectModel::updateMultishopTable('Product', array('advanced_stock_management' => 0), 'product_shop.`advanced_stock_management` = 1'); diff --git a/controllers/admin/AdminPaymentController.php b/controllers/admin/AdminPaymentController.php index dbb3f4859..0c10bab4a 100644 --- a/controllers/admin/AdminPaymentController.php +++ b/controllers/admin/AdminPaymentController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -101,7 +101,7 @@ class AdminPaymentControllerCore extends AdminController $this->action = 'group'; } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } @@ -143,7 +143,7 @@ class AdminPaymentControllerCore extends AdminController public function renderView() { - $this->toolbar_title = $this->l('Payment'); + $this->toolbar_title = $this->l('Payment: '); unset($this->toolbar_btn['back']); $shop_context = (!Shop::isFeatureActive() || Shop::getContext() == Shop::CONTEXT_SHOP); @@ -168,21 +168,21 @@ class AdminPaymentControllerCore extends AdminController $lists = array( array('items' => Currency::getCurrencies(), 'title' => $this->l('Currency restrictions'), - 'desc' => $this->l('Please mark the checkbox(es) for the currency or currencies for which you want the payment module(s) to be available.'), + 'desc' => $this->l('Please mark each checkbox for the currency, or currencies, in which you want the payment module(s) to be available.'), 'name_id' => 'currency', 'identifier' => 'id_currency', 'icon' => 'dollar', ), array('items' => Group::getGroups($this->context->language->id), 'title' => $this->l('Group restrictions'), - 'desc' => $this->l('Please mark the checkbox(es) for the groups for which you want the payment module(s) available.'), + 'desc' => $this->l('Please mark each checkbox for the currency, or currencies, in which you want the payment module(s) to be available.'), 'name_id' => 'group', 'identifier' => 'id_group', 'icon' => 'group', ), array('items' =>Country::getCountries($this->context->language->id), 'title' => $this->l('Country restrictions'), - 'desc' => $this->l('Please mark the checkbox(es) for the country or countries for which you want the payment module(s) to be available.'), + 'desc' => $this->l('Please mark each checkbox for the country, or countries, in which you want the payment module(s) to be available.'), 'name_id' => 'country', 'identifier' => 'id_country', 'icon' => 'world', @@ -222,7 +222,7 @@ class AdminPaymentControllerCore extends AdminController } $this->tpl_view_vars = array( - 'url_modules' => isset($token_modules) ? 'index.php?tab=AdminModules&token='.$token_modules.'&&filterCategory=payments_gateways' : null, + 'modules_list' => $this->renderModulesList(), 'display_restrictions' => $display_restrictions, 'lists' => $lists, 'ps_base_uri' => __PS_BASE_URI__, diff --git a/controllers/admin/AdminPdfController.php b/controllers/admin/AdminPdfController.php index 872b49e0d..de26f9e9c 100644 --- a/controllers/admin/AdminPdfController.php +++ b/controllers/admin/AdminPdfController.php @@ -1,9 +1,9 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -41,7 +41,7 @@ class AdminPdfControllerCore extends AdminController if ($access['view'] === '1' && ($action = Tools::getValue('submitAction'))) $this->action = $action; else - $this->errors[] = Tools::displayError('You do not have permission to view here.'); + $this->errors[] = Tools::displayError('You do not have permission to view this.'); } public function processGenerateInvoicePdf() @@ -51,7 +51,7 @@ class AdminPdfControllerCore extends AdminController elseif (Tools::isSubmit('id_order_invoice')) $this->generateInvoicePDFByIdOrderInvoice(Tools::getValue('id_order_invoice')); else - die (Tools::displayError('Missing order ID or invoice order ID')); + die (Tools::displayError('The order ID -- or the invoice order ID -- is missing.')); } public function processGenerateOrderSlipPDF() @@ -59,7 +59,7 @@ class AdminPdfControllerCore extends AdminController $orderSlip = new OrderSlip((int)Tools::getValue('id_order_slip')); $order = new Order((int)$orderSlip->id_order); if (!Validate::isLoadedObject($order)) - die(Tools::displayError('Cannot find order in database')); + die(Tools::displayError('The order cannot be found within your database.')); $order->products = OrderSlip::getOrdersSlipProducts($orderSlip->id, $order); $this->generatePDF($orderSlip, PDF::TEMPLATE_ORDER_SLIP); @@ -77,7 +77,7 @@ class AdminPdfControllerCore extends AdminController $this->generateDeliverySlipPDFByIdOrder((int)$order->id); } else - die (Tools::displayError('Missing order ID or invoice order ID')); + die (Tools::displayError('The order ID -- or the invoice order ID -- is missing.')); } public function processGenerateInvoicesPDF() @@ -85,7 +85,7 @@ class AdminPdfControllerCore extends AdminController $order_invoice_collection = OrderInvoice::getByDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')); if (!count($order_invoice_collection)) - die(Tools::displayError('No invoices found')); + die(Tools::displayError('No invoice was found.')); $this->generatePDF($order_invoice_collection, PDF::TEMPLATE_INVOICE); } @@ -98,7 +98,7 @@ class AdminPdfControllerCore extends AdminController $order_invoice_collection = array_merge($order_invoices, $order_invoice_collection); if (!count($order_invoice_collection)) - die(Tools::displayError('No invoices found')); + die(Tools::displayError('No invoice was found.')); $this->generatePDF($order_invoice_collection, PDF::TEMPLATE_INVOICE); } @@ -107,7 +107,7 @@ class AdminPdfControllerCore extends AdminController { $id_order_slips_list = OrderSlip::getSlipsIdByDate(Tools::getValue('date_from'), Tools::getValue('date_to')); if (!count($id_order_slips_list)) - die (Tools::displayError('No order slips found')); + die (Tools::displayError('No order slips were found.')); $order_slips = array(); foreach ($id_order_slips_list as $id_order_slips) @@ -121,7 +121,7 @@ class AdminPdfControllerCore extends AdminController $order_invoice_collection = OrderInvoice::getByDeliveryDateInterval(Tools::getValue('date_from'), Tools::getValue('date_to')); if (!count($order_invoice_collection)) - die(Tools::displayError('No invoices found')); + die(Tools::displayError('No invoice was found.')); $this->generatePDF($order_invoice_collection, PDF::TEMPLATE_DELIVERY_SLIP); } @@ -129,13 +129,13 @@ class AdminPdfControllerCore extends AdminController public function processGenerateSupplyOrderFormPDF() { if (!Tools::isSubmit('id_supply_order')) - die (Tools::displayError('Missing supply order ID')); + die (Tools::displayError('The supply order ID is missing.')); $id_supply_order = (int)Tools::getValue('id_supply_order'); $supply_order = new SupplyOrder($id_supply_order); if (!Validate::isLoadedObject($supply_order)) - die(Tools::displayError('Cannot find this supply order in the database')); + die(Tools::displayError('The supply order cannot be found within your database.')); $this->generatePDF($supply_order, PDF::TEMPLATE_SUPPLY_ORDER_FORM); } @@ -163,7 +163,7 @@ class AdminPdfControllerCore extends AdminController { $order = new Order((int)$id_order); if (!Validate::isLoadedObject($order)) - die(Tools::displayError('Cannot find order in database')); + die(Tools::displayError('The order cannot be found within your database.')); $order_invoice_list = $order->getInvoicesCollection(); Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => $order_invoice_list)); @@ -174,7 +174,7 @@ class AdminPdfControllerCore extends AdminController { $order_invoice = new OrderInvoice((int)$id_order_invoice); if (!Validate::isLoadedObject($order_invoice)) - die(Tools::displayError('Cannot find order invoice in database')); + die(Tools::displayError('The order invoice cannot be found within your database.')); Hook::exec('actionPDFInvoiceRender', array('order_invoice_list' => array($order_invoice))); $this->generatePDF($order_invoice, PDF::TEMPLATE_INVOICE); diff --git a/controllers/admin/AdminPerformanceController.php b/controllers/admin/AdminPerformanceController.php index aad501d1a..c19b3c221 100644 --- a/controllers/admin/AdminPerformanceController.php +++ b/controllers/admin/AdminPerformanceController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ class AdminPerformanceControllerCore extends AdminController { + + public function __construct() + { + $this->className = 'Configuration'; + parent::__construct(); + } + public function initFieldsetSmarty() { $this->fields_form[0]['form'] = array( @@ -49,19 +56,19 @@ class AdminPerformanceControllerCore extends AdminController 'id' => 'smarty_force_compile_'._PS_SMARTY_NO_COMPILE_, 'value' => _PS_SMARTY_NO_COMPILE_, 'label' => $this->l('Never recompile template files'), - 'desc' => $this->l('Templates are never recompiled, performance is better and this option should be used in production environment') + 'desc' => $this->l('This option should be used in a production environment.') ), array( 'id' => 'smarty_force_compile_'._PS_SMARTY_CHECK_COMPILE_, 'value' => _PS_SMARTY_CHECK_COMPILE_, 'label' => $this->l('Recompile templates if the files have been updated'), - 'desc' => $this->l('Templates are recompiled when they are updated, if you experience compilation troubles when you update your template files, you should use Force Compile instead of this option. It should never be used in a production environment.') + 'desc' => $this->l('Templates are recompiled when they are updated. If you experience compilation troubles when you update your template files, you should use Force Compile instead of this option. It should never be used in a production environment.') ), array( 'id' => 'smarty_force_compile_'._PS_SMARTY_FORCE_COMPILE_, 'value' => _PS_SMARTY_FORCE_COMPILE_, 'label' => $this->l('Force compilation'), - 'desc' => $this->l('This forces Smarty to (re)compile templates on every invocation. This is handy for development and debugging. It should never be used in a production environment.') + 'desc' => $this->l('This forces Smarty to (re)compile templates on every invocation. This is handy for development and debugging. Note: This should never be used in a production environment.') ) ) ), @@ -260,7 +267,7 @@ class AdminPerformanceControllerCore extends AdminController array( 'id' => 'PS_JS_HTML_THEME_COMPRESSION_1', 'value' => 1, - 'label' => $this->l('Compress inline JavaScript in HTML after "smarty compile" execution') + 'label' => $this->l('Compress inline JavaScript in HTML after "smarty compile" execution.') ), array( 'id' => 'PS_JS_HTML_THEME_COMPRESSION_0', @@ -269,31 +276,12 @@ class AdminPerformanceControllerCore extends AdminController ) ) ), - array( - 'type' => 'radio', - 'label' => $this->l('High risk HTML compression'), - 'name' => 'PS_HIGH_HTML_THEME_COMPRESSION', - 'class' => 't', - 'br' => true, - 'values' => array( - array( - 'id' => 'PS_HIGH_HTML_THEME_COMPRESSION_1', - 'value' => 1, - 'label' => $this->l('HTML is compressed but cancels the W3C validation (only when "Minify HTML" is enabled)') - ), - array( - 'id' => 'PS_HIGH_HTML_THEME_COMPRESSION_0', - 'value' => 0, - 'label' => $this->l('Keep W3C validation') - ) - ) - ), array( 'type' => 'radio', 'label' => $this->l('Apache optimization'), 'name' => 'PS_HTACCESS_CACHE_CONTROL', 'class' => 't', - 'desc' => $this->l('This will add directives to your .htaccess file which should improve caching and compression.'), + 'desc' => $this->l('This will add directives to your .htaccess file, which should improve caching and compression.'), 'is_bool' => true, 'values' => array( array( @@ -315,7 +303,6 @@ class AdminPerformanceControllerCore extends AdminController $this->fields_value['PS_JS_THEME_CACHE'] = Configuration::get('PS_JS_THEME_CACHE'); $this->fields_value['PS_HTML_THEME_COMPRESSION'] = Configuration::get('PS_HTML_THEME_COMPRESSION'); $this->fields_value['PS_JS_HTML_THEME_COMPRESSION'] = Configuration::get('PS_JS_HTML_THEME_COMPRESSION'); - $this->fields_value['PS_HIGH_HTML_THEME_COMPRESSION'] = Configuration::get('PS_HIGH_HTML_THEME_COMPRESSION'); $this->fields_value['PS_HTACCESS_CACHE_CONTROL'] = Configuration::get('PS_HTACCESS_CACHE_CONTROL'); $this->fields_value['ccc_up'] = 1; } @@ -327,7 +314,7 @@ class AdminPerformanceControllerCore extends AdminController 'title' => $this->l('Media servers (use only with CCC)'), 'image' => '../img/admin/subdomain.gif' ), - 'desc' => $this->l('You must enter another domain or subdomain in order to use cookieless static content.'), + 'desc' => $this->l('You must enter another domain, or subdomain, in order to use cookieless static content.'), 'input' => array( array( 'type' => 'hidden', @@ -338,21 +325,21 @@ class AdminPerformanceControllerCore extends AdminController 'label' => $this->l('Media server #1'), 'name' => '_MEDIA_SERVER_1_', 'size' => 30, - 'desc' => $this->l('Name of the second domain of your shop, (e.g. myshop-media-server-1.com). If you do not have another domain, leave this field blank') + 'desc' => $this->l('Name of the second domain of your shop, (e.g. myshop-media-server-1.com). If you do not have another domain, leave this field blank.') ), array( 'type' => 'text', 'label' => $this->l('Media server #2'), 'name' => '_MEDIA_SERVER_2_', 'size' => 30, - 'desc' => $this->l('Name of the third domain of your shop, (e.g. myshop-media-server-2.com). If you do not have another domain, leave this field blank') + 'desc' => $this->l('Name of the third domain of your shop, (e.g. myshop-media-server-2.com). If you do not have another domain, leave this field blank.') ), array( 'type' => 'text', 'label' => $this->l('Media server #3'), 'name' => '_MEDIA_SERVER_3_', 'size' => 30, - 'desc' => $this->l('Name of the fourth domain of your shop, (e.g. myshop-media-server-3.com). If you do not have another domain, leave this field blank') + 'desc' => $this->l('Name of the fourth domain of your shop, (e.g. myshop-media-server-3.com). If you do not have another domain, leave this field blank.') ), ) ); @@ -450,7 +437,7 @@ class AdminPerformanceControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Enable or disable caching system') + 'desc' => $this->l('Enable or disable caching system.') ), array( 'type' => 'select', @@ -494,7 +481,7 @@ class AdminPerformanceControllerCore extends AdminController ), 'desc' => $this->l('Performance matters! Improve speed and conversions the easy way.').'
        '. $this->l('CloudCache supercharges your site in minutes through its state-of-the-art content delivery network.').'

        '. - $this->l('Subscribe now using the code "presta25" and get an exclusive discount of 25% per month on every available package.').'

        + $this->l('Subscribe now using the code "presta25" and get an exclusive 25% monthly discount on every available package.').'

        > '.$this->l('Click here to install the CloudCache module for PrestaShop').'
        ' ); } @@ -561,6 +548,7 @@ class AdminPerformanceControllerCore extends AdminController public function postProcess() { + /* PrestaShop demo mode */ if (_PS_MODE_DEMO_) { @@ -568,16 +556,17 @@ class AdminPerformanceControllerCore extends AdminController return; } + Hook::exec('action'.get_class($this).ucfirst($this->action).'Before', array('controller' => $this)); if (Tools::isSubmit('submitAddServer')) { if ($this->tabAccess['add'] === '1') { if (!Tools::getValue('memcachedIp')) - $this->errors[] = Tools::displayError('Memcached IP is missing'); + $this->errors[] = Tools::displayError('The Memcached IP is missing.'); if (!Tools::getValue('memcachedPort')) - $this->errors[] = Tools::displayError('Memcached port is missing'); + $this->errors[] = Tools::displayError('The Memcached port is missing.'); if (!Tools::getValue('memcachedWeight')) - $this->errors[] = Tools::displayError('Memcached weight is missing'); + $this->errors[] = Tools::displayError('The Memcached weight is missing.'); if (!count($this->errors)) { if (CacheMemcache::addServer(pSQL(Tools::getValue('memcachedIp')), @@ -585,11 +574,11 @@ class AdminPerformanceControllerCore extends AdminController (int)Tools::getValue('memcachedWeight'))) Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); else - $this->errors[] = Tools::displayError('Cannot add Memcached server'); + $this->errors[] = Tools::displayError('The Memcached server cannot be added.'); } } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } if (Tools::getValue('deleteMemcachedServer')) @@ -599,13 +588,13 @@ class AdminPerformanceControllerCore extends AdminController if (CacheMemcache::deleteServer((int)Tools::getValue('deleteMemcachedServer'))) Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); else - $this->errors[] = Tools::displayError('Error in deleting Memcached server'); + $this->errors[] = Tools::displayError('There was an error when attempting to delete the Memcached server.'); } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } - $redirecAdmin = false; + $redirectAdmin = false; if ((bool)Tools::getValue('smarty_up')) { if ($this->tabAccess['edit'] === '1') @@ -613,10 +602,10 @@ class AdminPerformanceControllerCore extends AdminController Configuration::updateValue('PS_SMARTY_FORCE_COMPILE', Tools::getValue('smarty_force_compile', _PS_SMARTY_NO_COMPILE_)); Configuration::updateValue('PS_SMARTY_CACHE', Tools::getValue('smarty_cache', 0)); Configuration::updateValue('PS_SMARTY_CONSOLE', Tools::getValue('smarty_console', 0)); - $redirecAdmin = true; + $redirectAdmin = true; } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } if ((bool)Tools::getValue('features_detachables_up')) @@ -626,32 +615,34 @@ class AdminPerformanceControllerCore extends AdminController if (!Combination::isCurrentlyUsed()) Configuration::updateValue('PS_COMBINATION_FEATURE_ACTIVE', Tools::getValue('combination')); Configuration::updateValue('PS_FEATURE_FEATURE_ACTIVE', Tools::getValue('feature')); - $redirecAdmin = true; + $redirectAdmin = true; } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } if ((bool)Tools::getValue('ccc_up')) { if ($this->tabAccess['edit'] === '1') { + $theme_cache_directory = _PS_ALL_THEMES_DIR_.$this->context->shop->theme_directory.'/cache/'; + if (((bool)Tools::getValue('PS_CSS_THEME_CACHE') || (bool)Tools::getValue('PS_JS_THEME_CACHE')) && !is_writable($theme_cache_directory)) + $this->errors[] = Tools::displayError(sprintf($this->l('To use Smart Cache directory %s must be writable.'), realpath($theme_cache_directory))); if (!Configuration::updateValue('PS_CSS_THEME_CACHE', (int)Tools::getValue('PS_CSS_THEME_CACHE')) || !Configuration::updateValue('PS_JS_THEME_CACHE', (int)Tools::getValue('PS_JS_THEME_CACHE')) || !Configuration::updateValue('PS_HTML_THEME_COMPRESSION', (int)Tools::getValue('PS_HTML_THEME_COMPRESSION')) || !Configuration::updateValue('PS_JS_HTML_THEME_COMPRESSION', (int)Tools::getValue('PS_JS_HTML_THEME_COMPRESSION')) || - !Configuration::updateValue('PS_HIGH_HTML_THEME_COMPRESSION', (int)Tools::getValue('PS_HIGH_HTML_THEME_COMPRESSION')) || !Configuration::updateValue('PS_HTACCESS_CACHE_CONTROL', (int)Tools::getValue('PS_HTACCESS_CACHE_CONTROL'))) $this->errors[] = Tools::displayError('Unknown error.'); else { - $redirecAdmin = true; + $redirectAdmin = true; if (Configuration::get('PS_HTACCESS_CACHE_CONTROL')) Tools::generateHtaccess(); } } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } if ((bool)Tools::getValue('media_server_up')) @@ -670,20 +661,23 @@ class AdminPerformanceControllerCore extends AdminController $base_urls['_MEDIA_SERVER_1_'] = Tools::getValue('_MEDIA_SERVER_1_'); $base_urls['_MEDIA_SERVER_2_'] = Tools::getValue('_MEDIA_SERVER_2_'); $base_urls['_MEDIA_SERVER_3_'] = Tools::getValue('_MEDIA_SERVER_3_'); + if ($base_urls['_MEDIA_SERVER_1_'] || $base_urls['_MEDIA_SERVER_2_'] || $base_urls['_MEDIA_SERVER_3_']) + Configuration::updateValue('PS_MEDIA_SERVERS', 1); + else + Configuration::updateValue('PS_MEDIA_SERVERS', 0); rewriteSettingsFile($base_urls, null, null); Tools::generateHtaccess(null, null, null, '', null, array($base_urls['_MEDIA_SERVER_1_'], $base_urls['_MEDIA_SERVER_2_'], $base_urls['_MEDIA_SERVER_3_'])); unset($this->_fieldsGeneral['_MEDIA_SERVER_1_']); unset($this->_fieldsGeneral['_MEDIA_SERVER_2_']); unset($this->_fieldsGeneral['_MEDIA_SERVER_3_']); - $redirecAdmin = true; + $redirectAdmin = true; } } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } - if ((bool)Tools::getValue('ciphering_up') && Configuration::get('PS_CIPHER_ALGORITHM') != (int)Tools::getValue('PS_CIPHER_ALGORITHM')) - { + { if ($this->tabAccess['edit'] === '1') { $algo = (int)Tools::getValue('PS_CIPHER_ALGORITHM'); @@ -692,7 +686,7 @@ class AdminPerformanceControllerCore extends AdminController if ($algo) { if (!function_exists('mcrypt_encrypt')) - $this->errors[] = Tools::displayError('PHP "Mcrypt" extension is not activated on this server.'); + $this->errors[] = Tools::displayError('The PHP "Mcrypt" extension is not activated on this server.'); else { if (!strstr($new_settings, '_RIJNDAEL_KEY_')) @@ -722,18 +716,18 @@ class AdminPerformanceControllerCore extends AdminController // If there is not settings file modification or if the backup and replacement of the settings file worked if ($new_settings == $prev_settings || ( copy(dirname(__FILE__).'/../../config/settings.inc.php', dirname(__FILE__).'/../../config/settings.old.php') - && file_put_contents(dirname(__FILE__).'/../../config/settings.inc.php', $new_settings) + && (bool)file_put_contents(dirname(__FILE__).'/../../config/settings.inc.php', $new_settings) )) { Configuration::updateValue('PS_CIPHER_ALGORITHM', $algo); - $redirecAdmin = true; + $redirectAdmin = true; } else - $this->errors[] = Tools::displayError('Cannot overwrite settings file.'); + $this->errors[] = Tools::displayError('The settings file cannot be overwritten.'); } } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } if ((bool)Tools::getValue('cache_up')) @@ -746,33 +740,38 @@ class AdminPerformanceControllerCore extends AdminController $cache_active = 0; else $cache_active = 1; + if (!$caching_system = Tools::getValue('caching_system')) - $this->errors[] = Tools::displayError('Caching system is missing'); + $this->errors[] = Tools::displayError('The caching system is missing.'); else $new_settings = preg_replace( '/define\(\'_PS_CACHING_SYSTEM_\', \'([a-z0-9=\/+-_]+)\'\);/Ui', 'define(\'_PS_CACHING_SYSTEM_\', \''.$caching_system.'\');', $new_settings ); + if ($cache_active && $caching_system == 'CacheMemcache' && !extension_loaded('memcache')) $this->errors[] = Tools::displayError('To use Memcached, you must install the Memcache PECL extension on your server.').' http://www.php.net/manual/en/memcache.installation.php'; - else if ($cache_active && $caching_system == 'CacheApc' && !extension_loaded('apc')) + elseif ($cache_active && $caching_system == 'CacheApc' && !extension_loaded('apc')) $this->errors[] = Tools::displayError('To use APC cache, you must install the APC PECL extension on your server.').' http://fr.php.net/manual/fr/apc.installation.php'; - else if ($cache_active && $caching_system == 'CacheXcache' && !extension_loaded('xcache')) + elseif ($cache_active && $caching_system == 'CacheXcache' && !extension_loaded('xcache')) $this->errors[] = Tools::displayError('To use Xcache, you must install the Xcache extension on your server.').' http://xcache.lighttpd.net'; - else if ($cache_active && $caching_system == 'CacheFs' && !is_writable(_PS_CACHEFS_DIRECTORY_)) + else if ($cache_active && $caching_system == 'CacheXcache' && !ini_get('xcache.var_size')) + $this->errors[] = Tools::displayError('To use Xcache, you must configure "xcache.var_size" for the Xcache extension (recommended value 16M to 64M).').' + http://xcache.lighttpd.net/wiki/XcacheIni'; + elseif ($cache_active && $caching_system == 'CacheFs' && !is_writable(_PS_CACHEFS_DIRECTORY_)) $this->errors[] = sprintf( - Tools::displayError('To use CacheFS the directory %s must be writable.'), + Tools::displayError('To use CacheFS, the directory %s must be writable.'), realpath(_PS_CACHEFS_DIRECTORY_) ); if ($caching_system == 'CacheFs' && $cache_active) { if (!($depth = Tools::getValue('ps_cache_fs_directory_depth'))) - $this->errors[] = Tools::displayError('Please set a directory depth'); + $this->errors[] = Tools::displayError('Please set a directory depth.'); if (!count($this->errors)) { CacheFs::deleteCacheDirectory(); @@ -780,7 +779,7 @@ class AdminPerformanceControllerCore extends AdminController Configuration::updateValue('PS_CACHEFS_DIRECTORY_DEPTH', (int)$depth); } } - else if ($caching_system == 'MCached' && $cache_active && !_PS_CACHE_ENABLED_ && _PS_CACHING_SYSTEM_ == 'MCached') + elseif ($caching_system == 'CacheMemcache' && $cache_active && !_PS_CACHE_ENABLED_ && _PS_CACHING_SYSTEM_ == 'CacheMemcache') Cache::getInstance()->flush(); if (!count($this->errors)) @@ -789,21 +788,21 @@ class AdminPerformanceControllerCore extends AdminController // If there is not settings file modification or if the backup and replacement of the settings file worked if ($new_settings == $prev_settings || ( copy(dirname(__FILE__).'/../../config/settings.inc.php', dirname(__FILE__).'/../../config/settings.old.php') - && file_put_contents(dirname(__FILE__).'/../../config/settings.inc.php', $new_settings) + && (bool)file_put_contents(dirname(__FILE__).'/../../config/settings.inc.php', $new_settings) )) - $redirecAdmin = true; + $redirectAdmin = true; else - $this->errors[] = Tools::displayError('Cannot overwrite settings file.'); + $this->errors[] = Tools::displayError('The settings file cannot be overwritten.'); } } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } - - if ($redirecAdmin) + if ($redirectAdmin && (!isset($this->errors) || !count($this->errors))) + { + Hook::exec('action'.get_class($this).ucfirst($this->action).'After', array('controller' => $this, 'return' => '')); Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=4'); - else - return parent::postProcess(); + } } public function ajaxProcess() @@ -834,5 +833,4 @@ class AdminPerformanceControllerCore extends AdminController die; } -} - +} \ No newline at end of file diff --git a/controllers/admin/AdminPreferencesController.php b/controllers/admin/AdminPreferencesController.php index 20e44d438..f878f69fc 100644 --- a/controllers/admin/AdminPreferencesController.php +++ b/controllers/admin/AdminPreferencesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -50,11 +50,37 @@ class AdminPreferencesControllerCore extends AdminController 'name' => $this->l('classical') ) ); + $activities1 = array( + 0 => $this->l('-- Please choose your main activity --'), + 1 => $this->l('Adult'), + 2 => $this->l('Animals and Pets'), + 3 => $this->l('Art and Culture'), + 4 => $this->l('Babies'), + 5 => $this->l('Beauty and Personal Care'), + 6 => $this->l('Cars'), + 7 => $this->l('Computer Hardware and Software'), + 8 => $this->l('Download'), + 9 => $this->l('Fashion and accessories'), + 10 => $this->l('Flowers, Gifts and Crafts'), + 11 => $this->l('Food and beverage'), + 12 => $this->l('HiFi, Photo and Video'), + 13 => $this->l('Home and Garden'), + 14 => $this->l('Home Appliances'), + 15 => $this->l('Jewelry'), + 16 => $this->l('Mobile and Telecom'), + 17 => $this->l('Services'), + 18 => $this->l('Shoes and accessories'), + 19 => $this->l('Sport and Entertainment'), + 20 => $this->l('Travel') + ); + $activities2 = array(); + foreach ($activities1 as $value => $name) + $activities2[] = array('value' => $value, 'name' => $name); $fields = array( 'PS_SSL_ENABLED' => array( 'title' => $this->l('Enable SSL'), - 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing'), + 'desc' => $this->l('If your hosting provider allows SSL, you can activate SSL encryption (https://) for customer account identification and order processing.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', @@ -62,16 +88,24 @@ class AdminPreferencesControllerCore extends AdminController ), 'PS_TOKEN_ENABLE' => array( 'title' => $this->l('Increase Front Office security'), - 'desc' => $this->l('Enable or disable token on the Front Office in order to improve PrestaShop security'), + 'desc' => $this->l('Enable or disable token in the Front Office to improve PrestaShop\'s security.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'default' => '0', 'visibility' => Shop::CONTEXT_ALL ), + 'PS_ALLOW_HTML_IFRAME' => array( + 'title' => $this->l('Allow iframes on html fields'), + 'desc' => $this->l('Allow iframes on fields like product description. We recommend that you leave this option disabled'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'type' => 'bool', + 'default' => '0' + ), 'PS_PRICE_ROUND_MODE' => array( 'title' => $this->l('Round mode'), - 'desc' => $this->l('You can choose how to round prices: always round superior; always round inferior, or classic rounding'), + 'desc' => $this->l('You can choose how to round prices: Always round superior, always round inferior or classic rounding.'), 'validation' => 'isInt', 'cast' => 'intval', 'type' => 'select', @@ -80,19 +114,27 @@ class AdminPreferencesControllerCore extends AdminController ), 'PS_DISPLAY_SUPPLIERS' => array( 'title' => $this->l('Display suppliers and manufacturers'), - 'desc' => $this->l('Display suppliers and manufacturers lists even if corresponding blocks are disabled'), + 'desc' => $this->l('Display the suppliers and manufacturers lists even if corresponding blocks are disabled.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' ), 'PS_MULTISHOP_FEATURE_ACTIVE' => array( 'title' => $this->l('Enable Multistore'), - 'desc' => $this->l('Multistore feature allows you to manage several shops with one back-office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.'), + 'desc' => $this->l('The multistore feature allows you to manage several e-shops with one Back Office. If this feature is enabled, a "Multistore" page will be available in the "Advanced Parameters" menu.'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', 'visibility' => Shop::CONTEXT_ALL ), + 'PS_SHOP_ACTIVITY' => array( + 'title' => $this->l('Main Shop Activity'), + 'validation' => 'isInt', + 'cast' => 'intval', + 'type' => 'select', + 'list' => $activities2, + 'identifier' => 'value' + ), ); // No HTTPS activation if you haven't already. @@ -108,7 +150,7 @@ class AdminPreferencesControllerCore extends AdminController 'title' => $this->l('General'), 'icon' => 'tab-preferences', 'fields' => $fields, - 'submit' => array('title' => $this->l(' Save '), 'class' => 'button'), + 'submit' => array('title' => $this->l('Save '), 'class' => 'button'), ), ); } diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index ae2b93f8d..914a1ef21 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -1,8 +1,8 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -53,6 +53,8 @@ class AdminProductsControllerCore extends AdminController protected $position_identifier = 'id_product'; protected $submitted_tabs; + + protected $id_current_category; public function __construct() { @@ -71,9 +73,10 @@ class AdminProductsControllerCore extends AdminController $this->_defaultOrderBy = 'position'; $this->max_file_size = (int)(Configuration::get('PS_LIMIT_UPLOAD_FILE_VALUE') * 1000000); $this->max_image_size = (int)Configuration::get('PS_PRODUCT_PICTURE_MAX_SIZE'); + $this->allow_export = true; // @since 1.5 : translations for tabs - $this->available_tabs_lang = array ( + $this->available_tabs_lang = array( 'Informations' => $this->l('Information'), 'Pack' => $this->l('Pack'), 'VirtualProduct' => $this->l('Virtual Product'), @@ -121,62 +124,73 @@ class AdminProductsControllerCore extends AdminController $this->available_tabs_lang['Module'.ucfirst($m['module'])] = Module::getModuleName($m['module']); } - + if (Tools::getValue('reset_filter_category')) + $this->context->cookie->id_category_products_filter = false; + if (Shop::isFeatureActive() && $this->context->cookie->id_category_products_filter) + { + $category = new Category((int)$this->context->cookie->id_category_products_filter); + if (!$category->inShop()) + { + $this->context->cookie->id_category_products_filter = false; + Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts')); + } + } /* Join categories table */ if ($id_category = (int)Tools::getValue('productFilter_cl!name')) { $this->_category = new Category((int)$id_category); $_POST['productFilter_cl!name'] = $this->_category->name[$this->context->language->id]; } - elseif ($id_category = Tools::getvalue('id_category')) - $this->_category = new Category((int)$id_category); else - $this->_category = new Category(); + { + if ($id_category = (int)Tools::getValue('id_category')) + { + $this->id_current_category = $id_category; + $this->context->cookie->id_category_products_filter = $id_category; + } + elseif ($id_category = $this->context->cookie->id_category_products_filter) + $this->id_current_category = $id_category; + if ($this->id_current_category) + $this->_category = new Category((int)$this->id_current_category); + else + $this->_category = new Category(); + } $join_category = false; if (Validate::isLoadedObject($this->_category) && empty($this->_filter)) $join_category = true; - $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product` '.(!Shop::isFeatureActive() ? ' AND i.cover=1' : '').')'; - if (Shop::isFeatureActive()) - { - $alias = 'sa'; - $alias_image = 'image_shop'; - if (Shop::getContext() == Shop::CONTEXT_SHOP) - { - $this->_join .= ' JOIN `'._DB_PREFIX_.'product_shop` sa ON (a.`id_product` = sa.`id_product` AND sa.id_shop = '.(int)$this->context->shop->id.') - LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = '.(int)$this->context->shop->id.') - LEFT JOIN `'._DB_PREFIX_.'shop` shop ON (shop.id_shop = '.(int)$this->context->shop->id.') - LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_image` = i.`id_image` AND image_shop.`cover` = 1 AND image_shop.id_shop='.(int)$this->context->shop->id.')'; - $this->_where .= 'AND (i.id_image IS NULL OR image_shop.id_shop='.(int)$this->context->shop->id.')'; - } - else - { - $this->_join .= ' LEFT JOIN `'._DB_PREFIX_.'product_shop` sa ON (a.`id_product` = sa.`id_product` AND sa.id_shop = a.id_shop_default) - LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = a.id_shop_default) - LEFT JOIN `'._DB_PREFIX_.'shop` shop ON (shop.id_shop = a.id_shop_default) - LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_image` = i.`id_image` AND image_shop.`cover` = 1 AND image_shop.id_shop=a.id_shop_default)'; - $this->_where .= 'AND (i.id_image IS NULL OR image_shop.id_shop=a.id_shop_default)'; - } - $this->_select .= 'shop.name as shopname, '; - } - else - { - $alias = 'a'; - $alias_image = 'i'; - $this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = 1)'; - } - - $this->_join .= ($join_category ? 'INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.')' : '').' + $this->_join .= ' + LEFT JOIN `'._DB_PREFIX_.'image` i ON (i.`id_product` = a.`id_product`) LEFT JOIN `'._DB_PREFIX_.'stock_available` sav ON (sav.`id_product` = a.`id_product` AND sav.`id_product_attribute` = 0 '.StockAvailable::addSqlShopRestriction(null, null, 'sav').') '; - $this->_select .= 'cl.name `name_category` '.($join_category ? ', cp.`position`' : '').', '.$alias_image.'.`id_image`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`'; - + + $alias = 'sa'; + $alias_image = 'image_shop'; + + $id_shop = Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP? (int)$this->context->shop->id : 'a.id_shop_default'; + $this->_join .= ' JOIN `'._DB_PREFIX_.'product_shop` sa ON (a.`id_product` = sa.`id_product` AND sa.id_shop = '.$id_shop.') + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON ('.$alias.'.`id_category_default` = cl.`id_category` AND b.`id_lang` = cl.`id_lang` AND cl.id_shop = '.$id_shop.') + LEFT JOIN `'._DB_PREFIX_.'shop` shop ON (shop.id_shop = '.$id_shop.') + LEFT JOIN `'._DB_PREFIX_.'image_shop` image_shop ON (image_shop.`id_image` = i.`id_image` AND image_shop.`cover` = 1 AND image_shop.id_shop = '.$id_shop.')'; + + $this->_select .= 'shop.name as shopname, '; + $this->_select .= 'MAX('.$alias_image.'.id_image) id_image, cl.name `name_category`, '.$alias.'.`price`, 0 AS price_final, sav.`quantity` as sav_quantity, '.$alias.'.`active`'; + + if ($join_category) + { + $this->_join .= ' INNER JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = a.`id_product` AND cp.`id_category` = '.(int)$this->_category->id.') '; + $this->_select .= ' , cp.`position`, '; + } + + $this->_group = 'GROUP BY '.$alias.'.id_product'; + $this->fields_list = array(); $this->fields_list['id_product'] = array( 'title' => $this->l('ID'), 'align' => 'center', - 'width' => 20 + 'type' => 'int', + 'width' => 40 ); $this->fields_list['image'] = array( 'title' => $this->l('Photo'), @@ -199,14 +213,14 @@ class AdminProductsControllerCore extends AdminController if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) $this->fields_list['shopname'] = array( - 'title' => $this->l('Default Shop'), + 'title' => $this->l('Default shop:'), 'width' => 230, 'filter_key' => 'shop!name', ); else $this->fields_list['name_category'] = array( 'title' => $this->l('Category'), - 'width' => 230, + 'width' => 'auto', 'filter_key' => 'cl!name', ); $this->fields_list['price'] = array( @@ -224,16 +238,18 @@ class AdminProductsControllerCore extends AdminController 'havingFilter' => true, 'orderby' => false ); - $this->fields_list['sav_quantity'] = array( - 'title' => $this->l('Quantity'), - 'width' => 90, - 'align' => 'right', - 'filter_key' => 'sav!quantity', - 'orderby' => true, - 'hint' => $this->l('This is the quantity available in the current shop/group'), - ); + if (Configuration::get('PS_STOCK_MANAGEMENT')) + $this->fields_list['sav_quantity'] = array( + 'title' => $this->l('Quantity'), + 'width' => 90, + 'type' => 'int', + 'align' => 'right', + 'filter_key' => 'sav!quantity', + 'orderby' => true, + 'hint' => $this->l('This is the quantity available in the current shop/group.'), + ); $this->fields_list['active'] = array( - 'title' => $this->l('Displayed'), + 'title' => $this->l('Status'), 'width' => 70, 'active' => 'status', 'filter_key' => $alias.'!active', @@ -241,7 +257,8 @@ class AdminProductsControllerCore extends AdminController 'type' => 'bool', 'orderby' => false ); - if ((int)Tools::getValue('id_category')) + + if ($join_category && (int)$this->id_current_category) $this->fields_list['position'] = array( 'title' => $this->l('Position'), 'width' => 70, @@ -337,6 +354,78 @@ class AdminProductsControllerCore extends AdminController } } + protected function loadObject($opt = false) + { + $result = parent::loadObject($opt); + if ($result && Validate::isLoadedObject($this->object)) + { + if (Shop::getContext() == Shop::CONTEXT_SHOP && !$this->object->isAssociatedToShop()) + { + $default_product = new Product((int)$this->object->id, false, null, (int)$this->object->id_shop_default); + $def = ObjectModel::getDefinition($this->object); + foreach ($def['fields'] as $field_name => $row) + { + $fields_array = array(); + if(is_array($default_product->$field_name)) + foreach ($fields_array as $key => $fields_name) + $this->object->$field_name[$key] = ObjectModel::formatValue($fields_name, $def['fields'][$field_name]['type']); + else + $this->object->$field_name = ObjectModel::formatValue($this->object->$field_name, $def['fields'][$field_name]['type']); + } + } + $this->object->loadStockData(); + } + return $result; + } + + public function ajaxProcessGetCountriesOptions() + { + if (!$res = Country::getCountriesByIdShop((int)Tools::getValue('id_shop'), (int)$this->context->language->id)) + return ; + + $tpl = $this->createTemplate('specific_prices_shop_update.tpl'); + $tpl->assign(array( + 'option_list' => $res, + 'key_id' => 'id_country', + 'key_value' => 'name' + ) + ); + + $this->content = $tpl->fetch(); + } + + public function ajaxProcessGetCurrenciesOptions() + { + if (!$res = Currency::getCurrenciesByIdShop((int)Tools::getValue('id_shop'))) + return ; + + $tpl = $this->createTemplate('specific_prices_shop_update.tpl'); + $tpl->assign(array( + 'option_list' => $res, + 'key_id' => 'id_currency', + 'key_value' => 'name' + ) + ); + + $this->content = $tpl->fetch(); + } + + public function ajaxProcessGetGroupsOptions() + { + if (!$res = Group::getGroups((int)$this->context->language->id, (int)Tools::getValue('id_shop'))) + return ; + + $tpl = $this->createTemplate('specific_prices_shop_update.tpl'); + $tpl->assign(array( + 'option_list' => $res, + 'key_id' => 'id_group', + 'key_value' => 'name' + ) + ); + + $this->content = $tpl->fetch(); + } + public function ajaxProcessDeleteVirtualProduct() { if (!($id_product_download = ProductDownload::getIdFromIdProduct((int)Tools::getValue('id_product')))) @@ -369,12 +458,12 @@ class AdminProductsControllerCore extends AdminController if (!Validate::isGenericName(Tools::getValue('attachment_name_'.(int)($language['id_lang'])))) $this->errors[] = Tools::displayError('Invalid Name'); elseif (Tools::strlen(Tools::getValue('attachment_name_'.(int)($language['id_lang']))) > 32) - $this->errors[] = sprintf(Tools::displayError('Name is too long (%d chars max).'), 32); + $this->errors[] = sprintf(Tools::displayError('The name is too long (%d chars max).'), 32); if (!Validate::isCleanHtml(Tools::getValue('attachment_description_'.(int)($language['id_lang'])))) $this->errors[] = Tools::displayError('Invalid description'); } if (!$is_attachment_name_valid) - $this->errors[] = Tools::displayError('Attachment name required'); + $this->errors[] = Tools::displayError('An attachment name is required.'); if (empty($this->errors)) { @@ -382,7 +471,7 @@ class AdminProductsControllerCore extends AdminController { if ($_FILES['attachment_file']['size'] > (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024 * 1024)) $this->errors[] = sprintf( - $this->l('File too large, maximum size allowed: %1$d kB. File size you\'re trying to upload is: %2$d kB.'), + $this->l('The file is too large. Maximum size allowed is: %1$d kB. The file you\'re trying to upload is: %2$d kB.'), (Configuration::get('PS_ATTACHMENT_MAXIMUM_SIZE') * 1024), number_format(($_FILES['attachment_file']['size'] / 1024), 2, '.', '') ); @@ -401,13 +490,13 @@ class AdminProductsControllerCore extends AdminController $max_post = (int)ini_get('post_max_size'); $upload_mb = min($max_upload, $max_post); $this->errors[] = sprintf( - $this->l('The File %1$s exceeds the size allowed by the server. The limit is set to %2$d MB.'), + $this->l('The file %1$s exceeds the size allowed by the server. The limit is set to %2$d MB.'), ''.$_FILES['attachment_file']['name'].' ', ''.$upload_mb.'' ); } else - $this->errors[] = Tools::displayError('File is missing'); + $this->errors[] = Tools::displayError('The file is missing.'); if (empty($this->errors) && isset($uniqid)) { @@ -427,18 +516,18 @@ class AdminProductsControllerCore extends AdminController if (!Validate::isGenericName($attachment->file_name)) $this->errors[] = Tools::displayError('Invalid file name'); if (Tools::strlen($attachment->file_name) > 128) - $this->errors[] = Tools::displayError('File name too long'); + $this->errors[] = Tools::displayError('The file name is too long.'); if (empty($this->errors)) { $res = $attachment->add(); if (!$res) - $this->errors[] = Tools::displayError('Unable to add this attachment in the database'); + $this->errors[] = Tools::displayError('This attachment was unable to be loaded into the database.'); else { $id_product = (int)Tools::getValue($this->identifier); $res = $attachment->attachProduct($id_product); if (!$res) - $this->errors[] = Tools::displayError('Unable to associate this attachment to product'); + $this->errors[] = Tools::displayError('We were unable to associate this attachment to a product.'); } } else @@ -459,7 +548,7 @@ class AdminProductsControllerCore extends AdminController $attachments = trim(Tools::getValue('arrayAttachments'), ','); $attachments = explode(',', $attachments); if (!Attachment::attachToProduct($id, $attachments)) - $this->errors[] = Tools::displayError('There was an error while saving product attachments.'); + $this->errors[] = Tools::displayError('An error occurred while saving product attachments.'); } } @@ -508,7 +597,7 @@ class AdminProductsControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('An error occurred while creating object.'); + $this->errors[] = Tools::displayError('An error occurred while creating an object.'); } } @@ -533,20 +622,24 @@ class AdminProductsControllerCore extends AdminController $physical_quantity = $stock_manager->getProductPhysicalQuantities($object->id, 0); $real_quantity = $stock_manager->getProductRealQuantities($object->id, 0); if ($physical_quantity > 0 || $real_quantity > $physical_quantity) - $this->errors[] = Tools::displayError('You cannot delete the product because there is physical stock left or supply orders in progress.'); + $this->errors[] = Tools::displayError('You cannot delete this product because there\'s physical stock left.'); } - if ($object->delete()) + if (!count($this->errors)) { - $id_category = (int)Tools::getValue('id_category'); - $category_url = empty($id_category) ? '' : '&id_category='.(int)$id_category; - $this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token.$category_url; + if ($object->delete()) + { + $id_category = (int)Tools::getValue('id_category'); + $category_url = empty($id_category) ? '' : '&id_category='.(int)$id_category; + $this->redirect_after = self::$currentIndex.'&conf=1&token='.$this->token.$category_url; + } + else + $this->errors[] = Tools::displayError('An error occurred during deletion.'); } - $this->errors[] = Tools::displayError('An error occurred during deletion.'); } } else - $this->errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + $this->errors[] = Tools::displayError('An error occurred while deleting the object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); } public function processImage() @@ -571,7 +664,7 @@ class AdminProductsControllerCore extends AdminController Image::deleteCover($image->id_product); $image->cover = 1; if (!$image->update()) - $this->errors[] = Tools::displayError('Cannot change the product cover image'); + $this->errors[] = Tools::displayError('You cannot change the product\'s cover image.'); else { $productId = (int)Tools::getValue('id_product'); @@ -589,7 +682,7 @@ class AdminProductsControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('Could not find image.'); + $this->errors[] = Tools::displayError('The image could not be found. '); } protected function processBulkDelete() @@ -631,12 +724,17 @@ class AdminProductsControllerCore extends AdminController $physical_quantity = $stock_manager->getProductPhysicalQuantities($product->id, 0); $real_quantity = $stock_manager->getProductRealQuantities($product->id, 0); if ($physical_quantity > 0 || $real_quantity > $physical_quantity) - $this->errors[] = sprintf(Tools::displayError('You cannot delete the product #%d because there is physical stock left or supply orders in progress.'), $product->id); + $this->errors[] = sprintf(Tools::displayError('You cannot delete the product #%d because there is physical stock left.'), $product->id); + } + if (!count($this->errors)) + { + if ($product->delete()) + Logger::addLog(sprintf($this->l('%s deletion'), $this->className), 1, null, $this->className, (int)$product->id, true, (int)$this->context->employee->id); else - $success &= $product->delete(); + $success = false; } else - $success &= $product->delete(); + $success = 0; } } @@ -647,7 +745,7 @@ class AdminProductsControllerCore extends AdminController $this->redirect_after = self::$currentIndex.'&conf=2&token='.$this->token.$category_url; } else - $this->errors[] = Tools::displayError('An error occurred while deleting selection.'); + $this->errors[] = Tools::displayError('An error occurred while deleting this selection.'); } } else @@ -666,9 +764,29 @@ class AdminProductsControllerCore extends AdminController if (Validate::isLoadedObject($product = $this->object)) { if ($this->isProductFieldUpdated('attribute_price') && (!Tools::getIsset('attribute_price') || Tools::getIsset('attribute_price') == null)) - $this->errors[] = Tools::displayError('Attribute price required.'); + $this->errors[] = Tools::displayError('The price attribute is required.'); if (!Tools::getIsset('attribute_combination_list') || Tools::isEmpty(Tools::getValue('attribute_combination_list'))) $this->errors[] = Tools::displayError('You must add at least one attribute.'); + + $array_checks = array( + 'reference' => 'isReference', + 'supplier_reference' => 'isReference', + 'location' => 'isReference', + 'ean13' => 'isEan13', + 'upc' => 'isUpc', + 'wholesale_price' => 'isPrice', + 'price' => 'isPrice', + 'ecotax' => 'isPrice', + 'quantity' => 'isInt', + 'weight' => 'isUnsignedFloat', + 'unit_price_impact' => 'isPrice', + 'default_on' => 'isBool', + 'minimal_quantity' => 'isUnsignedInt', + 'available_date' => 'isDateFormat' + ); + foreach ($array_checks as $property => $check) + if (Tools::getValue('attribute_'.$property) !== false && !call_user_func(array('Validate', $check), Tools::getValue('attribute_'.$property))) + $this->errors[] = sprintf(Tools::displayError('Field %s is not valid'), $property); if (!count($this->errors)) { @@ -678,13 +796,13 @@ class AdminProductsControllerCore extends AdminController if (!isset($_POST['attribute_ecotax'])) $_POST['attribute_ecotax'] = 0; if (Tools::getValue('attribute_default')) $product->deleteDefaultAttributes(); + // Change existing one if (($id_product_attribute = (int)Tools::getValue('id_product_attribute')) || ($id_product_attribute = $product->productAttributeExists(Tools::getValue('attribute_combination_list'), false, null, true, true))) { if ($this->tabAccess['edit'] === '1') { - - if ($this->isProductFieldUpdated('available_date_attribute') && !Validate::isDateFormat(Tools::getValue('available_date_attribute'))) + if ($this->isProductFieldUpdated('available_date_attribute') && (Tools::getValue('available_date_attribute') != '' &&!Validate::isDateFormat(Tools::getValue('available_date_attribute')))) $this->errors[] = Tools::displayError('Invalid date format.'); else { @@ -701,14 +819,13 @@ class AdminProductsControllerCore extends AdminController Tools::getValue('attribute_location'), Tools::getValue('attribute_upc'), $this->isProductFieldUpdated('attribute_minimal_quantity') ? Tools::getValue('attribute_minimal_quantity') : null, - $this->isProductFieldUpdated('available_date_attribute') ? Tools::getValue('available_date_attribute') : null, - false); + $this->isProductFieldUpdated('available_date_attribute') ? Tools::getValue('available_date_attribute') : null, false); StockAvailable::setProductDependsOnStock((int)$product->id, $product->depends_on_stock, null, (int)$id_product_attribute); StockAvailable::setProductOutOfStock((int)$product->id, $product->out_of_stock, null, (int)$id_product_attribute); - } + } } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } // Add new else @@ -740,18 +857,21 @@ class AdminProductsControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('You do not have permission to').'
        '.Tools::displayError('Edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to').'
        '.Tools::displayError('edit here.'); } if (!count($this->errors)) { $combination = new Combination((int)$id_product_attribute); $combination->setAttributes(Tools::getValue('attribute_combination_list')); $product->checkDefaultAttributes(); - } - if (!count($this->errors)) - { - if (!$product->cache_default_attribute) - Product::updateDefaultAttribute($product->id); + if (Tools::getValue('attribute_default')) + { + Product::updateDefaultAttribute((int)$product->id); + if(isset($id_product_attribute)) + $product->cache_default_attribute = (int)$id_product_attribute; + if ($available_date = Tools::getValue('available_date_attribute')) + $product->setAvailableDate($available_date); + } } } } @@ -793,7 +913,7 @@ class AdminProductsControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('Product must be created before adding features.'); + $this->errors[] = Tools::displayError('A product must be created before adding features.'); } /** @@ -816,7 +936,9 @@ class AdminProductsControllerCore extends AdminController $tos = Tools::getValue('spm_to'); foreach ($id_specific_prices as $key => $id_specific_price) - if ($this->_validateSpecificPrice($id_shops[$key], $id_currencies[$key], $id_countries[$key], $id_groups[$key], $id_customers[$key], $prices[$key], $from_quantities[$key], $reductions[$key], $reduction_types[$key], $froms[$key], $tos[$key], $id_combinations[$key])) + if ($reduction_types[$key] == 'percentage' && ((float)$reductions[$key] <= 0 || (float)$reductions[$key] > 100)) + $this->errors[] = Tools::displayError('Submitted reduction value (0-100) is out-of-range'); + elseif ($this->_validateSpecificPrice($id_shops[$key], $id_currencies[$key], $id_countries[$key], $id_groups[$key], $id_customers[$key], $prices[$key], $from_quantities[$key], $reductions[$key], $reduction_types[$key], $froms[$key], $tos[$key], $id_combinations[$key])) { $specific_price = new SpecificPrice((int)($id_specific_price)); $specific_price->id_shop = (int)$id_shops[$key]; @@ -832,7 +954,7 @@ class AdminProductsControllerCore extends AdminController $specific_price->from = !$froms[$key] ? '0000-00-00 00:00:00' : $froms[$key]; $specific_price->to = !$tos[$key] ? '0000-00-00 00:00:00' : $tos[$key]; if (!$specific_price->update()) - $this->errors = Tools::displayError('An error occurred while updating the specific price.'); + $this->errors[] = Tools::displayError('An error occurred while updating the specific price.'); } if (!count($this->errors)) $this->redirect_after = self::$currentIndex.'&id_product='.(int)(Tools::getValue('id_product')).(Tools::getIsset('id_category') ? '&id_category='.(int)Tools::getValue('id_category') : '').'&update'.$this->table.'&action=Prices&token='.$this->token; @@ -862,7 +984,10 @@ class AdminProductsControllerCore extends AdminController $to = Tools::getValue('sp_to'); if (!$to) $to = '0000-00-00 00:00:00'; - if ($this->_validateSpecificPrice($id_shop, $id_currency, $id_country, $id_group, $id_customer, $price, $from_quantity, $reduction, $reduction_type, $from, $to, $id_product_attribute)) + + if ($reduction_type == 'percentage' && ((float)$reduction <= 0 || (float)$reduction > 100)) + $this->errors[] = Tools::displayError('Submitted reduction value (0-100) is out-of-range'); + elseif ($this->_validateSpecificPrice($id_shop, $id_currency, $id_country, $id_group, $id_customer, $price, $from_quantity, $reduction, $reduction_type, $from, $to, $id_product_attribute)) { $specificPrice = new SpecificPrice(); $specificPrice->id_product = (int)$id_product; @@ -879,7 +1004,7 @@ class AdminProductsControllerCore extends AdminController $specificPrice->from = $from; $specificPrice->to = $to; if (!$specificPrice->add()) - $this->errors = Tools::displayError('An error occurred while updating the specific price.'); + $this->errors[] = Tools::displayError('An error occurred while updating the specific price.'); } } @@ -889,12 +1014,12 @@ class AdminProductsControllerCore extends AdminController { $id_specific_price = (int)Tools::getValue('id_specific_price'); if (!$id_specific_price || !Validate::isUnsignedId($id_specific_price)) - $error = Tools::displayError('Invalid specific price ID'); + $error = Tools::displayError('The specific price ID is invalid.'); else { $specificPrice = new SpecificPrice((int)$id_specific_price); if (!$specificPrice->delete()) - $error = Tools::displayError('An error occurred while deleting the specific price'); + $error = Tools::displayError('An error occurred while attempting to delete the specific price.'); } } else @@ -919,13 +1044,13 @@ class AdminProductsControllerCore extends AdminController if (!($obj = $this->loadObject())) return; if (!$priorities = Tools::getValue('specificPricePriority')) - $this->errors[] = Tools::displayError('Please specify priorities'); + $this->errors[] = Tools::displayError('Please specify priorities.'); elseif (Tools::isSubmit('specificPricePriorityToAll')) { if (!SpecificPrice::setPriorities($priorities)) $this->errors[] = Tools::displayError('An error occurred while updating priorities.'); else - $this->confirmations[] = $this->l('Price rule successfully updated'); + $this->confirmations[] = $this->l('The price rule has successfully updated'); } elseif (!SpecificPrice::setSpecificPriority((int)$obj->id, $priorities)) $this->errors[] = Tools::displayError('An error occurred while setting priorities.'); @@ -952,10 +1077,10 @@ class AdminProductsControllerCore extends AdminController if (!$product->createLabels((int)$product->uploadable_files - $files_count, (int)$product->text_fields - $text_count)) $this->errors[] = Tools::displayError('An error occurred while creating customization fields.'); if (!count($this->errors) && !$product->updateLabels()) - $this->errors[] = Tools::displayError('An error occurred while updating customization.'); + $this->errors[] = Tools::displayError('An error occurred while updating customization fields.'); $product->customizable = ($product->uploadable_files > 0 || $product->text_fields > 0) ? 1 : 0; if (!count($this->errors) && !$product->update()) - $this->errors[] = Tools::displayError('An error occurred while updating customization configuration.'); + $this->errors[] = Tools::displayError('An error occurred while updating the custom configuration.'); } public function processProductCustomization() @@ -964,14 +1089,14 @@ class AdminProductsControllerCore extends AdminController { foreach ($_POST as $field => $value) if (strncmp($field, 'label_', 6) == 0 && !Validate::isLabel($value)) - $this->errors[] = Tools::displayError('Label fields are invalid'); + $this->errors[] = Tools::displayError('The label fields defined are invalid.'); if (empty($this->errors) && !$product->updateLabels()) - $this->errors[] = Tools::displayError('An error occurred while updating customization.'); + $this->errors[] = Tools::displayError('An error occurred while updating customization fields.'); if (empty($this->errors)) $this->confirmations[] = $this->l('Update successful'); } else - $this->errors[] = Tools::displayError('Product must be created before adding customization possibilities.'); + $this->errors[] = Tools::displayError('A product must be created before adding customization.'); } /** @@ -981,13 +1106,18 @@ class AdminProductsControllerCore extends AdminController { if (!Validate::isLoadedObject($object = $this->loadObject())) { - $this->errors[] = Tools::displayError('An error occurred while updating status for object.'). + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.'). ' '.$this->table.' '.Tools::displayError('(cannot load object)'); } elseif (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) $this->errors[] = Tools::displayError('Failed to update the position.'); else - $this->redirect_after = self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&action=Customization&conf=5'.(($id_category = (Tools::getIsset('id_category') ? (int)Tools::getValue('id_category') : '')) ? ('&id_category='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminProducts'); + { + $category = new Category((int)tools::getValue('id_category')); + if (Validate::isLoadedObject($category)) + Hook::exec('actionCategoryUpdate', array('category' => $category)); + $this->redirect_after = self::$currentIndex.'&'.$this->table.'Orderby=position&'.$this->table.'Orderway=asc&action=Customization&conf=5'.(($id_category = (Tools::getIsset('id_category') ? (int)Tools::getValue('id_category') : '')) ? ('&id_category='.$id_category) : '').'&token='.Tools::getAdminTokenLite('AdminProducts'); + } } public function initProcess() @@ -998,7 +1128,7 @@ class AdminProductsControllerCore extends AdminController if ($this->tabAccess['delete'] === '1') $this->action = 'deleteVirtualProduct'; else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } // Product preview elseif (Tools::isSubmit('submitAddProductAndPreview')) @@ -1021,7 +1151,7 @@ class AdminProductsControllerCore extends AdminController $this->display = 'edit'; } else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } elseif (Tools::isSubmit('submitAttachments')) { @@ -1031,7 +1161,7 @@ class AdminProductsControllerCore extends AdminController $this->tab_display = 'attachments'; } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } // Product duplication elseif (Tools::getIsset('duplicate'.$this->table)) @@ -1039,7 +1169,7 @@ class AdminProductsControllerCore extends AdminController if ($this->tabAccess['add'] === '1') $this->action = 'duplicate'; else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } // Product images management elseif (Tools::getValue('id_image') && Tools::getValue('ajax')) @@ -1047,7 +1177,7 @@ class AdminProductsControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') $this->action = 'image'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } // Product attributes management elseif (Tools::isSubmit('submitProductAttribute')) @@ -1055,7 +1185,7 @@ class AdminProductsControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') $this->action = 'productAttribute'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } // Product features management elseif (Tools::isSubmit('submitFeatures') || Tools::isSubmit('submitFeaturesAndStay')) @@ -1063,7 +1193,7 @@ class AdminProductsControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') $this->action = 'features'; else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } // Product specific prices management NEVER USED elseif (Tools::isSubmit('submitPricesModification')) @@ -1071,14 +1201,14 @@ class AdminProductsControllerCore extends AdminController if ($this->tabAccess['add'] === '1') $this->action = 'pricesModification'; else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } elseif (Tools::isSubmit('deleteSpecificPrice')) { if ($this->tabAccess['delete'] === '1') $this->action = 'deleteSpecificPrice'; else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } elseif (Tools::isSubmit('submitSpecificPricePriorities')) { @@ -1088,7 +1218,7 @@ class AdminProductsControllerCore extends AdminController $this->tab_display = 'prices'; } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } // Customization management elseif (Tools::isSubmit('submitCustomizationConfiguration')) @@ -1100,7 +1230,7 @@ class AdminProductsControllerCore extends AdminController $this->display = 'edit'; } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } elseif (Tools::isSubmit('submitProductCustomization')) { @@ -1111,7 +1241,7 @@ class AdminProductsControllerCore extends AdminController $this->display = 'edit'; } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } if (!$this->action) @@ -1137,27 +1267,6 @@ class AdminProductsControllerCore extends AdminController } } - /** - * Override parent to add stock data to object - * We don't want to make a "full" product load because of side effects to prices - * - * @param boolean $opt Return an empty object if load fail - * @return object - */ - protected function loadObject($opt = false) - { - $result = parent::loadObject($opt); - if ($result) - { - if ($this->object->id) - if (!$this->object->isAssociatedToShop() && $this->object->id_shop_default) - $this->object = new $this->className((int)$this->object->id, false, null, (int)$this->object->id_shop_default); - - $this->object->loadStockData(); - } - return $result; - } - /** * postProcess handle every checks before saving products information * @@ -1275,7 +1384,7 @@ class AdminProductsControllerCore extends AdminController else $json = array( 'status' => 'error', - 'message'=> $this->l('Cannot delete attribute') + 'message'=> $this->l('You cannot delete this attribute.') ); } else @@ -1306,7 +1415,7 @@ class AdminProductsControllerCore extends AdminController else $json = array( 'status' => 'error', - 'message'=> $this->l('Cannot make default attribute') + 'message'=> $this->l('You cannot make this the default attribute.') ); die(Tools::jsonEncode($json)); @@ -1341,22 +1450,46 @@ class AdminProductsControllerCore extends AdminController public function ajaxProcessUpdateProductImageShopAsso() { + $id_product = Tools::getValue('id_product'); if (($id_image = Tools::getValue('id_image')) && ($id_shop = (int)Tools::getValue('id_shop'))) if (Tools::getValue('active') == 'true') - $res = Db::getInstance()->execute( - 'INSERT INTO '._DB_PREFIX_.'image_shop (`id_image`, `id_shop`) - VALUES('.(int)$id_image.', '.(int)$id_shop.') - '); + $res = Db::getInstance()->execute('INSERT INTO '._DB_PREFIX_.'image_shop (`id_image`, `id_shop`) VALUES('.(int)$id_image.', '.(int)$id_shop.')'); else - $res = Db::getInstance()->execute(' - DELETE FROM '._DB_PREFIX_.'image_shop - WHERE `id_image`='.(int)$id_image.' && `id_shop`='.(int)$id_shop - ); + $res = Db::getInstance()->execute('DELETE FROM '._DB_PREFIX_.'image_shop WHERE `id_image` = '.(int)$id_image.' AND `id_shop` = '.(int)$id_shop); + + // Clean covers in image table + $count_cover_image = Db::getInstance()->getValue(' + SELECT COUNT(*) FROM '._DB_PREFIX_.'image i + INNER JOIN '._DB_PREFIX_.'image_shop ish ON (i.id_image = ish.id_image AND ish.id_shop = '.(int)$id_shop.') + WHERE i.cover = 1 AND `id_product` = '.(int)$id_product); + + $id_image = Db::getInstance()->getValue(' + SELECT i.`id_image` FROM '._DB_PREFIX_.'image i + INNER JOIN '._DB_PREFIX_.'image_shop ish ON (i.id_image = ish.id_image AND ish.id_shop = '.(int)$id_shop.') + WHERE `id_product` = '.(int)$id_product); + + if ($count_cover_image < 1) + Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'image i SET i.cover = 1 WHERE i.id_image = '.(int)$id_image.' AND i.`id_product` = '.(int)$id_product.' LIMIT 1'); + + if ($count_cover_image > 1) + Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'image i SET i.cover = 0 WHERE i.id_image <> '.(int)$id_image.' AND i.`id_product` = '.(int)$id_product); + + // Clean covers in image_shop table + $count_cover_image_shop = Db::getInstance()->getValue(' + SELECT COUNT(*) + FROM '._DB_PREFIX_.'image_shop ish + INNER JOIN '._DB_PREFIX_.'image i ON (i.id_image = ish.id_image AND i.`id_product` = '.(int)$id_product.') + WHERE ish.id_shop = '.(int)$id_shop.' AND ish.cover = 1'); + + if ($count_cover_image_shop < 1) + Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'image_shop ish SET ish.cover = 1 WHERE ish.id_image = '.(int)$id_image.' AND ish.id_shop = '.(int)$id_shop.' LIMIT 1'); + if ($count_cover_image_shop > 1) + Db::getInstance()->execute('UPDATE '._DB_PREFIX_.'image_shop ish SET ish.cover = 0 WHERE ish.id_image <> '.(int)$id_image.' AND ish.cover = 1 AND ish.id_shop = '.(int)$id_shop.' LIMIT '.intval($count_cover_image_shop - 1)); if ($res) $this->jsonConfirmation($this->_conf[27]); else - $this->jsonError(Tools::displayError('Error on picture shop association')); + $this->jsonError(Tools::displayError('An error occurred while attempting to associate this image with your shop. ')); } public function ajaxProcessUpdateImagePosition() @@ -1377,7 +1510,7 @@ class AdminProductsControllerCore extends AdminController if ($res) $this->jsonConfirmation($this->_conf[25]); else - $this->jsonError(Tools::displayError('Error on moving picture')); + $this->jsonError(Tools::displayError('An error occurred while attempting to move this picture.')); } public function ajaxProcessUpdateCover() @@ -1392,7 +1525,7 @@ class AdminProductsControllerCore extends AdminController if ($img->update()) $this->jsonConfirmation($this->_conf[26]); else - $this->jsonError(Tools::displayError('Error on moving picture')); + $this->jsonError(Tools::displayError('An error occurred while attempting to move this picture.')); } public function ajaxProcessDeleteProductImage() @@ -1407,8 +1540,9 @@ class AdminProductsControllerCore extends AdminController if (!Image::getCover($image->id_product)) { $res &= Db::getInstance()->execute(' - UPDATE `'._DB_PREFIX_.'image_shop` image_shop - SET image_shop.`cover` = 1 + UPDATE `'._DB_PREFIX_.'image_shop` image_shop, '._DB_PREFIX_.'image i + SET image_shop.`cover` = 1, + i.cover = 1 WHERE image_shop.`id_image` = (SELECT id_image FROM (SELECT image_shop.id_image FROM '._DB_PREFIX_.'image i'. @@ -1416,7 +1550,8 @@ class AdminProductsControllerCore extends AdminController WHERE i.id_product ='.(int)$image->id_product.' LIMIT 1 ) tmpImage) AND id_shop='.(int)$this->context->shop->id.' - LIMIT 1'); + AND i.id_image = image_shop.id_image + '); } if (file_exists(_PS_TMP_IMG_DIR_.'product_'.$image->id_product.'.jpg')) @@ -1427,7 +1562,7 @@ class AdminProductsControllerCore extends AdminController if ($res) $this->jsonConfirmation($this->_conf[7]); else - $this->jsonError(Tools::displayError('Error on deleting product image')); + $this->jsonError(Tools::displayError('An error occurred while attempting to delete the product image.')); } protected function _validateSpecificPrice($id_shop, $id_currency, $id_country, $id_group, $id_customer, $price, $from_quantity, $reduction, $reduction_type, $from, $to, $id_combination = 0) @@ -1439,11 +1574,11 @@ class AdminProductsControllerCore extends AdminController elseif (!Validate::isUnsignedInt($from_quantity)) $this->errors[] = Tools::displayError('Invalid quantity'); elseif ($reduction && !Validate::isReductionType($reduction_type)) - $this->errors[] = Tools::displayError('Please select a discount type (amount or percentage)'); + $this->errors[] = Tools::displayError('Please select a discount type (amount or percentage).'); elseif ($from && $to && (!Validate::isDateFormat($from) || !Validate::isDateFormat($to))) - $this->errors[] = Tools::displayError('Wrong from/to date'); + $this->errors[] = Tools::displayError('The from/to date is invalid.'); elseif (SpecificPrice::exists((int)$this->object->id, $id_combination, $id_shop, $id_group, $id_country, $id_currency, $id_customer, $from_quantity, $from, $to, false)) - $this->errors[] = Tools::displayError('A specific price already exists for these parameters'); + $this->errors[] = Tools::displayError('A specific price already exists for these parameters.'); else return true; return false; @@ -1467,7 +1602,7 @@ class AdminProductsControllerCore extends AdminController ); elseif (!call_user_func(array('Validate', $rules['validateLang']['value']), $val)) $this->errors[] = sprintf( - Tools::displayError('Valid name required for feature. %1$s in %2$s.'), + Tools::displayError('A valid name required for feature. %1$s in %2$s.'), ' '.$feature['name'].'', $current_language->name ); @@ -1492,7 +1627,7 @@ class AdminProductsControllerCore extends AdminController { $image = new Image((int)$id_image); if (!Validate::isLoadedObject($image)) - $this->errors[] = Tools::displayError('An error occurred while loading object image.'); + $this->errors[] = Tools::displayError('An error occurred while loading the object image.'); else { if (($cover = Tools::getValue('cover')) == 1) @@ -1501,7 +1636,7 @@ class AdminProductsControllerCore extends AdminController $this->validateRules('Image'); $this->copyFromPost($image, 'image'); if (count($this->errors) || !$image->update()) - $this->errors[] = Tools::displayError('An error occurred while updating image.'); + $this->errors[] = Tools::displayError('An error occurred while updating the image.'); elseif (isset($_FILES['image_product']['tmp_name']) && $_FILES['image_product']['tmp_name'] != null) $this->copyImage($product->id, $image->id, $method); } @@ -1531,11 +1666,11 @@ class AdminProductsControllerCore extends AdminController $image = new Image($id_image); if (!$new_path = $image->getPathForCreation()) - $this->errors[] = Tools::displayError('An error occurred during new folder creation'); + $this->errors[] = Tools::displayError('An error occurred while attempting to create a new folder.'); if (!($tmpName = tempnam(_PS_TMP_IMG_DIR_, 'PS')) || !move_uploaded_file($_FILES['image_product']['tmp_name'], $tmpName)) - $this->errors[] = Tools::displayError('An error occurred during the image upload'); + $this->errors[] = Tools::displayError('An error occurred during the image upload process.'); elseif (!ImageManager::resize($tmpName, $new_path.'.'.$image->image_format)) - $this->errors[] = Tools::displayError('An error occurred while copying image.'); + $this->errors[] = Tools::displayError('An error occurred while copying the image.'); elseif ($method == 'auto') { $imagesTypes = ImageType::getImagesTypes('products'); @@ -1573,6 +1708,7 @@ class AdminProductsControllerCore extends AdminController if ($this->object->add()) { + Logger::addLog(sprintf($this->l('%s addition'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); $this->addCarriers(); $this->updateAccessories($this->object); $this->updatePackItems($this->object); @@ -1582,7 +1718,7 @@ class AdminProductsControllerCore extends AdminController { $languages = Language::getLanguages(false); if ($this->isProductFieldUpdated('category_box') && !$this->object->updateCategories(Tools::getValue('categoryBox'))) - $this->errors[] = Tools::displayError('An error occurred while linking object.').' '.$this->table.' '.Tools::displayError('To categories'); + $this->errors[] = Tools::displayError('An error occurred while linking the object.').' '.$this->table.' '.Tools::displayError('To categories'); elseif (!$this->updateTags($languages, $this->object)) $this->errors[] = Tools::displayError('An error occurred while adding tags.'); else @@ -1633,7 +1769,7 @@ class AdminProductsControllerCore extends AdminController $this->display = 'edit'; } else - $this->errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.''; + $this->errors[] = Tools::displayError('An error occurred while creating an object.').' '.$this->table.''; return $this->object; } @@ -1649,6 +1785,19 @@ class AdminProductsControllerCore extends AdminController return false; } + public function processStatus() + { + $this->loadObject(true); + if (!Validate::isLoadedObject($this->object)) + return false; + if (($error = $this->object->validateFields(false, true)) !== true) + $this->errors[] = $error; + if (($error = $this->object->validateFieldsLang(false, true)) !== true) + $this->errors[] = $error; + + return !count($this->errors) ? parent::processStatus() : false; + } + public function processUpdate() { $this->checkProduct(); @@ -1669,14 +1818,39 @@ class AdminProductsControllerCore extends AdminController if (Validate::isLoadedObject($object)) { $this->_removeTaxFromEcotax(); + $product_type_before = $object->getType(); $this->copyFromPost($object, $this->table); $object->indexed = 0; if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP) $object->setFieldsToUpdate((array)Tools::getValue('multishop_check')); + // Duplicate combinations if not associated to shop + if ($this->context->shop->getContext() == Shop::CONTEXT_SHOP && !$object->isAssociatedToShop()) + { + $is_associated_to_shop = false; + $combinations = Product::getProductAttributesIds($object->id); + if ($combinations) + { + foreach ($combinations as $id_combination) + { + $combination = new Combination((int)$id_combination['id_product_attribute']); + $default_combination = new Combination((int)$id_combination['id_product_attribute'], null, (int)$this->object->id_shop_default); + + $def = ObjectModel::getDefinition($default_combination); + foreach ($def['fields'] as $field_name => $row) + $combination->$field_name = ObjectModel::formatValue($default_combination->$field_name, $def['fields'][$field_name]['type']); + + $combination->save(); + } + } + } + else + $is_associated_to_shop = true; + if ($object->update()) { + Logger::addLog(sprintf($this->l('%s edition'), $this->className), 1, null, $this->className, (int)$this->object->id, true, (int)$this->context->employee->id); if (in_array($this->context->shop->getContext(), array(Shop::CONTEXT_SHOP, Shop::CONTEXT_ALL))) { if ($this->isTabSubmitted('Shipping')) @@ -1693,7 +1867,6 @@ class AdminProductsControllerCore extends AdminController { $this->processPriceAddition(); $this->processSpecificPricePriorities(); - $this->object->id_tax_rules_group = (int)Tools::getValue('id_tax_rules_group'); } if ($this->isTabSubmitted('Customization')) $this->processCustomizationConfiguration(); @@ -1701,11 +1874,14 @@ class AdminProductsControllerCore extends AdminController $this->processAttachments(); $this->updatePackItems($object); + // Disallow avanced stock management if the product become a pack + if ($product_type_before == Product::PTYPE_SIMPLE && $object->getType() == Product::PTYPE_PACK) + StockAvailable::setProductDependsOnStock((int)$object->id, false); $this->updateDownloadProduct($object, 1); $this->updateTags(Language::getLanguages(false), $object); - if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox'), true)) - $this->errors[] = Tools::displayError('An error occurred while linking object.').' '.$this->table.' '.Tools::displayError('To categories'); + if ($this->isProductFieldUpdated('category_box') && !$object->updateCategories(Tools::getValue('categoryBox'))) + $this->errors[] = Tools::displayError('An error occurred while linking the object.').' '.$this->table.' '.Tools::displayError('To categories'); } if ($this->isTabSubmitted('Warehouses')) @@ -1763,10 +1939,18 @@ class AdminProductsControllerCore extends AdminController $this->display = 'edit'; } else - $this->errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; + { + if (!$is_associated_to_shop && $combinations) + foreach ($combinations as $id_combination) + { + $combination = new Combination((int)$id_combination['id_product_attribute']); + $combination->delete(); + } + $this->errors[] = Tools::displayError('An error occurred while updating an object.').' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; + } } else - $this->errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' ('.Tools::displayError('Cannot load object').')'; + $this->errors[] = Tools::displayError('An error occurred while updating an object.').' '.$this->table.' ('.Tools::displayError('The object cannot be loaded. ').')'; return $object; } } @@ -1793,7 +1977,7 @@ class AdminProductsControllerCore extends AdminController if (Tools::getValue('id_'.$this->table) && $field == 'passwd') continue; $this->errors[] = sprintf( - Tools::displayError('The field %s is required.'), + Tools::displayError('The %s field is required.'), call_user_func(array($className, 'displayFieldName'), $field, $className) ); } @@ -1803,7 +1987,7 @@ class AdminProductsControllerCore extends AdminController foreach ($rules['requiredLang'] as $fieldLang) if ($this->isProductFieldUpdated($fieldLang, $default_language->id) && !Tools::getValue($fieldLang.'_'.$default_language->id)) $this->errors[] = sprintf( - Tools::displayError('This field %1$s is required at least in %2$s'), + Tools::displayError('This %1$s field is required at least in %2$s'), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className), $default_language->name ); @@ -1812,7 +1996,7 @@ class AdminProductsControllerCore extends AdminController foreach ($rules['size'] as $field => $maxLength) if ($this->isProductFieldUpdated($field) && ($value = Tools::getValue($field)) && Tools::strlen($value) > $maxLength) $this->errors[] = sprintf( - Tools::displayError('The field %1$s is too long (%2$d chars max).'), + Tools::displayError('The %1$s field is too long (%2$d chars max).'), call_user_func(array($className, 'displayFieldName'), $field, $className), $maxLength ); @@ -1830,7 +2014,7 @@ class AdminProductsControllerCore extends AdminController if ($this->isProductFieldUpdated('description_short', $language['id_lang']) && ($value = Tools::getValue('description_short_'.$language['id_lang']))) if (Tools::strlen(strip_tags($value)) > $limit) $this->errors[] = sprintf( - Tools::displayError('This field %1$s (%2$s) is too long: %3$d chars max (count now %4$d).'), + Tools::displayError('This %1$s field (%2$s) is too long: %3$d chars max (current count %4$d).'), call_user_func(array($className, 'displayFieldName'), 'description_short'), $language['name'], $limit, @@ -1844,7 +2028,7 @@ class AdminProductsControllerCore extends AdminController $value = Tools::getValue($fieldLang.'_'.$language['id_lang']); if ($value && Tools::strlen($value) > $maxLength) $this->errors[] = sprintf( - Tools::displayError('The field %1$s is too long (%2$d chars max).'), + Tools::displayError('The %1$s field is too long (%2$d chars max).'), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className), $maxLength ); @@ -1856,36 +2040,47 @@ class AdminProductsControllerCore extends AdminController // Check fields validity foreach ($rules['validate'] as $field => $function) if ($this->isProductFieldUpdated($field) && ($value = Tools::getValue($field))) - if (!Validate::$function($value)) + { + $res = true; + if (Tools::strtolower($function) == 'iscleanhtml') + { + if (!Validate::$function($value, (int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) + $res = false; + } + else + if (!Validate::$function($value)) + $res = false; + + if (!$res) $this->errors[] = sprintf( - Tools::displayError('The field %s is invalid.'), + Tools::displayError('The %s field is invalid.'), call_user_func(array($className, 'displayFieldName'), $field, $className) ); - + } // Check multilingual fields validity foreach ($rules['validateLang'] as $fieldLang => $function) foreach ($languages as $language) if ($this->isProductFieldUpdated('description_short', $language['id_lang']) && ($value = Tools::getValue($fieldLang.'_'.$language['id_lang']))) - if (!Validate::$function($value)) + if (!Validate::$function($value, (int)Configuration::get('PS_ALLOW_HTML_IFRAME'))) $this->errors[] = sprintf( - Tools::displayError('The field %1$s (%2$s) is invalid.'), + Tools::displayError('The %1$s field (%2$s) is invalid.'), call_user_func(array($className, 'displayFieldName'), $fieldLang, $className), $language['name'] ); // Categories if ($this->isProductFieldUpdated('id_category_default') && (!Tools::isSubmit('categoryBox') || !count(Tools::getValue('categoryBox')))) - $this->errors[] = $this->l('product must be in at least one Category'); + $this->errors[] = $this->l('Products must be in at least one category.'); if ($this->isProductFieldUpdated('id_category_default') && (!is_array(Tools::getValue('categoryBox')) || !in_array(Tools::getValue('id_category_default'), Tools::getValue('categoryBox')))) - $this->errors[] = $this->l('product must be in the default category'); + $this->errors[] = $this->l('This product must be in the default category.'); // Tags foreach ($languages as $language) if ($value = Tools::getValue('tags_'.$language['id_lang'])) if (!Validate::isTagsList($value)) $this->errors[] = sprintf( - Tools::displayError('Tags list (%s) is invalid'), + Tools::displayError('The tags list (%s) is invalid.'), $language['name'] ); } @@ -1937,15 +2132,15 @@ class AdminProductsControllerCore extends AdminController public function updateDownloadProduct($product, $edit = 0) { $is_virtual_file = (int)Tools::getValue('is_virtual_file'); - $product->setDefaultAttribute(0);//reset cache_default_attribute // add or update a virtual product if (Tools::getValue('is_virtual_good') == 'true') { + $product->setDefaultAttribute(0);//reset cache_default_attribute if (Tools::getValue('virtual_product_expiration_date') && !Validate::isDate(Tools::getValue('virtual_product_expiration_date') && !empty($is_virtual_file))) { if (!Tools::getValue('virtual_product_expiration_date')) { - $this->errors[] = Tools::displayError('This field expiration date attribute is required.'); + $this->errors[] = Tools::displayError('The expiration-date attribute is required.'); return false; } } @@ -2040,7 +2235,7 @@ class AdminProductsControllerCore extends AdminController $tag_success = true; /* Reset all tags for THIS product */ if (!Tag::deleteTagsForProduct((int)$product->id)) - $this->errors[] = Tools::displayError('An error occurred while deleting previous tags.'); + $this->errors[] = Tools::displayError('An error occurred while attempting to delete previous tags.'); /* Assign tags to this product */ foreach ($languages as $language) if ($value = Tools::getValue('tags_'.$language['id_lang'])) @@ -2082,10 +2277,6 @@ class AdminProductsControllerCore extends AdminController foreach ($this->available_tabs as $product_tab => $value) { - // if it's the quantities tab and stock management is disabled, continue - if ($stock_management_active == 0 && $product_tab == 'Quantities') - continue; - // if it's the warehouses tab and advanced stock management is disabled, continue if ($advanced_stock_management_active == 0 && $product_tab == 'Warehouses') continue; @@ -2102,8 +2293,8 @@ class AdminProductsControllerCore extends AdminController } else { - if ($id_category = (int)Tools::getValue('id_category')) - self::$currentIndex .= '&id_category='.(int)$id_category; + if ($id_category = (int)$this->id_current_category) + self::$currentIndex .= '&id_category='.(int)$this->id_current_category; // If products from all categories are displayed, we don't want to use sorting by position if (!$id_category) @@ -2115,8 +2306,9 @@ class AdminProductsControllerCore extends AdminController unset($this->context->cookie->{$this->table.'Orderway'}); } } - $id_category = (int)Tools::getValue('id_category', 1); - $this->tpl_list_vars['is_category_filter'] = Tools::getValue('id_category') ? true : false; + if (!$id_category) + $id_category = 1; + $this->tpl_list_vars['is_category_filter'] = (bool)$this->id_current_category; // Generate category selection tree $helper = new Helper(); @@ -2200,9 +2392,9 @@ class AdminProductsControllerCore extends AdminController $content = '

        - '.$this->l('Your product will be saved as a draft').' + '.$this->l('Your product will be saved as a draft.').' - '.$this->l('Save and preview').' + '.$this->l('Save and preview.').'

        @@ -2212,6 +2404,7 @@ class AdminProductsControllerCore extends AdminController public function initToolbar() { + parent::initToolbar(); if ($this->display == 'edit' || $this->display == 'add') { if ($product = $this->loadObject(true)) @@ -2223,7 +2416,7 @@ class AdminProductsControllerCore extends AdminController $this->toolbar_btn['delete'] = array( 'short' => 'Delete', 'href' => $this->context->link->getAdminLink('AdminProducts').'&id_product='.(int)$product->id.'&deleteproduct', - 'desc' => $this->l('Delete this product'), + 'desc' => $this->l('Delete this product.'), 'confirm' => 1, 'js' => 'if (confirm(\''.$this->l('Delete product?').'\')){return true;}else{event.preventDefault();}' ); @@ -2279,8 +2472,12 @@ class AdminProductsControllerCore extends AdminController } } } - - parent::initToolbar(); + else + $this->toolbar_btn['import'] = array( + 'href' => $this->context->link->getAdminLink('AdminImport', true).'&import_type='.$this->table, + 'desc' => $this->l('Import') + ); + $this->context->smarty->assign('toolbar_scroll', 1); $this->context->smarty->assign('show_toolbar', 1); $this->context->smarty->assign('toolbar_btn', $this->toolbar_btn); @@ -2308,33 +2505,6 @@ class AdminProductsControllerCore extends AdminController return; $product = $this->object; - $this->product_exists_in_shop = true; - if ($this->display == 'edit' && Validate::isLoadedObject($product) && Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP && !$product->isAssociatedToShop($this->context->shop->id)) - { - $this->product_exists_in_shop = false; - if ($this->tab_display == 'Informations') - $this->displayWarning($this->l('Warning: this product does not exist in this shop.')); - - $default_product = new Product(); - $fields_to_copy = array('minimal_quantity', - 'price', - 'additional_shipping_cost', - 'wholesale_price', - 'on_sale', - 'online_only', - 'unity', - 'unit_price_ratio', - 'ecotax', - 'active', - 'available_for_order', - 'available_date', - 'show_price', - 'indexed', - 'id_tax_rules_group', - 'advanced_stock_management'); - foreach ($fields_to_copy as $field) - $product->$field = $default_product->$field; - } // Product for multishop $this->context->smarty->assign('bullet_common_field', ''); @@ -2366,7 +2536,7 @@ class AdminProductsControllerCore extends AdminController $this->tpl_form_vars['currentIndex'] = self::$currentIndex; $this->tpl_form_vars['display_multishop_checkboxes'] = (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_SHOP && $this->display == 'edit'); $this->fields_form = array(''); - $this->display = 'edit'; + $this->tpl_form_vars['token'] = $this->token; $this->tpl_form_vars['combinationImagesJs'] = $this->getCombinationImagesJs(); $this->tpl_form_vars['PS_ALLOW_ACCENTED_CHARS_URL'] = (int)Configuration::get('PS_ALLOW_ACCENTED_CHARS_URL'); @@ -2396,6 +2566,20 @@ class AdminProductsControllerCore extends AdminController $this->tpl_form_vars['upload_max_filesize'] = $upload_max_filesize; $this->tpl_form_vars['country_display_tax_label'] = $this->context->country->display_tax_label; $this->tpl_form_vars['has_combinations'] = $this->object->hasAttributes(); + $this->product_exists_in_shop = true; + + if ($this->display == 'edit' && Validate::isLoadedObject($product) && Shop::isFeatureActive() && Shop::getContext() == Shop::CONTEXT_SHOP && !$product->isAssociatedToShop($this->context->shop->id)) + { + $this->product_exists_in_shop = false; + if ($this->tab_display == 'Informations') + $this->displayWarning($this->l('Warning: The product does not exist in this shop.')); + + $default_product = new Product(); + $definition = ObjectModel::getDefinition($product); + foreach ($definition['fields'] as $field_name => $field) + if (isset($field['shop']) && $field['shop']) + $product->$field_name = ObjectModel::formatValue($default_product->$field_name, $field['type']); + } // let's calculate this once for all if (!Validate::isLoadedObject($this->object) && Tools::getValue('id_product')) @@ -2411,12 +2595,14 @@ class AdminProductsControllerCore extends AdminController $this->initPack($this->object); $this->{'initForm'.$this->tab_display}($this->object); $this->tpl_form_vars['product'] = $this->object; + if ($this->ajax) if (!isset($this->tpl_form_vars['custom_form'])) throw new PrestaShopException('custom_form empty for action '.$this->tab_display); else return $this->tpl_form_vars['custom_form']; } + $parent = parent::renderForm(); $this->addJqueryPlugin(array('autocomplete', 'fancybox', 'typewatch')); return $parent; @@ -2560,7 +2746,7 @@ class AdminProductsControllerCore extends AdminController if (!$product_supplier_id) { - $product->addSupplierReference($supplier->id_supplier, (int)$attribute['id_product_attribute'], $reference, (float)Tools::convertPrice($price, $id_currency), (int)$id_currency); + $product->addSupplierReference($supplier->id_supplier, (int)$attribute['id_product_attribute'], $reference, (float)$price, (int)$id_currency); if ($product->id_supplier == $supplier->id_supplier) { if ((int)$attribute['id_product_attribute'] > 0) @@ -2586,7 +2772,7 @@ class AdminProductsControllerCore extends AdminController { $product_supplier = new ProductSupplier($product_supplier_id); $product_supplier->id_currency = (int)$id_currency; - $product_supplier->product_supplier_price_te = (float)Tools::convertPrice($price, $id_currency); //converted in the default currency + $product_supplier->product_supplier_price_te = (float)$price; $product_supplier->product_supplier_reference = pSQL($reference); $product_supplier->update(); @@ -2700,8 +2886,7 @@ class AdminProductsControllerCore extends AdminController $data = $this->createTemplate($this->tpl_form); // Prepare Categories tree for display in Associations tab $root = Category::getRootCategory(); - $default_category = Tools::getValue('id_category', Context::getContext()->shop->id_category); - + $default_category = $this->context->cookie->id_category_products_filter ? $this->context->cookie->id_category_products_filter : Context::getContext()->shop->id_category; if (!$product->id || !$product->isAssociatedToShop()) $selected_cat = Category::getCategoryInformations(Tools::getValue('categoryBox', array($default_category)), $this->default_form_language); else @@ -2794,24 +2979,26 @@ class AdminProductsControllerCore extends AdminController 'countries' => $countries, 'groups' => $groups, 'combinations' => $combinations, - 'product' => $product, 'multi_shop' => Shop::isFeatureActive(), 'link' => new Link() )); } else - $this->displayWarning($this->l('You must save this product before adding specific prices')); + { + $this->displayWarning($this->l('You must save this product before adding specific pricing')); + $product->id_tax_rules_group = (int)Product::getIdTaxRulesGroupMostUsed(); + $data->assign('ecotax_tax_excl', 0); + } // prices part $data->assign(array( 'link' => $this->context->link, 'currency' => $currency = $this->context->currency, - 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true), + 'tax_rules_groups' => TaxRulesGroup::getTaxRulesGroups(true, true), 'taxesRatesByGroup' => TaxRulesGroup::getAssociatedTaxRatesByIdCountry($this->context->country->id), 'ecotaxTaxRate' => Tax::getProductEcotaxRate(), 'tax_exclude_taxe_option' => Tax::excludeTaxeOption(), 'ps_use_ecotax' => Configuration::get('PS_USE_ECOTAX'), - 'ecotax_tax_excl' => 0 )); $product->price = Tools::convertPrice($product->price, $this->context->currency, true, $this->context); @@ -2949,7 +3136,7 @@ class AdminProductsControllerCore extends AdminController if (!file_exists($exists_file) && !empty($product->productDownload->display_filename) && empty($product->cache_default_attribute)) - $msg = sprintf(Tools::displayError('This file "%s" is missing'), $product->productDownload->display_filename); + $msg = sprintf(Tools::displayError('This file "%s" is missing.'), $product->productDownload->display_filename); else $msg = ''; @@ -3011,7 +3198,7 @@ class AdminProductsControllerCore extends AdminController if (!is_array($specific_prices) || !count($specific_prices)) $content .= '
        - + '; else { @@ -3069,7 +3256,7 @@ class AdminProductsControllerCore extends AdminController '; } $price = Tools::ps_round($specific_price['price'], 2); - $fixed_price = ($price == Tools::ps_round($obj->price, 2) || $specific_price['price'] == -1) ? '--' : Tools::displayPrice($price); + $fixed_price = ($price == Tools::ps_round($obj->price, 2) || $specific_price['price'] == -1) ? '--' : Tools::displayPrice($price, $current_specific_currency); $content .= ' @@ -3119,7 +3306,7 @@ class AdminProductsControllerCore extends AdminController

        '.$this->l('Priority management').'

        - '.$this->l('Sometimes one customer can fit into multiple specific price rules. Priorities allow you to define which rule applies to the customer.').' + '.$this->l('Sometimes one customer can fit into multiple price rules. Priorities allow you to define which rule applies to the customer.').'

        @@ -3240,7 +3427,7 @@ class AdminProductsControllerCore extends AdminController )); } else - $this->displayWarning($this->l('You must save this product in this shop before adding customization.')); + $this->displayWarning($this->l('You must save the product in this shop before adding customization.')); } else $this->displayWarning($this->l('You must save this product before adding customization.')); @@ -3282,7 +3469,7 @@ class AdminProductsControllerCore extends AdminController )); } else - $this->displayWarning($this->l('You must save this product in this shop before adding attachements.')); + $this->displayWarning($this->l('You must save the product in this shop before adding attachements.')); } else $this->displayWarning($this->l('You must save this product before adding attachements.')); @@ -3298,9 +3485,8 @@ class AdminProductsControllerCore extends AdminController $data->assign('languages', $this->_languages); $data->assign('currency', $currency); $this->object = $product; - $this->display = 'edit'; - - + //$this->display = 'edit'; + $data->assign('product_name_redirected', Product::getProductName((int)$product->id_product_redirected, null, (int)$this->context->language->id)); /* * Form for adding a virtual product like software, mp3, etc... */ @@ -3354,6 +3540,7 @@ class AdminProductsControllerCore extends AdminController $product->tags = Tag::getProductTags($product->id); $data->assign('product_type', (int)Tools::getValue('type_product', $product->getType())); + $data->assign('is_in_pack', (int)Pack::isPacked($product->id)); $check_product_association_ajax = false; if (Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL) @@ -3454,23 +3641,25 @@ class AdminProductsControllerCore extends AdminController $current_shop_id = (int)$this->context->shop->id; else $current_shop_id = 0; + + $languages = Language::getLanguages(true); $data->assign(array( - 'countImages' => $count_images, - 'id_product' => (int)Tools::getValue('id_product'), - 'id_category_default' => (int)$this->_category->id, - 'images' => $images, - 'token' => $this->token, - 'table' => $this->table, - 'max_image_size' => $this->max_image_size / 1024 / 1024, - 'up_filename' => (string)Tools::getValue('virtual_product_filename_attribute'), - 'currency' => $this->context->currency, - 'current_shop_id' => $current_shop_id - ) - ); + 'countImages' => $count_images, + 'id_product' => (int)Tools::getValue('id_product'), + 'id_category_default' => (int)$this->_category->id, + 'images' => $images, + 'iso_lang' => $languages[0]['iso_code'], + 'token' => $this->token, + 'table' => $this->table, + 'max_image_size' => $this->max_image_size / 1024 / 1024, + 'up_filename' => (string)Tools::getValue('virtual_product_filename_attribute'), + 'currency' => $this->context->currency, + 'current_shop_id' => $current_shop_id + )); } else - $this->displayWarning($this->l('You must save this product in this shop before adding images.')); + $this->displayWarning($this->l('You must save the product in this shop before adding images.')); } else $this->displayWarning($this->l('You must save this product before adding images.')); @@ -3487,7 +3676,7 @@ class AdminProductsControllerCore extends AdminController { $data = $this->createTemplate($this->tpl_form); if (!Combination::isFeatureActive()) - $this->displayWarning($this->l('This feature has been disabled, you can active this feature at this page:'). + $this->displayWarning($this->l('This feature has been disabled. '). ' '.$this->l('Performances').''); else if (Validate::isLoadedObject($product)) { @@ -3521,7 +3710,7 @@ class AdminProductsControllerCore extends AdminController $data->assign('reasons', $reasons = StockMvtReason::getStockMvtReasons($this->context->language->id)); $data->assign('ps_stock_mvt_reason_default', $ps_stock_mvt_reason_default = Configuration::get('PS_STOCK_MVT_REASON_DEFAULT')); $data->assign('minimal_quantity', $this->getFieldValue($product, 'minimal_quantity') ? $this->getFieldValue($product, 'minimal_quantity') : 1); - $data->assign('available_date', ($this->getFieldValue($product, 'available_date') != 0) ? stripslashes(htmlentities(Tools::displayDate($this->getFieldValue($product, 'available_date'), $this->context->language->id))) : '0000-00-00'); + $data->assign('available_date', ($this->getFieldValue($product, 'available_date') != 0) ? stripslashes(htmlentities($this->getFieldValue($product, 'available_date'), $this->context->language->id)) : '0000-00-00'); $i = 0; $data->assign('imageType', ImageType::getByNameNType('small_default', 'products')); @@ -3544,7 +3733,7 @@ class AdminProductsControllerCore extends AdminController } } else - $this->displayWarning($this->l('You must save this product in this shop before adding combinations.')); + $this->displayWarning($this->l('You must save the product in this shop before adding combinations.')); } else { @@ -3737,10 +3926,10 @@ class AdminProductsControllerCore extends AdminController } if ($advanced_stock_management_warning) { - $this->displayWarning($this->l('If you wish to use the advanced stock management, you have to:')); - $this->displayWarning('- '.$this->l('associate your products with warehouses')); - $this->displayWarning('- '.$this->l('associate your warehouses with carriers')); - $this->displayWarning('- '.$this->l('associate your warehouses with the appropriate shops')); + $this->displayWarning($this->l('If you wish to use the advanced stock management, you must:')); + $this->displayWarning('- '.$this->l('associate your products with warehouses.')); + $this->displayWarning('- '.$this->l('associate your warehouses with carriers.')); + $this->displayWarning('- '.$this->l('associate your warehouses with the appropriate shops.')); } $pack_quantity = null; @@ -3761,11 +3950,14 @@ class AdminProductsControllerCore extends AdminController } // gets the minimum - $pack_quantity = $pack_quantities[0]; - foreach ($pack_quantities as $value) - { - if ($pack_quantity > $value) - $pack_quantity = $value; + if (count($pack_quantities)) + { + $pack_quantity = $pack_quantities[0]; + foreach ($pack_quantities as $value) + { + if ($pack_quantity > $value) + $pack_quantity = $value; + } } if (!Warehouse::getPackWarehouses((int)$obj->id)) @@ -3787,7 +3979,7 @@ class AdminProductsControllerCore extends AdminController )); } else - $this->displayWarning($this->l('You must save this product in this shop before managing quantities.')); + $this->displayWarning($this->l('You must save the product in this shop before managing quantities.')); } else $this->displayWarning($this->l('You must save this product before managing quantities.')); @@ -3865,10 +4057,10 @@ class AdminProductsControllerCore extends AdminController )); } else - $this->displayWarning($this->l('You must save this product in this shop before managing suppliers')); + $this->displayWarning($this->l('You must save the product in this shop before managing suppliers.')); } else - $this->displayWarning($this->l('You must save this product before managing suppliers')); + $this->displayWarning($this->l('You must save this product before managing suppliers.')); $this->tpl_form_vars['custom_form'] = $data->fetch(); } @@ -3915,10 +4107,10 @@ class AdminProductsControllerCore extends AdminController )); } else - $this->displayWarning($this->l('You must save this product in this shop before managing warehouses')); + $this->displayWarning($this->l('You must save the product in this shop before managing warehouses.')); } else - $this->displayWarning($this->l('You must save this product before managing warehouses')); + $this->displayWarning($this->l('You must save this product before managing warehouses.')); $this->tpl_form_vars['custom_form'] = $data->fetch(); } @@ -3927,7 +4119,7 @@ class AdminProductsControllerCore extends AdminController { $data = $this->createTemplate($this->tpl_form); if (!Feature::isFeatureActive()) - $this->displayWarning($this->l('This feature has been disabled, you can active this feature at this page:').' '.$this->l('Performances').''); + $this->displayWarning($this->l('This feature has been disabled. ').' '.$this->l('Performances').''); else { if ($obj->id) @@ -3964,7 +4156,7 @@ class AdminProductsControllerCore extends AdminController $data->assign('default_form_language', $this->default_form_language); } else - $this->displayWarning($this->l('You must save this product in this shop before adding features.')); + $this->displayWarning($this->l('You must save the product in this shop before adding features.')); } else $this->displayWarning($this->l('You must save this product before adding features.')); @@ -3986,9 +4178,9 @@ class AdminProductsControllerCore extends AdminController if ((int)Tools::getValue('value') != 0 && (int)Tools::getValue('value') != 1) die (Tools::jsonEncode(array('error' => $this->l('Uncorrect value')))); if (!$product->advanced_stock_management && (int)Tools::getValue('value') == 1) - die (Tools::jsonEncode(array('error' => $this->l('Not possible if advanced stock management is not enabled')))); + die (Tools::jsonEncode(array('error' => $this->l('Not possible if advanced stock management is disabled. ')))); if ($product->advanced_stock_management && Pack::isPack($product->id)) - die (Tools::jsonEncode(array('error' => $this->l('Not possible if the product is a pack')))); + die (Tools::jsonEncode(array('error' => $this->l('Not possible if the product is a pack.')))); StockAvailable::setProductDependsOnStock($product->id, (int)Tools::getValue('value')); break; @@ -4016,9 +4208,9 @@ class AdminProductsControllerCore extends AdminController if ((int)Tools::getValue('value') != 1 && (int)Tools::getValue('value') != 0) die (Tools::jsonEncode(array('error' => $this->l('Uncorrect value')))); if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && (int)Tools::getValue('value') == 1) - die (Tools::jsonEncode(array('error' => $this->l('Not possible if advanced stock management is not enabled')))); + die (Tools::jsonEncode(array('error' => $this->l('Not possible if advanced stock management is disabled. ')))); if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && Pack::isPack($product->id)) - die (Tools::jsonEncode(array('error' => $this->l('Not possible if the product is a pack')))); + die (Tools::jsonEncode(array('error' => $this->l('Not possible if the product is a pack.')))); $product->setAdvancedStockManagement((int)Tools::getValue('value')); if (StockAvailable::dependsOnStock($product->id) == 1 && (int)Tools::getValue('value') == 0) @@ -4087,10 +4279,6 @@ class AdminProductsControllerCore extends AdminController $this->tpl_form_vars['custom_form'] = Hook::exec('displayAdminProductsExtra', array(), (int)$id_module); } - - - - /** * delete all items in pack, then check if type_product value is 2. * if yes, add the pack items from input "inputPackItems" @@ -4101,10 +4289,10 @@ class AdminProductsControllerCore extends AdminController public function updatePackItems($product) { Pack::deleteItems($product->id); - $product->setDefaultAttribute(0);//reset cache_default_attribute // lines format: QTY x ID-QTY x ID if (Tools::getValue('type_product') == Product::PTYPE_PACK) { + $product->setDefaultAttribute(0);//reset cache_default_attribute $items = Tools::getValue('inputPackItems'); $lines = array_unique(explode('-', $items)); // lines is an array of string with format : QTYxID @@ -4115,8 +4303,10 @@ class AdminProductsControllerCore extends AdminController list($qty, $item_id) = explode('x', $line); if ($qty > 0 && isset($item_id)) { - if (!Pack::addItem((int)$product->id, (int)$item_id, (int)$qty)) - $this->errors[] = Tools::displayError('An error occurred while adding products to the pack.'); + if (Pack::isPack((int)$item_id)) + $this->errors[] = Tools::displayError('You can\'t add product packs into a pack'); + elseif (!Pack::addItem((int)$product->id, (int)$item_id, (int)$qty)) + $this->errors[] = Tools::displayError('An error occurred while attempting to add products to the pack.'); } } } @@ -4130,7 +4320,7 @@ class AdminProductsControllerCore extends AdminController 'Consider changing the default category.' => $this->l('Consider changing the default category.'), 'ID' => $this->l('ID'), 'Name' => $this->l('Name'), - 'Mark all checkbox(es) of categories in which product is to appear' => $this->l('Mark all checkbox(es) of categories in which product is to appear') + 'Mark all checkbox(es) of categories in which product is to appear' => $this->l('Mark the checkbox of each categories in which this product will appear.') ); return $trad[$key]; } @@ -4140,9 +4330,9 @@ class AdminProductsControllerCore extends AdminController $content = '

        - '.$this->l('Your product will be saved as a draft').' + '.$this->l('Your product will be saved as a draft.').' - '.$this->l('Save and preview').' + '.$this->l('Save and preview.').'

        @@ -4191,7 +4381,12 @@ class AdminProductsControllerCore extends AdminController { if ($product = new Product((int)$pos[2])) if (isset($position) && $product->updatePosition($way, $position)) - echo 'ok position '.(int)$position.' for product '.(int)$pos[2].'\r\n'; + { + $category = new Category((int)$id_category); + if (Validate::isLoadedObject($category)) + hook::Exec('categoryUpdate', array('category' => $category)); + echo 'ok position '.(int)$position.' for product '.(int)$pos[2]."\r\n"; + } else echo '{"hasError" : true, "errors" : "Can not update product '.(int)$id_product.' to position '.(int)$position.' "}'; else @@ -4229,4 +4424,3 @@ class AdminProductsControllerCore extends AdminController } } } - diff --git a/controllers/admin/AdminProfilesController.php b/controllers/admin/AdminProfilesController.php index d6e1a4cd7..ac848d342 100644 --- a/controllers/admin/AdminProfilesController.php +++ b/controllers/admin/AdminProfilesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -92,7 +92,7 @@ class AdminProfilesControllerCore extends AdminController /* PrestaShop demo mode*/ if (isset($_GET['delete'.$this->table]) && $_GET[$this->identifier] == (int)(_PS_ADMIN_PROFILE_)) - $this->errors[] = $this->l('For security reasons, you cannot delete the Administrator profile'); + $this->errors[] = $this->l('For security reasons, you cannot delete the Administrator\'s profile.'); else parent::postProcess(); } diff --git a/controllers/admin/AdminQuickAccessesController.php b/controllers/admin/AdminQuickAccessesController.php index 3697c186b..e4cc3a8db 100644 --- a/controllers/admin/AdminQuickAccessesController.php +++ b/controllers/admin/AdminQuickAccessesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -88,7 +88,7 @@ class AdminQuickAccessesControllerCore extends AdminController 'size' => 60, 'maxlength' => 128, 'required' => true, - 'desc' => $this->l('If it\'s an URL that comes from your Back Office, you must NOT put a security token.') + 'desc' => $this->l('If it\'s a URL that comes from your Back Office, you must NOT use a security token.') ), array( 'type' => 'radio', diff --git a/controllers/admin/AdminRangePriceController.php b/controllers/admin/AdminRangePriceController.php index 614033b7b..f0baa613c 100644 --- a/controllers/admin/AdminRangePriceController.php +++ b/controllers/admin/AdminRangePriceController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -84,7 +84,7 @@ class AdminRangePriceControllerCore extends AdminController 'size' => 5, 'required' => true, 'suffix' => $currency->getSign('right').' '.$this->l('(Tax Incl.)'), - 'desc' => $this->l('Range start (included)'), + 'desc' => $this->l('Start range (included)'), 'string_format' => '%.2f' ), array( @@ -94,7 +94,7 @@ class AdminRangePriceControllerCore extends AdminController 'size' => 5, 'required' => true, 'suffix' => $currency->getSign('right').' '.$this->l('(Tax Incl.)'), - 'desc' => $this->l('Range end (excluded)'), + 'desc' => $this->l('End range (excluded)'), 'string_format' => '%.2f' ), ), @@ -124,9 +124,9 @@ class AdminRangePriceControllerCore extends AdminController if (Tools::getValue('delimiter1') >= Tools::getValue('delimiter2')) $this->errors[] = Tools::displayError('Invalid range'); else if (!$id && RangePrice::rangeExist((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'))) - $this->errors[] = Tools::displayError('Range already exists'); + $this->errors[] = Tools::displayError('The range already exists'); else if (RangePrice::isOverlapping((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'), ($id ? (int)$id : null))) - $this->errors[] = Tools::displayError('Ranges are overlapping'); + $this->errors[] = Tools::displayError('Error: Ranges are overlapping'); else if (!count($this->errors)) parent::postProcess(); } diff --git a/controllers/admin/AdminRangeWeightController.php b/controllers/admin/AdminRangeWeightController.php index 5d94514f4..25f1ca895 100644 --- a/controllers/admin/AdminRangeWeightController.php +++ b/controllers/admin/AdminRangeWeightController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -82,7 +82,7 @@ class AdminRangeWeightControllerCore extends AdminController 'size' => 5, 'required' => true, 'suffix' => Configuration::get('PS_WEIGHT_UNIT'), - 'desc' => $this->l('Range start (included)'), + 'desc' => $this->l('Start range (included)'), ), array( 'type' => 'text', @@ -91,7 +91,7 @@ class AdminRangeWeightControllerCore extends AdminController 'size' => 5, 'required' => true, 'suffix' => Configuration::get('PS_WEIGHT_UNIT'), - 'desc' => $this->l('Range end (excluded)'), + 'desc' => $this->l('End range (excluded)'), ), ), 'submit' => array( @@ -121,9 +121,9 @@ class AdminRangeWeightControllerCore extends AdminController if (Tools::getValue('delimiter1') >= Tools::getValue('delimiter2')) $this->errors[] = Tools::displayError('Invalid range'); else if (!$id && RangeWeight::rangeExist((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'))) - $this->errors[] = Tools::displayError('Range already exists'); + $this->errors[] = Tools::displayError('The range already exists'); else if (RangeWeight::isOverlapping((int)Tools::getValue('id_carrier'), (float)Tools::getValue('delimiter1'), (float)Tools::getValue('delimiter2'), ($id ? (int)$id : null))) - $this->errors[] = Tools::displayError('Ranges are overlapping'); + $this->errors[] = Tools::displayError('Error: Ranges are overlapping'); else if (!count($this->errors)) parent::postProcess(); } diff --git a/controllers/admin/AdminReferrersController.php b/controllers/admin/AdminReferrersController.php index 0abcd5489..fcf6c2e07 100644 --- a/controllers/admin/AdminReferrersController.php +++ b/controllers/admin/AdminReferrersController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -204,7 +204,7 @@ class AdminReferrersControllerCore extends AdminController ) ), 'desc' => array( - $this->l('Affiliates can access their own data with this name and password.'), + $this->l('Affiliates can access their data with this name and password.'), $this->l('Front access:').' '.$uri.'modules/trackingfront/stats.php' ) )); @@ -250,7 +250,7 @@ class AdminReferrersControllerCore extends AdminController $this->fields_form[2] = array('form' => array( 'legend' => array( - 'title' => $this->l('Technical information - Simple mode'), + 'title' => $this->l('Technical information -- Simple mode.'), 'image' => '../img/admin/affiliation.png' ), 'help' => true, @@ -296,7 +296,7 @@ class AdminReferrersControllerCore extends AdminController $this->fields_form[3] = array('form' => array( 'legend' => array( - 'title' => $this->l('Technical information - Expert mode'), + 'title' => $this->l('Technical information -- Expert mode'), 'image' => '../img/admin/affiliation.png' ), 'input' => array( diff --git a/controllers/admin/AdminRequestSqlController.php b/controllers/admin/AdminRequestSqlController.php index 2053fd9dd..317d280b2 100644 --- a/controllers/admin/AdminRequestSqlController.php +++ b/controllers/admin/AdminRequestSqlController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -104,14 +104,14 @@ class AdminRequestSqlControllerCore extends AdminController $this->display = null; $this->initToolbar(); - $this->displayWarning($this->l('When saving the query, only the request type "SELECT" are allowed.')); + $this->displayWarning($this->l('When saving the query, only the request type "SELECT" is allowed.')); $this->displayInformation(' - '.$this->l('How to create a new sql query?').'
        + '.$this->l('How do I create a new sql query?').'
          -
        • '.$this->l('Click "Add new".').'
        • +
        • '.$this->l('Click "Add New".').'
        • '.$this->l('Fill in the fields and click "Save".').'
        • '.$this->l('You can then view the query results by clicking on the tab:').'
        • -
        • '.$this->l('You can then export the query results as CSV file by clicking on the tab:').'
        • +
        • '.$this->l('You can also export the query results as CSV file by clicking on the tab:').'
        '); $this->addRowAction('export'); @@ -323,7 +323,7 @@ class AdminRequestSqlControllerCore extends AdminController if (file_exists(_PS_ADMIN_DIR_.'/export/'.$file)) { $filesize = filesize(_PS_ADMIN_DIR_.'/export/'.$file); - $upload_max_filesize = $this->returnBytes(ini_get('upload_max_filesize')); + $upload_max_filesize = Tools::convertBytes(ini_get('upload_max_filesize')); if ($filesize < $upload_max_filesize) { if (Configuration::get('PS_ENCODING_FILE_MANAGER_SQL')) @@ -345,28 +345,6 @@ class AdminRequestSqlControllerCore extends AdminController } } - /** - * Get number of bytes - * - * @param $val - * @return int|string - */ - public function returnBytes($val) - { - $val = trim($val); - $last = strtolower($val[strlen($val) - 1]); - switch ($last) - { - case 'g': - $val *= 1024; - case 'm': - $val *= 1024; - case 'k': - $val *= 1024; - } - return $val; - } - /** * Display all errors * @@ -408,7 +386,7 @@ class AdminRequestSqlControllerCore extends AdminController case 'checkedWhere': if (isset($e[$key]['operator'])) - $this->errors[] = sprintf(Tools::displayError('The operator "%s" used is incorrect.'), $e[$key]['operator']); + $this->errors[] = sprintf(Tools::displayError('The operator "%s" is incorrect.'), $e[$key]['operator']); else if (isset($e[$key]['attribut'])) $this->errors[] = sprintf( Tools::displayError('The attribute "%1$s" does not exist in the table: %2$s.'), @@ -421,7 +399,7 @@ class AdminRequestSqlControllerCore extends AdminController case 'checkedHaving': if (isset($e[$key]['operator'])) - $this->errors[] = sprintf(Tools::displayError('The operator "%s" used is incorrect.'), $e[$key]['operator']); + $this->errors[] = sprintf(Tools::displayError('The operator "%s" is incorrect.'), $e[$key]['operator']); else if (isset($e[$key]['attribut'])) $this->errors[] = sprintf( Tools::displayError('The attribute "%1$s" does not exist in the table: %2$s.'), @@ -466,7 +444,7 @@ class AdminRequestSqlControllerCore extends AdminController $e[$key]['attribut'][1] ); else - $this->errors[] = Tools::displayError('When multiple tables are used, each attribute must refer to a table.'); + $this->errors[] = Tools::displayError('When multiple tables are used, each attribute must refer back to a table.'); break; case 'testedRequired': @@ -474,7 +452,7 @@ class AdminRequestSqlControllerCore extends AdminController break; case 'testedUnauthorized': - $this->errors[] = sprintf(Tools::displayError('is an unauthorized keyword.'), $e[$key]); + $this->errors[] = sprintf(Tools::displayError('Is an unauthorized keyword.'), $e[$key]); break; } } diff --git a/controllers/admin/AdminReturnController.php b/controllers/admin/AdminReturnController.php index 4910ad358..39866ea4b 100644 --- a/controllers/admin/AdminReturnController.php +++ b/controllers/admin/AdminReturnController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -46,8 +46,8 @@ class AdminReturnControllerCore extends AdminController 'general' => array( 'title' => $this->l('Merchandise return (RMA) options'), 'fields' => array( - 'PS_ORDER_RETURN' => array('title' => $this->l('Enable returns:'), 'desc' => $this->l('Select whether or not to activate merchandise returns for your shop'), 'cast' => 'intval', 'type' => 'bool'), - 'PS_ORDER_RETURN_NB_DAYS' => array('title' => $this->l('Time limit of validity:'), 'desc' => $this->l('Number of days the customer can make a return after the delivery date'), 'cast' => 'intval', 'type' => 'text', 'size' => '2'), + 'PS_ORDER_RETURN' => array('title' => $this->l('Enable returns:'), 'desc' => $this->l('Would you like to allow merchandise returns in your shop?'), 'cast' => 'intval', 'type' => 'bool'), + 'PS_ORDER_RETURN_NB_DAYS' => array('title' => $this->l('Time limit of validity:'), 'desc' => $this->l('How many days after the delivery date does the customer have to return a product?'), 'cast' => 'intval', 'type' => 'text', 'size' => '2'), ), 'submit' => array() ), @@ -95,7 +95,7 @@ class AdminReturnControllerCore extends AdminController ), array( 'type' => 'select', - 'label' => $this->l('Status:'), + 'label' => $this->l('Status'), 'name' => 'state', 'required' => false, 'options' => array( @@ -107,7 +107,7 @@ class AdminReturnControllerCore extends AdminController ), array( 'type' => 'list_products', - 'label' => $this->l('Products:'), + 'label' => $this->l('Products'), 'name' => '', 'size' => '', 'required' => false, @@ -136,7 +136,7 @@ class AdminReturnControllerCore extends AdminController $this->tpl_form_vars = array( 'customer' => new Customer($this->object->id_customer), 'url_customer' => 'index.php?tab=AdminCustomers&id_customer='.(int)$this->object->id_customer.'&viewcustomer&token='.Tools::getAdminToken('AdminCustomers'.(int)(Tab::getIdFromClassName('AdminCustomers')).(int)$this->context->employee->id), - 'text_order' => sprintf($this->l('Order #%1$d from %2$s'), $order->id, Tools::displayDate($order->date_upd, $order->id_lang)), + 'text_order' => sprintf($this->l('Order #%1$d from %2$s'), $order->id, Tools::displayDate($order->date_upd)), 'url_order' => 'index.php?tab=AdminOrders&id_order='.(int)$order->id.'&vieworder&token='.Tools::getAdminToken('AdminOrders'.(int)Tab::getIdFromClassName('AdminOrders').(int)$this->context->employee->id), 'picture_folder' => _THEME_PROD_PIC_DIR_, 'type_file' => Product::CUSTOMIZE_FILE, @@ -184,7 +184,7 @@ class AdminReturnControllerCore extends AdminController if (OrderReturn::deleteOrderReturnDetail($id_order_return, $id_order_detail, (int)(Tools::getValue('id_customization', 0)))) Tools::redirectAdmin(self::$currentIndex.'&conf=4token='.$this->token); else - $this->errors[] = Tools::displayError('An error occurred while deleting details of your order return.'); + $this->errors[] = Tools::displayError('An error occurred while deleting the details of your order return.'); } else $this->errors[] = Tools::displayError('You need at least one product.'); @@ -196,7 +196,7 @@ class AdminReturnControllerCore extends AdminController $this->errors[] = Tools::displayError('The order return content is invalid.'); } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } elseif (Tools::isSubmit('submitAddorder_return') || Tools::isSubmit('submitAddorder_returnAndStay')) { @@ -227,10 +227,10 @@ class AdminReturnControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('No order return ID.'); + $this->errors[] = Tools::displayError('No order return ID has been specified.'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } parent::postProcess(); } diff --git a/controllers/admin/AdminScenesController.php b/controllers/admin/AdminScenesController.php index 13a04a315..346a5543b 100644 --- a/controllers/admin/AdminScenesController.php +++ b/controllers/admin/AdminScenesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -75,16 +75,15 @@ class AdminScenesControllerCore extends AdminController $images_types = ImageType::getImagesTypes('scenes'); foreach ($images_types as $k => $image_type) - { - if ($image_type['name'] == 'scene_default' && isset($_FILES['image'])) + { + if ($image_type['name'] == 'scene_default' AND isset($_FILES['image']) AND isset($_FILES['image']['tmp_name']) AND !$_FILES['image']['error']) ImageManager::resize( $base_img_path, _PS_SCENE_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).'.jpg', (int)$image_type['width'], - (int)$image_type['height'] - ); + (int)$image_type['height']); else if ($image_type['name'] == 'm_scene_default') - { + { if (isset($_FILES['thumb']) && !$_FILES['thumb']['error']) $base_thumb_path = _PS_SCENE_THUMB_IMG_DIR_.$obj->id.'.jpg'; else @@ -93,8 +92,7 @@ class AdminScenesControllerCore extends AdminController $base_thumb_path, _PS_SCENE_THUMB_IMG_DIR_.$obj->id.'-'.stripslashes($image_type['name']).'.jpg', (int)$image_type['width'], - (int)$image_type['height'] - ); + (int)$image_type['height']); } } } @@ -153,13 +151,13 @@ class AdminScenesControllerCore extends AdminController 'type' => 'description', 'name' => 'description', 'label' => $this->l('How to map products in the image:'), - 'text' => $this->l('When a customer hovers over the image with the mouse, a pop-up appears displaying a brief description of the product.'). - $this->l('The customer can then click to open the product\'s full product page.'). + 'text' => $this->l('When a customer hovers over the image, a pop-up appears displaying a brief description of the product.'). + $this->l('The customer can then click to open the full product page.'). $this->l('To achieve this, please define the \'mapping zone\' that, when hovered over, will display the pop-up.'). - $this->l('Left-click with your mouse to draw the four-sided mapping zone, then release.'). - $this->l('Then, begin typing the name of the associated product. A list of products appears.'). - $this->l('Click the appropriate product, then click OK. Repeat these steps for each mapping zone you wish to create.'). - $this->l('When you have finished mapping zones, click Save Image Map.') + $this->l('Left click with your mouse to draw the four-sided mapping zone, then release.'). + $this->l('Then begin typing the name of the associated product, and a list of products will appear.'). + $this->l('Click the appropriate product and then click OK. Repeat these steps for each mapping zone you wish to create.'). + $this->l('When you have finished mapping zones, click "Save Image Map."') ), array( 'type' => 'text', @@ -196,40 +194,40 @@ class AdminScenesControllerCore extends AdminController $image_to_map_desc = ''; $image_to_map_desc .= $this->l('Format:').' JPG, GIF, PNG. '.$this->l('File size:').' ' - .(Tools::getMaxUploadSize() / 1024).''.$this->l('kB max.').' ' - .sprintf($this->l('If larger than the image size setting, the image will be reduced to %1$d x %2$dpx (width x height).'), + .(Tools::getMaxUploadSize() / 1024).''.$this->l('Kb max.').' ' + .sprintf($this->l('If an image is too large, it will be reduced to %1$d x %2$dpx (width x height).'), $large_scene_image_type['width'], $large_scene_image_type['height']) - .$this->l('If smaller than the image size setting, a white background will be added in order to achieve the correct image size.').'
        '. + .$this->l('If an image is deemed too small, a white background will be added in order to achieve the correct image size.').'
        '. $this->l('Note: To change image dimensions, please change the \'large_scene\' image type settings to the desired size (in Back Office > Preferences > Images).'); if ($obj->id && file_exists(_PS_SCENE_IMG_DIR_.$obj->id.'-scene_default.jpg')) { $this->addJqueryPlugin('autocomplete'); $this->addJqueryPlugin('imgareaselect'); $this->addJs(_PS_JS_DIR_.'admin-scene-cropping.js' ); - $image_to_map_desc .= '

        '; + $image_to_map_desc .= '

        '; $image_to_map_desc .= ' '; - if ($obj->id && file_exists(_PS_SCENE_IMG_DIR_.'thumbs/'.$obj->id.'-thumb_scene.jpg')) + if ($obj->id && file_exists(_PS_SCENE_IMG_DIR_.'thumbs/'.$obj->id.'-m_scene_default.jpg')) $image_to_map_desc .= '
        - +
        '; $img_alt_desc = ''; $img_alt_desc .= $this->l('If you want to use a thumbnail other than one generated from simply reducing the mapped image, please upload it here.') .'
        '.$this->l('Format:').' JPG, GIF, PNG. ' - .$this->l('Filesize:').' '.(Tools::getMaxUploadSize() / 1024).''.$this->l('kB max.').' ' + .$this->l('File size:').' '.(Tools::getMaxUploadSize() / 1024).''.$this->l('Kb max.').' ' .sprintf($this->l('Automatically resized to %1$d x %2$dpx (width x height).'), $thumb_scene_image_type['width'], $thumb_scene_image_type['height']).'.
        ' - .$this->l('Note: To change image dimensions, please change the \'thumb_scene\' image type settings to the desired size (in Back Office > Preferences > Images).'); + .$this->l('Note: To change image dimensions, please change the \'m_scene_default\' image type settings to the desired size (in Back Office > Preferences > Images).'); $input_img_alt = array( 'type' => 'file', @@ -247,15 +245,15 @@ class AdminScenesControllerCore extends AdminController $selected_cat[] = $row['id_category']; $root_category = Category::getRootCategory(); - if (!$root_category->id_category) + if (!$root_category->id) { - $root_category->id_category = 0; + $root_category->id = 0; $root_category->name = $this->l('Root'); } - $root_category = array('id_category' => $root_category->id_category, 'name' => $root_category->name); + $root_category = array('id_category' => (int)$root_category->id, 'name' => $root_category->name); $trads = array( 'Root' => $root_category, - 'selected' => $this->l('selected'), + 'selected' => $this->l('Selected'), 'Check all' => $this->l('Check all'), 'Check All' => $this->l('Check All'), 'Uncheck All' => $this->l('Uncheck All'), @@ -266,7 +264,7 @@ class AdminScenesControllerCore extends AdminController ); $this->fields_form['input'][] = array( 'type' => 'categories', - 'label' => $this->l('Categories:'), + 'label' => $this->l('Categories'), 'name' => 'categories', 'values' => array('trads' => $trads, 'selected_cat' => $selected_cat, @@ -308,11 +306,18 @@ class AdminScenesControllerCore extends AdminController if (Tools::isSubmit('save_image_map')) { if (!Tools::isSubmit('categories') || !count(Tools::getValue('categories'))) - $this->errors[] = Tools::displayError('You should select at least one category'); + $this->errors[] = Tools::displayError('You should select at least one category.'); if (!Tools::isSubmit('zones') || !count(Tools::getValue('zones'))) - $this->errors[] = Tools::displayError('You should make at least one zone'); + $this->errors[] = Tools::displayError('You should create at least one zone.'); + } + + if (Tools::isSubmit('delete'.$this->table)) + { + if (Validate::isLoadedObject($object = $this->loadObject())) + $object->deleteImage(false); + else + return false; } - parent::postProcess(); } } diff --git a/controllers/admin/AdminSearchConfController.php b/controllers/admin/AdminSearchConfController.php index a9b5aada1..fa63f3b4c 100644 --- a/controllers/admin/AdminSearchConfController.php +++ b/controllers/admin/AdminSearchConfController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -63,15 +63,15 @@ class AdminSearchConfControllerCore extends AdminController 'title' => $this->l('Indexation'), 'icon' => 'search', 'info' => - $this->l('The "indexed" products have been analyzed by PrestaShop and will appear in the results of the Front Office search.').'
        - '.$this->l('Indexed products:').' '.(int)$indexed.' / '.(int)$total.'. + $this->l('The "indexed" products have been analyzed by PrestaShop and will appear in the results of a Front Office search.').'
        + '.$this->l('Indexed products').' '.(int)$indexed.' / '.(int)$total.'.

        -

        '.$this->l('Building the product index can take a few minutes or more.') - .$this->l('If your server stops the process before it ends, you can resume the indexation by clicking "Add missing products."').'

        +

        '.$this->l('Building the product index may take a few minutes.') + .$this->l('If your server stops before the process ends, you can resume the indexation by clicking "Add missing products."').'

        -> '. - $this->l('Add missing products to index.').'
        + $this->l('Add missing products to the index.').'
        -> '. - $this->l('Re-build entire index.').'

        + $this->l('Re-build the entire index.').'

        '.$this->l('You can set a cron job that will rebuild your index using the following URL:').' '.$cron_url.'', 'fields' => array( 'PS_SEARCH_INDEXATION' => array( @@ -79,7 +79,7 @@ class AdminSearchConfControllerCore extends AdminController 'validation' => 'isBool', 'type' => 'bool', 'cast' => 'intval', - 'desc' => $this->l('Enable automatic indexation of the products. If you enable this feature, the products will be indexed in the search automatically when they are saved, but if the feature is disabled, you will have to index the products manually by using the links provided in this fieldset.') + 'desc' => $this->l('Enable the automatic indexation of products. If you enable this feature, the products will be indexed in the search automatically when they are saved. If the feature is disabled, you will have to index products manually by using the links provided in the field set.') ) ) ), @@ -99,7 +99,7 @@ class AdminSearchConfControllerCore extends AdminController 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', - 'desc' => $this->l('Enable instant search for your visitors.').'
        '. + 'desc' => $this->l('Enable instant search for your visitors?').'
        '. $this->l('With instant search, the results will appear immediately as the user writes a query.')), 'PS_SEARCH_MINWORDLEN' => array( 'title' => $this->l('Minimum word length (in characters)'), @@ -113,7 +113,7 @@ class AdminSearchConfControllerCore extends AdminController 'title' => $this->l('Blacklisted words'), 'size' => 35, 'validation' => 'isGenericName', - 'desc' => $this->l('Please enter the words separated by a "|".'), + 'desc' => $this->l('Please enter the index words separated by a "|".'), 'type' => 'textLang' ) ), @@ -123,9 +123,9 @@ class AdminSearchConfControllerCore extends AdminController 'title' => $this->l('Weight'), 'icon' => 'weight', 'info' => - $this->l('The "weight" represents its importance and relevance for the ranking of the products when try a new search.').'
        - '.$this->l('A word with a weight of 8 will have 4 times more value than a word with a weight of 2.').'

        - '.$this->l('That\'s why we advise to set a greater weight for words which appear in the name or reference of a product than the ones in the description. Thus, the search results will be as precise and relevant as possible.'), + $this->l('The "weight" represents its importance and relevance for the ranking of the products when completing a new search.').'
        + '.$this->l('A word with a weight of eight will have four times more value than a word with a weight of two.').'

        + '.$this->l('We advise you to set a greater weight for words which appear in the name or reference of a product. This will allow the search results to be as precise and relevant as possible.'), 'fields' => array( 'PS_SEARCH_WEIGHT_PNAME' => array( 'title' => $this->l('Product name weight'), @@ -240,7 +240,7 @@ class AdminSearchConfControllerCore extends AdminController 'size' => 40, 'required' => true, 'desc' => array( - $this->l('Enter each alias separated by a comma (\',\') (e.g. \'prestshop,preztashop,prestasohp\')'), + $this->l('Enter each alias separated by a comma (e.g. \'prestshop,preztashop,prestasohp\')'), $this->l('Forbidden characters: <>;=#{}') ) ), @@ -270,12 +270,12 @@ class AdminSearchConfControllerCore extends AdminController $string = strval(Tools::getValue('alias')); $aliases = explode(',', $string); if (empty($search) || empty($string)) - $this->errors[] = $this->l('aliases and result are both required'); + $this->errors[] = $this->l('Aliases and results are both required.'); if (!Validate::isValidSearch($search)) - $this->errors[] = $search.' '.$this->l('is not a valid result'); + $this->errors[] = $search.' '.$this->l('Is not a valid result'); foreach ($aliases as $alias) if (!Validate::isValidSearch($alias)) - $this->errors[] = $alias.' '.$this->l('is not a valid alias'); + $this->errors[] = $alias.' '.$this->l('Is not a valid alias'); if (!count($this->errors)) { diff --git a/controllers/admin/AdminSearchController.php b/controllers/admin/AdminSearchController.php index dc3a1b2a0..03a993ccc 100644 --- a/controllers/admin/AdminSearchController.php +++ b/controllers/admin/AdminSearchController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,7 +34,7 @@ class AdminSearchControllerCore extends AdminController /* Handle empty search field */ if (empty($this->query)) { - $this->errors[] = Tools::displayError('Please fill in search form first.'); + $this->errors[] = Tools::displayError('Please complete the search form first.'); return; } else @@ -111,7 +111,7 @@ class AdminSearchControllerCore extends AdminController } } elseif ($searchType == 3) - $this->errors[] = Tools::displayError('No order found with this ID:').' '.Tools::htmlentitiesUTF8($this->query); + $this->errors[] = Tools::displayError('No order was found with this ID:').' '.Tools::htmlentitiesUTF8($this->query); } } @@ -120,7 +120,7 @@ class AdminSearchControllerCore extends AdminController { if ((int)$this->query && Validate::isUnsignedInt((int)$this->query) && ($invoice = Order::getInvoice((int)$this->query))) Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateInvoicePDF&id_order='.(int)($invoice['id_order'])); - $this->errors[] = Tools::displayError('No invoice found with this ID:').' '.Tools::htmlentitiesUTF8($this->query); + $this->errors[] = Tools::displayError('No invoice was found with this ID:').' '.Tools::htmlentitiesUTF8($this->query); } /* Cart */ @@ -128,7 +128,7 @@ class AdminSearchControllerCore extends AdminController { if ((int)$this->query && Validate::isUnsignedInt((int)$this->query) && ($cart = new Cart($this->query)) && Validate::isLoadedObject($cart)) Tools::redirectAdmin('index.php?tab=AdminCarts&id_cart='.(int)($cart->id).'&viewcart'.'&token='.Tools::getAdminToken('AdminCarts'.(int)(Tab::getIdFromClassName('AdminCarts')).(int)$this->context->employee->id)); - $this->errors[] = Tools::displayError('No cart found with this ID:').' '.Tools::htmlentitiesUTF8($this->query); + $this->errors[] = Tools::displayError('No cart was found with this ID:').' '.Tools::htmlentitiesUTF8($this->query); } /* IP */ // 6 - but it is included in the customer block @@ -152,7 +152,7 @@ class AdminSearchControllerCore extends AdminController { if (!ip2long(trim($this->query))) { - $this->errors[] = Tools::displayError('It seems that this is not an IP address:').' '.Tools::htmlentitiesUTF8($this->query); + $this->errors[] = Tools::displayError('This is not a valid IP address:').' '.Tools::htmlentitiesUTF8($this->query); return; } $this->_list['customers'] = Customer::searchByIp($this->query); @@ -185,7 +185,7 @@ class AdminSearchControllerCore extends AdminController $this->_list['modules'] = array(); $all_modules = Module::getModulesOnDisk(true, true, Context::getContext()->employee->id); foreach ($all_modules as $module) - if (stripos($module->name, $this->query) || stripos($module->displayName, $this->query) || stripos($module->description, $this->query)) + if (stripos($module->name, $this->query) !== false || stripos($module->displayName, $this->query) !== false || stripos($module->description, $this->query) !== false) { $module->linkto = 'index.php?tab=AdminModules&tab_module='.$module->tab.'&module_name='.$module->name.'&anchor=anchor'.ucfirst($module->name).'&token='.Tools::getAdminTokenLite('AdminModules'); $this->_list['modules'][] = $module; @@ -202,7 +202,11 @@ class AdminSearchControllerCore extends AdminController global $_LANGADM; $tabs = array(); $key_match = array(); - $result = Db::getInstance()->executeS('SELECT class_name, name FROM '._DB_PREFIX_.'tab t INNER JOIN '._DB_PREFIX_.'tab_lang tl ON t.id_tab = tl.id_tab AND tl.id_lang = '.(int)$this->context->language->id); + $result = Db::getInstance()->executeS(' + SELECT class_name, name + FROM '._DB_PREFIX_.'tab t + INNER JOIN '._DB_PREFIX_.'tab_lang tl ON (t.id_tab = tl.id_tab AND tl.id_lang = '.(int)$this->context->language->id.') + WHERE active = 1'); foreach ($result as $row) { $tabs[strtolower($row['class_name'])] = $row['name']; @@ -265,7 +269,7 @@ class AdminSearchControllerCore extends AdminController 'id_gender' => array('title' => $this->l('Titles'), 'align' => 'center', 'icon' => $genders_icon, 'list' => $genders, 'width' => 25), 'firstname' => array('title' => $this->l('First Name'), 'align' => 'left', 'width' => 150), 'lastname' => array('title' => $this->l('Name'), 'align' => 'left', 'width' => 'auto'), - 'email' => array('title' => $this->l('E-mail address'), 'align' => 'left', 'width' => 250), + 'email' => array('title' => $this->l('Email address'), 'align' => 'left', 'width' => 250), 'birthday' => array('title' => $this->l('Birth date'), 'align' => 'center', 'type' => 'date', 'width' => 75), 'date_add' => array('title' => $this->l('Registration date'), 'align' => 'center', 'type' => 'date', 'width' => 75), 'orders' => array('title' => $this->l('Orders'), 'align' => 'center', 'width' => 50), diff --git a/controllers/admin/AdminSearchEnginesController.php b/controllers/admin/AdminSearchEnginesController.php index bee6d3a29..071d7acb4 100644 --- a/controllers/admin/AdminSearchEnginesController.php +++ b/controllers/admin/AdminSearchEnginesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/controllers/admin/AdminShippingController.php b/controllers/admin/AdminShippingController.php index f7dfcb7b4..58a48a4ce 100644 --- a/controllers/admin/AdminShippingController.php +++ b/controllers/admin/AdminShippingController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -64,79 +64,15 @@ class AdminShippingControllerCore extends AdminController ), 'description' => '
          -
        • '.$this->l('If you set these parameters to 0, they will be disabled').'
        • +
        • '.$this->l('If you set these parameters to 0, they will be disabled.').'
        • '.$this->l('Coupons are not taken into account when calculating free shipping').'
        ', 'submit' => array() - ), - 'billing' => array( - 'title' => $this->l('Billing'), - 'icon' => 'money', - 'fields' => array( - 'PS_SHIPPING_METHOD' => array( - 'title' => $this->l('Billing'), - 'cast' => 'intval', - 'type' => 'radio', - 'choices' => array( - 0 => $this->l('According to total price'), - 1 => $this->l('According to total weight') - ), - 'validation' => 'isBool' - ), - ) - ), + ) ); } - public function initContent() - { - $array_carrier = array(); - $carriers = Carrier::getCarriers($this->context->language->id, true, false, false, null, Carrier::PS_CARRIERS_AND_CARRIER_MODULES_NEED_RANGE); - foreach ($carriers as $key => $carrier) - if ($carrier['is_free']) - unset($carriers[$key]); - else - $array_carrier[] = $carrier['id_carrier']; - $id_carrier = Tools::getValue('id_carrier'); - - if (count($carriers) && isset($array_carrier[0])) - { - if (!$id_carrier) - $id_carrier = (int)$array_carrier[0]; - - $carrierSelected = new Carrier((int)$id_carrier); - } - else - $carrierSelected = new Carrier((int)$id_carrier); - - $currency = $this->context->currency; - $rangeObj = $carrierSelected->getRangeObject(); - $rangeTable = $carrierSelected->getRangeTable(); - $suffix = $carrierSelected->getRangeSuffix(); - - $rangeIdentifier = 'id_'.$rangeTable; - $ranges = $rangeObj->getRanges($id_carrier); - $delivery = Carrier::getDeliveryPriceByRanges($rangeTable, $id_carrier); - $deliveryArray = array(); - foreach ($delivery as $deliv) - $deliveryArray[$deliv['id_zone']][$deliv['id_carrier']][$deliv[$rangeIdentifier]] = $deliv['price']; - - $this->context->smarty->assign(array( - 'zones' => $carrierSelected->getZones(), - 'carriers' => $carriers, - 'ranges' => $ranges, - 'currency' => $currency, - 'deliveryArray' => $deliveryArray, - 'carrierSelected' => $carrierSelected, - 'id_carrier' => $id_carrier, - 'suffix' => $suffix, - 'rangeIdentifier' => $rangeIdentifier, - 'action_fees' => self::$currentIndex.'&token='.$this->token - )); - - parent::initContent(); - } public function postProcess() { @@ -185,15 +121,15 @@ class AdminShippingControllerCore extends AdminController Tools::redirectAdmin(self::$currentIndex.'&conf=6&id_carrier='.$carrier->id.'&token='.$this->token); } else - $this->errors[] = Tools::displayError('An error occurred while updating fees (cannot load carrier object).'); + $this->errors[] = Tools::displayError('An error occurred while attempting to update fees (cannot load carrier object).'); } elseif (isset($id_carrier2)) $_POST['id_carrier'] = $id_carrier2; else - $this->errors[] = Tools::displayError('An error occurred while updating fees (cannot load carrier object).'); + $this->errors[] = Tools::displayError('An error occurred while attempting to update fees (cannot load carrier object).'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else return parent::postProcess(); diff --git a/controllers/admin/AdminShopController.php b/controllers/admin/AdminShopController.php index 02ab4ed3c..74f74010d 100755 --- a/controllers/admin/AdminShopController.php +++ b/controllers/admin/AdminShopController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -58,7 +58,7 @@ class AdminShopControllerCore extends AdminController 'filter_key' => 'cl!name' ), 'url' => array( - 'title' => $this->l('Shop main URL'), + 'title' => $this->l('The shop\'s main URL'), 'havingFilter' => 'url', ), /*'active' => array( @@ -196,7 +196,7 @@ class AdminShopControllerCore extends AdminController { $root_category = new Category((int)Tools::getValue('id_category')); $root_category = array( - 'id_category' => $root_category->id_category, + 'id_category' => $root_category->id, 'name' => $root_category->name[$this->context->language->id] ); $selected_cat = array($root_category['id_category']); @@ -226,14 +226,9 @@ class AdminShopControllerCore extends AdminController if (Tools::isSubmit('submitAddshopAndStay') || Tools::isSubmit('submitAddshop')) { - $same_name = Db::getInstance()->getValue(' - SELECT id_shop - FROM '._DB_PREFIX_.'shop - WHERE name = "'.pSQL(Tools::getValue('name')).'" - AND id_shop_group = '.(int)Tools::getValue('id_shop_group').' - '.(Tools::getValue('id_shop') ? 'AND id_shop != '.(int)Tools::getValue('id_shop') : '')); - if ($same_name) - $this->errors[] = Tools::displayError('You cannot have 2 shops with the same name in the same group'); + $shop_group = new ShopGroup((int)Tools::getValue('id_shop_group')); + if ($shop_group->shopNameExists(Tools::getValue('name'), (int)Tools::getValue('id_shop'))) + $this->errors[] = Tools::displayError('You cannot have two shops with the same name in the same group.'); } if (count($this->errors)) @@ -258,16 +253,17 @@ class AdminShopControllerCore extends AdminController return $result; } else - $this->errors[] = Tools::displayError('You can\'t delete this shop (customer and/or order dependency)'); + $this->errors[] = Tools::displayError('You can\'t delete this shop (customer and/or order dependency).'); return false; } protected function afterAdd($new_shop) { - $import_data = Tools::getValue('importData'); - if (Tools::getValue('useImportData') && is_array($import_data)) - $new_shop->copyShopData((int)Tools::getValue('importFromShop'), $import_data); + $import_data = Tools::getValue('importData', array()); + + // The root category should be at least imported + $new_shop->copyShopData((int)Tools::getValue('importFromShop'), $import_data); // copy default data if (!Tools::getValue('useImportData') || (is_array($import_data) && !isset($import_data['group']))) @@ -323,8 +319,8 @@ class AdminShopControllerCore extends AdminController array( 'type' => 'text', 'label' => $this->l('Shop name:'), - 'desc' => $this->l('This field do not refer to the shop name visible on the front office.').' '. - sprintf($this->l('Follow %sthis link%s to edit the shop name used on the front office.'), '', ''), + 'desc' => $this->l('This field does not refer to the shop name visible in the front office.').' '. + sprintf($this->l('Follow %sthis link%s to edit the shop name used on the Front Office.'), '', ''), 'name' => 'name', 'required' => true, ) @@ -354,9 +350,9 @@ class AdminShopControllerCore extends AdminController } if ($this->display == 'add') - $group_desc = $this->l('Warning: you won\'t be able to change the group of this shop if this shop belongs to a group with one of these options activated: Share Customers, Share Quantities or Share Orders'); + $group_desc = $this->l('Warning: You won\'t be able to change the group of this shop if this shop belongs to a group with one of these options activated: Share Customers, Share Quantities or Share Orders.'); else - $group_desc = $this->l('You can only move your shop to a shop group with all "share" options disabled or to a shop group with no customers/orders.'); + $group_desc = $this->l('You can only move your shop to a shop group with all "share" options disabled -- or to a shop group with no customers/orders.'); $this->fields_form['input'][] = array( 'type' => 'select', @@ -380,7 +376,7 @@ class AdminShopControllerCore extends AdminController $this->fields_form['input'][] = array( 'type' => 'textShopGroup', 'label' => $this->l('Shop group:'), - 'desc' => $this->l('You can\'t edit the shop group because the current shop belongs to a group with a "share" option enabled.'), + 'desc' => $this->l('You can\'t edit the shop group because the current shop belongs to a group with the "share" option enabled.'), 'name' => 'id_shop_group', 'value' => $group->name ); @@ -390,7 +386,7 @@ class AdminShopControllerCore extends AdminController $this->fields_form['input'][] = array( 'type' => 'select', 'label' => $this->l('Category root:'), - 'desc' => $this->l('This is the root category of the store that you create. To define a new root category for your store').' '.$this->l('Click here').'', + 'desc' => $this->l('This is the root category of the store that you\'ve created. To define a new root category for your store,').' '.$this->l('Please click here').'', 'name' => 'id_category', 'options' => array( 'query' => $categories, @@ -411,7 +407,7 @@ class AdminShopControllerCore extends AdminController 'name' => 'categoryBox', 'label' => $this->l('Associated categories:'), 'category_tree' => $this->initCategoriesAssociation($parent), - 'desc' => $this->l('By selecting categories associated, you choose to share the categories between different shops. Once associated between the shops, any alteration of an associated category will impact all the shops for which those categories will be associated.') + 'desc' => $this->l('By selecting associated categories, you are choosing to share the categories between shops. Once associated between shops, any alteration of this category will impact every shop.') ); /*$this->fields_form['input'][] = array( 'type' => 'radio', @@ -432,7 +428,7 @@ class AdminShopControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Enable or disable shop') + 'desc' => $this->l('Enable or disable your store?') );*/ $themes = Theme::getThemes(); @@ -462,20 +458,20 @@ class AdminShopControllerCore extends AdminController $disabled = false; $import_data = array( - 'carrier' => $this->l('Carriers'), + 'carrier' => $this->l('Carriers:'), 'cms' => $this->l('CMS page'), 'contact' => $this->l('Contact'), 'country' => $this->l('Countries'), - 'currency' => $this->l('Currencies'), + 'currency' => $this->l('Currencies:'), 'discount' => $this->l('Discounts'), 'employee' => $this->l('Employees'), 'image' => $this->l('Images'), 'lang' => $this->l('Langs'), - 'manufacturer' => $this->l('Manufacturers'), - 'module' => $this->l('Modules'), + 'manufacturer' => $this->l('Manufacturers:'), + 'module' => $this->l('modules'), 'hook_module' => $this->l('Module hooks'), 'meta_lang' => $this->l('Meta'), - 'product' => $this->l('Products'), + 'product' => $this->l('Products:'), 'product_attribute' => $this->l('Combinations'), 'scene' => $this->l('Scenes'), 'stock_available' => $this->l('Available quantities for sale'), @@ -522,7 +518,7 @@ class AdminShopControllerCore extends AdminController 'label' => $this->l('Choose data to import'), 'values' => $import_data ), - 'desc' => $this->l('Use this option to associate data (products, modules, etc.) the same way for the selected shop') + 'desc' => $this->l('Use this option to associate data (products, modules, etc.) the same way for each selected shop.') ); $this->fields_value = array( @@ -572,7 +568,7 @@ class AdminShopControllerCore extends AdminController $this->beforeAdd($object); if (!$object->add()) { - $this->errors[] = Tools::displayError('An error occurred while creating object.'). + $this->errors[] = Tools::displayError('An error occurred while creating an object.'). ' '.$this->table.' ('.Db::getInstance()->getMsgError().')'; } /* voluntary do affectation here */ @@ -629,7 +625,7 @@ class AdminShopControllerCore extends AdminController $selected_cat[] = $root_categories[0]['id_category']; foreach ($children as $child) - $selected_cat[] = $child->id_category; + $selected_cat[] = $child->id; } if (Shop::getContext() == Shop::CONTEXT_SHOP && Tools::isSubmit('id_shop')) $root_category = new Category($shop->id_category); @@ -660,12 +656,12 @@ class AdminShopControllerCore extends AdminController if (!isset($tree[$id_shop_group])) $tree[$id_shop_group] = array( 'data' => array( - 'title' => ''.$this->l('Group:').' '.$row['group_name'], + 'title' => ''.$this->l('Group').' '.$row['group_name'], 'icon' => 'themes/'.$this->context->employee->bo_theme.'/img/tree-multishop-groups.png', 'attr' => array( 'href' => $this->context->link->getAdminLink('AdminShop').'&id_shop_group='.$id_shop_group, - 'title' => sprintf($this->l('Click here to display shops of group %s'), $row['group_name']), - ) + 'title' => sprintf($this->l('Click here to display the shops in group %s', 'AdminShop', false, false), $row['group_name']), + ), ), 'attr' => array( 'id' => 'tree-group-'.$id_shop_group, @@ -684,7 +680,7 @@ class AdminShopControllerCore extends AdminController 'icon' => 'themes/'.$this->context->employee->bo_theme.'/img/tree-multishop-shop.png', 'attr' => array( 'href' => $this->context->link->getAdminLink('AdminShopUrl').'&id_shop='.$id_shop, - 'title' => sprintf($this->l('Click here to display URLs of shop %s'), $row['shop_name']), + 'title' => sprintf($this->l('Click here to display the URLs of shops %s', 'AdminShop', false, false), $row['shop_name']), ) ), 'attr' => array( @@ -692,7 +688,6 @@ class AdminShopControllerCore extends AdminController ), 'children' => array(), ); - // Url list if (!$id_shop_url) continue; @@ -735,7 +730,7 @@ class AdminShopControllerCore extends AdminController 'icon' => 'themes/'.$this->context->employee->bo_theme.'/img/tree-multishop-root.png', 'attr' => array( 'href' => $this->context->link->getAdminLink('AdminShopGroup'), - 'title' => $this->l('Click here to display group shops list'), + 'title' => $this->l('Click here to display group shops list', 'AdminShop', false, false), ) ), 'attr' => array( diff --git a/controllers/admin/AdminShopGroupController.php b/controllers/admin/AdminShopGroupController.php index 74ace8f31..ab1d3476e 100644 --- a/controllers/admin/AdminShopGroupController.php +++ b/controllers/admin/AdminShopGroupController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -99,11 +99,11 @@ class AdminShopGroupControllerCore extends AdminController { unset($this->toolbar_btn); $this->toolbar_btn['new'] = array( - 'desc' => $this->l('Add new shop group'), + 'desc' => $this->l('Add a new shop group'), 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token, ); $this->toolbar_btn['new_2'] = array( - 'desc' => $this->l('Add new shop'), + 'desc' => $this->l('Add a new shop'), 'href' => $this->context->link->getAdminLink('AdminShop').'&addshop', 'imgclass' => 'new' ); @@ -128,9 +128,9 @@ class AdminShopGroupControllerCore extends AdminController { $this->fields_form = array( 'legend' => array( - 'title' => $this->l('Shop Group') + 'title' => $this->l('Shop group:') ), - 'description' => $this->l('Warning: it is not recommended to enable the "share customers" and "share orders" options, because once they are activated and customers or orders are created, you will not be able to disable these options. If you need these options, try to first consider using several categories instead on several shops.'), + 'description' => $this->l('Warning: Enabling the "share customers" and "share orders" options is not recommended. Once activated and orders are created, you will not be able to disable these options. If you need these options, we recommend using several categories rather than several shops.'), 'input' => array( array( 'type' => 'text', @@ -158,7 +158,7 @@ class AdminShopGroupControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Once the option is enabled, the shops in this group will share their customers: if a customer registers on one of this group\'s shops, the account will automatically be available on the others shops of this goup. Warning: you will not be able to disable this option once you have customers registered on at least one shop of this group.'), + 'desc' => $this->l('Once this option is enabled, the shops in this group will share customers. If a customer registers in any one of these shops, the account will automatically be available in the others shops of this goup. rnrnWarning: you will not be able to disable this option once you have registered customers.'), ), array( 'type' => 'radio', @@ -179,7 +179,7 @@ class AdminShopGroupControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Share available quantities to sell between shops of this group. When changing this option, all products available quantities for this group will be reset to 0.'), + 'desc' => $this->l('Share available quantities between shops of this group. When changing this option, all available products quantities will be reset to 0.'), ), array( 'type' => 'radio', @@ -201,7 +201,7 @@ class AdminShopGroupControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Once this option is enabled (which is only possible if customers and available quantities are shared among shops), the customer\'s cart will be shared among all the shops in this group. This way, any purchase started on one of the shops in this group will be able to be finished in another shop from the same shop group. Warning: you will not be able to disable this option once you have orders on at least one shop of this group.') + 'desc' => $this->l('Once this option is enabled (which is only possible if customers and available quantities are shared among shops), the customer\'s cart will be shared by all shops in this group. This way, any purchase started in one shop will be able to be completed in another shop from the same group. rnrnWarning: You will not be able to disable this option once you\'ve started to accept orders.') ), array( 'type' => 'radio', @@ -222,7 +222,7 @@ class AdminShopGroupControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Enable or disable group shop') + 'desc' => $this->l('Enable or disable group shops?') ) ), 'submit' => array( @@ -280,7 +280,7 @@ class AdminShopGroupControllerCore extends AdminController if (ShopGroup::getTotalShopGroup() == 1) $this->errors[] = Tools::displayError('You cannot delete or disable the last shop group.'); else if ($object->haveShops()) - $this->errors[] = Tools::displayError('You cannot delete or disable a shop group which has shops using it.'); + $this->errors[] = Tools::displayError('You cannot delete or disable a shop group in use. '); if (count($this->errors)) return false; diff --git a/controllers/admin/AdminShopUrlController.php b/controllers/admin/AdminShopUrlController.php index 2c6d120f1..05d3ca9d1 100644 --- a/controllers/admin/AdminShopUrlController.php +++ b/controllers/admin/AdminShopUrlController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -107,11 +107,11 @@ class AdminShopUrlControllerCore extends AdminController $this->multiple_fieldsets = true; if (!$update_htaccess) $desc_virtual_uri = array( - ''.$this->l('You need to activate the URL Rewriting if you want to add a virtual URI.').'' + ''.$this->l('You need to activate URL Rewriting if you want to add a virtual URL.').'' ); else $desc_virtual_uri = array( - $this->l('You can use this option if you want to create a store with a URI that doesn\'t exist on your server (e.g. if you want your store to be available with the URL www.my-prestashop.com/my-store/shoes/, you have to set shoes/ in this field, assuming that my-store/ is your Physical URI).'), + $this->l('You can use this option if you want to create a store with a URL that doesn\'t exist on your server (e.g. if you want your store to be available with the URL www.my-prestashop.com/my-store/shoes/, you have to set shoes/ in this field, assuming that my-store/ is your Physical URL).'), ''.$this->l('URL rewriting must be activated on your server to use this feature.').'' ); $this->fields_form = array( @@ -158,11 +158,11 @@ class AdminShopUrlControllerCore extends AdminController 'desc' => array( $this->l('If you set this URL as the Main URL for the selected shop, all URLs set to this shop will be redirected to this URL (you can only have one Main URL per shop).'), array( - 'text' => $this->l('Since the selected shop has no Main URL, you have to set this URL as the Main URL'), + 'text' => $this->l('Since the selected shop has no main URL, you have to set this URL as the Main URL.'), 'id' => 'mainUrlInfo' ), array( - 'text' => $this->l('The selected shop has already a Main URL, if you set this one as the Main URL, the older one will be set as the Normal URL.'), + 'text' => $this->l('The selected shop already has a Main URL. Therefore, if you set this one as the Main URL, the older of the two will be set as the normal URL.'), 'id' => 'mainUrlInfoExplain' ) ) @@ -214,18 +214,18 @@ class AdminShopUrlControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('Physical URI:'), + 'label' => $this->l('Physical URL:'), 'name' => 'physical_uri', - 'desc' => $this->l('Physical folder of your store on your server. Leave this field empty if your store is installed on the root path (e.g. if your store is available at www.my-prestashop.com/my-store/, you would set my-store/ in this field).'), + 'desc' => $this->l('This is the physical folder for your store on the server. Leave this field empty if your store is installed on the root path (e.g. if your store is available at www.my-prestashop.com/my-store/, you input my-store/ in this field).'), 'size' => 50, ), array( 'type' => 'text', - 'label' => $this->l('Virtual URI:'), + 'label' => $this->l('Virtual URL:'), 'name' => 'virtual_uri', 'desc' => $desc_virtual_uri, 'size' => 50, - 'hint' => (!$update_htaccess) ? $this->l('Warning: URL rewriting (e.g. mod_rewrite for Apache) seems to be disabled. If your URL don\'t work, please check with your host provider how to activate URL rewriting.') : '', + 'hint' => (!$update_htaccess) ? $this->l('Warning: URL rewriting (e.g. mod_rewrite for Apache) seems to be disabled. If your URL doesn\'t work, please check with your host provider on how to activate URL rewriting.') : '', ), array( 'type' => 'text', @@ -280,7 +280,7 @@ class AdminShopUrlControllerCore extends AdminController $this->show_toolbar = false; if (isset($this->toolbar_btn['new'])) $this->toolbar_btn['new'] = array( - 'desc' => $this->l('Add new URL'), + 'desc' => $this->l('Add a new URL'), 'href' => $this->context->link->getAdminLink('AdminShopUrl').'&add'.$this->table.'&id_shop='.$this->id_shop, ); @@ -323,17 +323,17 @@ class AdminShopUrlControllerCore extends AdminController if (Validate::isLoadedObject($object = $this->loadObject())) { if ($object->main) - $this->errors[] = Tools::displayError('You can\'t disable a Main URL'); + $this->errors[] = Tools::displayError('You cannot disable the Main URL.'); elseif ($object->toggleStatus()) Tools::redirectAdmin(self::$currentIndex.'&conf=5&token='.$token); else - $this->errors[] = Tools::displayError('An error occurred while updating status.'); + $this->errors[] = Tools::displayError('An error occurred while updating the status.'); } else - $this->errors[] = Tools::displayError('An error occurred while updating status for object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else $result = parent::postProcess(); @@ -348,7 +348,7 @@ class AdminShopUrlControllerCore extends AdminController { $object = $this->loadObject(true); if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri'))) - $this->errors[] = Tools::displayError('A shop URL that use this domain and uri already exists'); + $this->errors[] = Tools::displayError('A shop URL that uses this domain already exists.'); $return = parent::processSave(); if (!$this->errors) @@ -360,14 +360,18 @@ class AdminShopUrlControllerCore extends AdminController public function processAdd() { $object = $this->loadObject(true); + + if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri'))) + $this->errors[] = Tools::displayError('A shop URL that uses this domain already exists.'); + if ($object->id && Tools::getValue('main')) $object->setMain(); if ($object->main && !Tools::getValue('main')) - $this->errors[] = Tools::displayError('You can\'t change a Main URL to a non-Main URL, you have to set another URL as Main URL for selected shop'); + $this->errors[] = Tools::displayError('You cannot change a main URL to a non-main URL. You have to set another URL as your Main URL for the selected shop.'); if (($object->main || Tools::getValue('main')) && !Tools::getValue('active')) - $this->errors[] = Tools::displayError('You can\'t disable a Main URL'); + $this->errors[] = Tools::displayError('You cannot disable the Main URL.'); return parent::processAdd(); } @@ -390,6 +394,42 @@ class AdminShopUrlControllerCore extends AdminController if ($this->redirect_shop_url) $this->redirect_after = $object->getBaseURI().basename(_PS_ADMIN_DIR_).'/'.$this->context->link->getAdminLink('AdminShopUrl'); } + + /** + * @param string $token + * @param integer $id + * @param string $name + * @return mixed + */ + public function displayDeleteLink($token = null, $id, $name = null) + { + $tpl = $this->createTemplate('helpers/list/list_action_delete.tpl'); + + if (!array_key_exists('Delete', self::$cache_lang)) + self::$cache_lang['Delete'] = $this->l('Delete', 'Helper'); + + if (!array_key_exists('DeleteItem', self::$cache_lang)) + self::$cache_lang['DeleteItem'] = $this->l('Delete selected item?', 'Helper'); + + if (!array_key_exists('Name', self::$cache_lang)) + self::$cache_lang['Name'] = $this->l('Name:', 'Helper'); + + if (!is_null($name)) + $name = '\n\n'.self::$cache_lang['Name'].' '.$name; + + $data = array( + $this->identifier => $id, + 'href' => Tools::safeOutput(self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&id_shop='.$this->id_shop.'&token='.($token != null ? $token : $this->token)), + 'action' => self::$cache_lang['Delete'], + ); + + if ($this->specificConfirmDelete !== false) + $data['confirm'] = !is_null($this->specificConfirmDelete) ? '\r'.$this->specificConfirmDelete : self::$cache_lang['DeleteItem'].$name; + + $tpl->assign(array_merge($this->tpl_delete_link_vars, $data)); + + return $tpl->fetch(); + } } diff --git a/controllers/admin/AdminSlipController.php b/controllers/admin/AdminSlipController.php index ed6e86087..49c03e9a4 100644 --- a/controllers/admin/AdminSlipController.php +++ b/controllers/admin/AdminSlipController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -59,6 +59,21 @@ class AdminSlipControllerCore extends AdminController $this->_select = 'a.id_order_slip AS id_pdf'; $this->optionTitle = $this->l('Slip'); + $this->fields_options = array( + 'general' => array( + 'title' => $this->l('Credit slip options'), + 'fields' => array( + 'PS_CREDIT_SLIP_PREFIX' => array( + 'title' => $this->l('Credit slip prefix:'), + 'desc' => $this->l('Prefix used for credit slips'), + 'size' => 6, + 'type' => 'textLang' + ) + ), + 'submit' => array() + ) + ); + parent::__construct(); } @@ -118,7 +133,7 @@ class AdminSlipControllerCore extends AdminController $order_slips = OrderSlip::getSlipsIdByDate(Tools::getValue('date_from'), Tools::getValue('date_to')); if (count($order_slips)) Tools::redirectAdmin($this->context->link->getAdminLink('AdminPdf').'&submitAction=generateOrderSlipsPDF&date_from='.urlencode(Tools::getValue('date_from')).'&date_to='.urlencode(Tools::getValue('date_to'))); - $this->errors[] = $this->l('No order slips found for this period'); + $this->errors[] = $this->l('No order slips were found for this period.'); } } else @@ -130,6 +145,7 @@ class AdminSlipControllerCore extends AdminController $this->initToolbar(); $this->content .= $this->renderList(); $this->content .= $this->renderForm(); + $this->content .= '
        '.$this->renderOptions(); $this->context->smarty->assign(array( 'content' => $this->content, diff --git a/controllers/admin/AdminSpecificPriceRuleController.php b/controllers/admin/AdminSpecificPriceRuleController.php index 32c205957..4421b4a68 100755 --- a/controllers/admin/AdminSpecificPriceRuleController.php +++ b/controllers/admin/AdminSpecificPriceRuleController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -61,7 +61,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController 'name' => array( 'title' => $this->l('Name'), 'filter_key' => 'a!name', - 'width' => 200 + 'width' => 'auto' ), 'shop_name' => array( 'title' => $this->l('Shop'), @@ -140,16 +140,16 @@ class AdminSpecificPriceRuleControllerCore extends AdminController 'input' => array( array( 'type' => 'text', - 'label' => $this->l('Name:'), + 'label' => $this->l('Name'), 'name' => 'name', 'size' => 33, 'maxlength' => 32, 'required' => true, - 'hint' => $this->l('Forbidden characters:').' <>;=#{}' + 'hint' => $this->l('Forbidden characters').' <>;=#{}' ), array( 'type' => 'select', - 'label' => $this->l('Shop:'), + 'label' => $this->l('Shop'), 'name' => 'id_shop', 'options' => array( 'query' => $shops, @@ -161,7 +161,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController ), array( 'type' => 'select', - 'label' => $this->l('Currency:'), + 'label' => $this->l('Currency'), 'name' => 'id_currency', 'options' => array( 'query' => array_merge(array(0 => array('id_currency' => 0, 'name' => $this->l('All currencies'))), Currency::getCurrencies()), @@ -171,7 +171,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController ), array( 'type' => 'select', - 'label' => $this->l('Country:'), + 'label' => $this->l('Country'), 'name' => 'id_country', 'options' => array( 'query' => array_merge(array(0 => array('id_country' => 0, 'name' => $this->l('All countries'))), Country::getCountries((int)$this->context->language->id)), @@ -181,7 +181,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController ), array( 'type' => 'select', - 'label' => $this->l('Group:'), + 'label' => $this->l('Group'), 'name' => 'id_group', 'options' => array( 'query' => array_merge(array(0 => array('id_group' => 0, 'name' => $this->l('All groups'))), Group::getGroups((int)$this->context->language->id)), @@ -191,7 +191,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('From quantity:'), + 'label' => $this->l('From quantity'), 'name' => 'from_quantity', 'size' => 6, 'maxlength' => 10, @@ -199,7 +199,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('Price (tax excl.):'), + 'label' => $this->l('Price (tax excl.)'), 'name' => 'price', 'size' => 6, 'disabled' => ($this->object->price == -1 ? 1 : 0), @@ -225,19 +225,19 @@ class AdminSpecificPriceRuleControllerCore extends AdminController ), array( 'type' => 'date', - 'label' => $this->l('From:'), + 'label' => $this->l('From'), 'name' => 'from', 'size' => 12, ), array( 'type' => 'date', - 'label' => $this->l('To:'), + 'label' => $this->l('To'), 'name' => 'to', 'size' => 12, ), array( 'type' => 'select', - 'label' => $this->l('Reduction type:'), + 'label' => $this->l('Reduction type'), 'name' => 'reduction_type', 'options' => array( 'query' => array(array('reduction_type' => 'amount', 'name' => $this->l('Amount')), array('reduction_type' => 'percentage', 'name' => $this->l('Percentage'))), @@ -247,7 +247,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('Reduction:'), + 'label' => $this->l('Reduction'), 'name' => 'reduction', 'required' => true, ), diff --git a/controllers/admin/AdminStatesController.php b/controllers/admin/AdminStatesController.php index 4783253cf..6b2dc99d0 100644 --- a/controllers/admin/AdminStatesController.php +++ b/controllers/admin/AdminStatesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -106,7 +106,7 @@ class AdminStatesControllerCore extends AdminController 'size' => 30, 'maxlength' => 32, 'required' => true, - 'desc' => $this->l('State name to display in addresses and on invoices') + 'desc' => $this->l('Provide the State name to be display in addresses and on invoices.') ), array( 'type' => 'text', @@ -129,7 +129,7 @@ class AdminStatesControllerCore extends AdminController 'id' => 'id_country', 'name' => 'name', ), - 'desc' => $this->l('Country where state, region or city is located') + 'desc' => $this->l('Country where the state, region or city is located') ), array( 'type' => 'select', @@ -142,7 +142,7 @@ class AdminStatesControllerCore extends AdminController 'name' => 'name' ), 'desc' => array( - $this->l('Geographical zone where this state is located'), + $this->l('Geographical region where this state is located.'), $this->l('Used for shipping') ) ), @@ -187,13 +187,13 @@ class AdminStatesControllerCore extends AdminController if (!Tools::getValue('id_'.$this->table)) { if (Validate::isStateIsoCode(Tools::getValue('iso_code')) && State::getIdByIso(Tools::getValue('iso_code'), Tools::getValue('id_country'))) - $this->errors[] = Tools::displayError('This ISO code already exists, you cannot create two states with the same ISO code in the same country'); + $this->errors[] = Tools::displayError('This ISO code already exists. You cannot create two states with the same ISO code.'); } else if (Validate::isStateIsoCode(Tools::getValue('iso_code'))) { $id_state = State::getIdByIso(Tools::getValue('iso_code'), Tools::getValue('id_country')); if ($id_state && $id_state != Tools::getValue('id_'.$this->table)) - $this->errors[] = Tools::displayError('This ISO code already exists, you cannot create two states with the same ISO code in the same country'); + $this->errors[] = Tools::displayError('This ISO code already exists. You cannot create two states with the same ISO code.'); } /* Delete object */ @@ -225,13 +225,13 @@ class AdminStatesControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('This state was used in at least one address, it cannot be removed'); + $this->errors[] = Tools::displayError('This state was used in at least one address. It cannot be removed.'); } else - $this->errors[] = Tools::displayError('An error occurred while deleting object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + $this->errors[] = Tools::displayError('An error occurred while deleting the object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); } else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } else parent::postProcess(); diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index 5954cd848..3d049c89e 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/controllers/admin/AdminStatsTabController.php b/controllers/admin/AdminStatsTabController.php index caae937b4..8f6895ba7 100644 --- a/controllers/admin/AdminStatsTabController.php +++ b/controllers/admin/AdminStatsTabController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ + abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCore { public function init() @@ -35,8 +36,9 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor public function initContent() { + $this->initTabModuleList(); + $this->addToolBarModulesListButton(); $this->toolbar_title = $this->l('Stats', 'AdminStatsTab'); - if ($this->display == 'view') { // Some controllers use the view action without an object @@ -77,6 +79,12 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor $context->controller->addJqueryUI('ui.datepicker'); + if ($identifier === null && Tools::getValue('module')) + { + $identifier = 'module'; + $id = Tools::getValue('module'); + } + $tpl->assign(array( 'current' => self::$currentIndex, 'token' => $token, @@ -182,7 +190,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor if (Tools::isSubmit('submitDatePicker')) { if (!Validate::isDate($from = Tools::getValue('datepickerFrom')) || !Validate::isDate($to = Tools::getValue('datepickerTo'))) - $this->errors[] = Tools::displayError('Specified date is invalid'); + $this->errors[] = Tools::displayError('The specified date is invalid.'); } if (Tools::isSubmit('submitDateDay')) { @@ -234,7 +242,7 @@ abstract class AdminStatsTabControllerCore extends AdminPreferencesControllerCor Configuration::updateValue('PS_STATS_OLD_CONNECT_AUTO_CLEAN', Tools::getValue('PS_STATS_OLD_CONNECT_AUTO_CLEAN', Configuration::get('PS_STATS_OLD_CONNECT_AUTO_CLEAN'))); } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } diff --git a/controllers/admin/AdminStatusesController.php b/controllers/admin/AdminStatusesController.php index aa1f49146..e1cc6f887 100644 --- a/controllers/admin/AdminStatusesController.php +++ b/controllers/admin/AdminStatusesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -35,6 +35,7 @@ class AdminStatusesControllerCore extends AdminController $this->colorOnBackground = false; $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->context = Context::getContext(); + $this->multishop_context = Shop::CONTEXT_ALL; $this->imageType = 'gif'; $this->fieldImageSettings = array( 'name' => 'icon', @@ -88,7 +89,7 @@ class AdminStatusesControllerCore extends AdminController 'search' => false ), 'send_email' => array( - 'title' => $this->l('Send e-mail to customer'), + 'title' => $this->l('Send email to customer'), 'align' => 'center', 'icon' => array( '1' => 'enabled.gif', @@ -98,6 +99,18 @@ class AdminStatusesControllerCore extends AdminController 'type' => 'bool', 'orderby' => false ), + 'delivery' => array( + 'title' => $this->l('Delivery'), + 'align' => 'center', + 'width' => 25, + 'icon' => array( + '1' => 'enabled.gif', + '0' => 'disabled.gif' + ), + 'type' => 'bool', + 'orderby' => false + ) + , 'invoice' => array( 'title' => $this->l('Invoice'), 'align' => 'center', @@ -110,7 +123,7 @@ class AdminStatusesControllerCore extends AdminController 'orderby' => false ), 'template' => array( - 'title' => $this->l('E-mail template'), + 'title' => $this->l('Email template'), 'width' => 120 ) ); @@ -127,6 +140,7 @@ class AdminStatusesControllerCore extends AdminController $this->_orderBy = null; $this->addRowAction('editstatus'); + $this->addRowActionSkipList('delete', array(1, 2, 3, 4, 5)); $this->fields_list = array( 'id_order_return_state' => array( @@ -174,7 +188,7 @@ class AdminStatusesControllerCore extends AdminController else $helper->fields_value = $this->getFieldsValue($order_return_state); $helper->toolbar_btn = $this->toolbar_btn; - $helper->title = $this->l('Edit Order Statuses'); + $helper->title = $this->l('Edit Order Status'); return $helper; } @@ -193,7 +207,7 @@ class AdminStatusesControllerCore extends AdminController // call postProcess() to take care of actions and filters $this->postProcess(); - $this->toolbar_title = $this->l('Return statuses'); + $this->toolbar_title = $this->l('Return status'); $this->checkFilterForOrdersReturnsList(); parent::initToolbar(); @@ -229,7 +243,7 @@ class AdminStatusesControllerCore extends AdminController $this->fields_form = array( 'tinymce' => true, 'legend' => array( - 'title' => $this->l('Order statuses'), + 'title' => $this->l('Order status'), 'image' => '../img/admin/time.gif' ), 'input' => array( @@ -254,14 +268,14 @@ class AdminStatusesControllerCore extends AdminController 'label' => $this->l('Color:'), 'name' => 'color', 'size' => 30, - 'desc' => $this->l('Status will be highlighted in this color. HTML colors only (e.g.').' "lightblue", "#CC6600")' + 'desc' => $this->l('Status will be highlighted in this color. (HTML colors only)').' "lightblue", "#CC6600")' ), array( 'type' => 'checkbox', 'name' => 'logable', 'values' => array( 'query' => array( - array('id' => 'on', 'name' => $this->l('Consider the associated order as validated'), 'val' => '1'), + array('id' => 'on', 'name' => $this->l('Consider the associated order as validated.'), 'val' => '1'), ), 'id' => 'id', 'name' => 'name' @@ -272,7 +286,7 @@ class AdminStatusesControllerCore extends AdminController 'name' => 'invoice', 'values' => array( 'query' => array( - array('id' => 'on', 'name' => $this->l('Allow customer to download and view PDF version of invoice'), 'val' => '1'), + array('id' => 'on', 'name' => $this->l('Allow a customer to download and view PDF versions of their invoice.'), 'val' => '1'), ), 'id' => 'id', 'name' => 'name' @@ -283,7 +297,7 @@ class AdminStatusesControllerCore extends AdminController 'name' => 'hidden', 'values' => array( 'query' => array( - array('id' => 'on', 'name' => $this->l('Hide this state in order for customer'), 'val' => '1'), + array('id' => 'on', 'name' => $this->l('Hide this state in all customer orders'), 'val' => '1'), ), 'id' => 'id', 'name' => 'name' @@ -294,7 +308,7 @@ class AdminStatusesControllerCore extends AdminController 'name' => 'send_email', 'values' => array( 'query' => array( - array('id' => 'on', 'name' => $this->l('Send e-mail to customer when order status is changed'), 'val' => '1'), + array('id' => 'on', 'name' => $this->l('Send an email to the customer when his/her order status has changed.'), 'val' => '1'), ), 'id' => 'id', 'name' => 'name' @@ -305,7 +319,7 @@ class AdminStatusesControllerCore extends AdminController 'name' => 'shipped', 'values' => array( 'query' => array( - array('id' => 'on', 'name' => $this->l('Set order as shipped'), 'val' => '1'), + array('id' => 'on', 'name' => $this->l('Set the order as shipped'), 'val' => '1'), ), 'id' => 'id', 'name' => 'name' @@ -316,7 +330,18 @@ class AdminStatusesControllerCore extends AdminController 'name' => 'paid', 'values' => array( 'query' => array( - array('id' => 'on', 'name' => $this->l('Set order as paid'), 'val' => '1'), + array('id' => 'on', 'name' => $this->l('Set the order as paid'), 'val' => '1'), + ), + 'id' => 'id', + 'name' => 'name' + ) + ), + array( + 'type' => 'checkbox', + 'name' => 'delivery', + 'values' => array( + 'query' => array( + array('id' => 'on', 'name' => $this->l('Show delivery PDF'), 'val' => '1'), ), 'id' => 'id', 'name' => 'name' @@ -332,8 +357,8 @@ class AdminStatusesControllerCore extends AdminController 'id' => 'id', 'name' => 'name' ), - 'hint' => $this->l('Only letters, number and -_ are allowed'), - 'desc' => $this->l('E-mail template for both .html and .txt') + 'hint' => $this->l('Only letters, number and hashtags are allowed.'), + 'desc' => $this->l('Email template for both .html and .txt') ) ), 'submit' => array( @@ -351,7 +376,8 @@ class AdminStatusesControllerCore extends AdminController 'hidden_on' => $this->getFieldValue($obj, 'hidden'), 'send_email_on' => $this->getFieldValue($obj, 'send_email'), 'shipped_on' => $this->getFieldValue($obj, 'shipped'), - 'paid_on' => $this->getFieldValue($obj, 'paid') + 'paid_on' => $this->getFieldValue($obj, 'paid'), + 'delivery_on' => $this->getFieldValue($obj, 'delivery') ); return parent::renderForm(); @@ -364,7 +390,7 @@ class AdminStatusesControllerCore extends AdminController $this->fields_form[0]['form'] = array( 'tinymce' => true, 'legend' => array( - 'title' => $this->l('Order statuses'), + 'title' => $this->l('Order status'), 'image' => '../img/admin/time.gif' ), 'input' => array( @@ -376,14 +402,14 @@ class AdminStatusesControllerCore extends AdminController 'size' => 40, 'required' => true, 'hint' => $this->l('Invalid characters: numbers and').' !<>,;?=+()@#"�{}_$%:', - 'desc' => $this->l('Order return status name') + 'desc' => $this->l('Order\'s return status name') ), array( 'type' => 'color', 'label' => $this->l('Color:'), 'name' => 'color', 'size' => 30, - 'desc' => $this->l('Status will be highlighted in this color. HTML colors only (e.g.').' "lightblue", "#CC6600")' + 'desc' => $this->l('Status will be highlighted in this color. (HTML colors only)').' "lightblue", "#CC6600")' ) ), 'submit' => array( @@ -430,7 +456,7 @@ class AdminStatusesControllerCore extends AdminController // Update object if (!$order_return_state->save()) - $this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current order return state'); + $this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current order\'s return state.'); else Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token); } @@ -451,7 +477,7 @@ class AdminStatusesControllerCore extends AdminController $order_return_state = new OrderReturnState((int)$id_order_return_state); if (!$order_return_state->delete()) - $this->errors[] = Tools::displayError('An error has occurred: Can\'t delete the current order return state'); + $this->errors[] = Tools::displayError('An error has occurred: Can\'t delete the current order\'s return state.'); else Tools::redirectAdmin(self::$currentIndex.'&conf=1&token='.$this->token); } @@ -465,6 +491,7 @@ class AdminStatusesControllerCore extends AdminController $_POST['hidden'] = (int)Tools::getValue('hidden_on'); $_POST['shipped'] = (int)Tools::getValue('shipped_on'); $_POST['paid'] = (int)Tools::getValue('paid_on'); + $_POST['delivery'] = (int)Tools::getValue('delivery_on'); if (!$_POST['send_email']) { $languages = Language::getLanguages(false); diff --git a/controllers/admin/AdminStockConfigurationController.php b/controllers/admin/AdminStockConfigurationController.php index 4e56c0445..0d719285d 100644 --- a/controllers/admin/AdminStockConfigurationController.php +++ b/controllers/admin/AdminStockConfigurationController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -84,7 +84,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'title' => $this->l('Options'), 'fields' => array( 'PS_STOCK_MVT_INC_REASON_DEFAULT' => array( - 'title' => $this->l('Default label when increasing stock:'), + 'title' => $this->l('Default label for increasing stock:'), 'cast' => 'intval', 'type' => 'select', 'list' => $reasons_inc, @@ -92,7 +92,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'visibility' => Shop::CONTEXT_ALL ), 'PS_STOCK_MVT_DEC_REASON_DEFAULT' => array( - 'title' => $this->l('Default label when decreasing stock:'), + 'title' => $this->l('Default label for decreasing stock:'), 'cast' => 'intval', 'type' => 'select', 'list' => $reasons_dec, @@ -100,7 +100,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'visibility' => Shop::CONTEXT_ALL ), 'PS_STOCK_CUSTOMER_ORDER_REASON' => array( - 'title' => $this->l('Default label when decreasing stock when a customer order is shipped:'), + 'title' => $this->l('Default label for decreasing stock when a customer order is shipped:'), 'cast' => 'intval', 'type' => 'select', 'list' => $reasons_dec, @@ -108,7 +108,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'visibility' => Shop::CONTEXT_ALL ), 'PS_STOCK_MVT_SUPPLY_ORDER' => array( - 'title' => $this->l('Default label when increasing stock when a supply order is received:'), + 'title' => $this->l('Default label for increasing stock when a supply order is received:'), 'cast' => 'intval', 'type' => 'select', 'list' => $reasons_inc, @@ -155,7 +155,7 @@ class AdminStockConfigurationControllerCore extends AdminController $this->fields_form = array( 'legend' => array( - 'title' => $this->l('Stock Movement Label'), + 'title' => $this->l('Stock Movement label'), 'image' => '../img/admin/edit.gif' ), 'input' => array( @@ -186,7 +186,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'id' => 'id', 'name' => 'name' ), - 'desc' => $this->l('Select the corresponding action: increase or decrease stock.') + 'desc' => $this->l('Select the corresponding action: Increase or decrease stock?') ), ), 'submit' => array( @@ -220,7 +220,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'label' => $this->l('Color:'), 'name' => 'color', 'size' => 20, - 'desc' => $this->l('Back Office background will be displayed in this color. HTML colors only.'), + 'desc' => $this->l('The background of the PrestaShop Back Office will be displayed in this color (HTML colors only, please).'), ), array( 'type' => 'radio', @@ -241,7 +241,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'label' => $this->l('No') ) ), - 'desc' => $this->l('Define if it is possible to edit the order. An editable order is not valid to send to the supplier.') + 'desc' => $this->l('Is it is possible to edit the order? Keep in mind that an editable order can not be sent to the supplier.') ), array( 'type' => 'radio', @@ -262,7 +262,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'label' => $this->l('No') ) ), - 'desc' => $this->l('Define if it is possible to generate a delivery note of the order.') + 'desc' => $this->l('Is it possible to generate a delivery note for the order?') ), array( 'type' => 'radio', @@ -283,7 +283,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'label' => $this->l('No') ) ), - 'desc' => $this->l('Define if products have been partially/completely received. This allows you to know if the products ordered have to be added to the corresponding warehouse.'), + 'desc' => $this->l('Define if products have been either partially or completely received. This will allow you to know if ordered products have to be added to the corresponding warehouse.'), ), array( 'type' => 'radio', @@ -304,7 +304,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'label' => $this->l('No') ) ), - 'desc' => $this->l('Customer is awaiting delivery') + 'desc' => $this->l('The customer is awaiting delivery.') ), ), 'submit' => array( @@ -317,7 +317,7 @@ class AdminStockConfigurationControllerCore extends AdminController $this->toolbar_title = $this->l('Stock: Add supply order status'); else { - $this->toolbar_title = $this->l('Stock: Update Supply order status'); + $this->toolbar_title = $this->l('Stock: Update supply order status'); $id_supply_order_state = Tools::getValue('id_supply_order_state', 0); @@ -326,7 +326,7 @@ class AdminStockConfigurationControllerCore extends AdminController { $this->fields_form = array( 'legend' => array( - 'title' => $this->l('Supply Order status'), + 'title' => $this->l('Supply order status'), 'image' => '../img/admin/edit.gif' ), 'input' => array( @@ -343,7 +343,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'label' => $this->l('Back Office color:'), 'name' => 'color', 'size' => 20, - 'desc' => $this->l('Back Office background will be displayed in this color. HTML colors only'), + 'desc' => $this->l('The background of PrestaShop\'s Back Office will be displayed in this color (HTML colors only, please).'), ), ), 'submit' => array( @@ -380,7 +380,7 @@ class AdminStockConfigurationControllerCore extends AdminController /** * General messages displayed for all lists */ - $this->displayInformation($this->l('This interface allows you to configure your supply order statuses and stock movement labels.').'
        '); + $this->displayInformation($this->l('This interface allows you to configure your supply order status and stock movement labels.').'
        '); // Checks access if (!($this->tabAccess['add'] === '1')) @@ -433,7 +433,7 @@ class AdminStockConfigurationControllerCore extends AdminController $this->list_no_link = true; $this->_orderBy = null; $this->addRowActionSkipList('delete', array(1, 2, 3, 4, 5, 6)); - $this->toolbar_title = $this->l('Stock: Supply Order status'); + $this->toolbar_title = $this->l('Stock: Supply order status'); $this->initToolbar(); $this->fields_list = array( @@ -453,7 +453,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'orderby' => false ), 'delivery_note' => array( - 'title' => $this->l('Delivery note available?'), + 'title' => $this->l('Is there a delivery note available?'), 'align' => 'center', 'icon' => array( '1' => 'enabled.gif', @@ -464,7 +464,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'orderby' => false ), 'pending_receipt' => array( - 'title' => $this->l('Is a pending receipt state?'), + 'title' => $this->l('Is there a pending receipt?'), 'align' => 'center', 'icon' => array( '1' => 'enabled.gif', @@ -475,7 +475,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'orderby' => false ), 'receipt_state' => array( - 'title' => $this->l('Is a delivery state?'), + 'title' => $this->l('Delivery state?'), 'align' => 'center', 'icon' => array( '1' => 'enabled.gif', @@ -486,7 +486,7 @@ class AdminStockConfigurationControllerCore extends AdminController 'orderby' => false ), 'enclosed' => array( - 'title' => $this->l('Is an enclosed order state?'), + 'title' => $this->l('Enclosed order state?'), 'align' => 'center', 'icon' => array( '1' => 'enabled.gif', @@ -547,7 +547,7 @@ class AdminStockConfigurationControllerCore extends AdminController $item = &$this->_list[$i]; if (empty($item['product_name'])) - $item['product_name'] = $this->l('The name of this product is not available. It may been deleted from the system.'); + $item['product_name'] = $this->l('The name of this product is not available. It may have been deleted from the system.'); } } } @@ -556,7 +556,7 @@ class AdminStockConfigurationControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initContent(); @@ -566,7 +566,7 @@ class AdminStockConfigurationControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initProcess(); diff --git a/controllers/admin/AdminStockCoverController.php b/controllers/admin/AdminStockCoverController.php index c089eec7e..ddbb16bfb 100644 --- a/controllers/admin/AdminStockCoverController.php +++ b/controllers/admin/AdminStockCoverController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -76,7 +76,7 @@ class AdminStockCoverControllerCore extends AdminController 'width' => 160, 'orderby' => false, 'search' => false, - 'hint' => $this->l('Days left before you run out of stock.'), + 'hint' => $this->l('Days left before your stock runs out.'), ), 'stock' => array( 'title' => $this->l('Quantity'), @@ -213,7 +213,7 @@ class AdminStockCoverControllerCore extends AdminController 'warn_days' => $this->getCurrentWarning() ); - $this->displayInformation($this->l('Considering the coverage period choosen and the quantity of products/combinations that you sold,')); + $this->displayInformation($this->l('Considering the coverage period chosen and the quantity of products/combinations that you sold.')); $this->displayInformation($this->l('this interface gives you an idea of when a product will run out of stock.')); return parent::renderList(); @@ -356,7 +356,7 @@ class AdminStockCoverControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initContent(); @@ -366,7 +366,7 @@ class AdminStockCoverControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initProcess(); diff --git a/controllers/admin/AdminStockInstantStateController.php b/controllers/admin/AdminStockInstantStateController.php index be35ebdc9..a3db14452 100644 --- a/controllers/admin/AdminStockInstantStateController.php +++ b/controllers/admin/AdminStockInstantStateController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -94,7 +94,7 @@ class AdminStockInstantStateControllerCore extends AdminController 'width' => 80, 'orderby' => true, 'search' => false, - 'hint' => $this->l('Pysical qty (usable) - Clients orders + Supply Orders'), + 'hint' => $this->l('Pysical quantity (usable) - Client orders + Supply Orders'), ), ); @@ -152,7 +152,7 @@ class AdminStockInstantStateControllerCore extends AdminController $this->ajax_params = array('id_warehouse' => $this->getCurrentCoverageWarehouse()); // displays help information - $this->displayInformation($this->l('This interface allows you to display detailed information on your stock per warehouse.')); + $this->displayInformation($this->l('This interface allows you to display detailed information about your stock per warehouse.')); // sets toolbar $this->initToolbar(); @@ -181,11 +181,13 @@ class AdminStockInstantStateControllerCore extends AdminController */ public function getList($id_lang, $order_by = null, $order_way = null, $start = 0, $limit = null, $id_lang_shop = false) { - if (Tools::isSubmit('csv') && (int)Tools::getValue('id_warehouse') != -1) + if ((Tools::isSubmit('csv_quantities') || Tools::isSubmit('csv_prices')) && + (int)Tools::getValue('id_warehouse') != -1) $limit = false; $order_by_valuation = false; $order_by_real_quantity = false; + if ($this->context->cookie->{$this->table.'Orderby'} == 'valuation') { unset($this->context->cookie->{$this->table.'Orderby'}); @@ -200,6 +202,7 @@ class AdminStockInstantStateControllerCore extends AdminController parent::getList($id_lang, $order_by, $order_way, $start, $limit, $id_lang_shop); $nb_items = count($this->_list); + for ($i = 0; $i < $nb_items; ++$i) { $item = &$this->_list[$i]; @@ -446,7 +449,7 @@ class AdminStockInstantStateControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initContent(); @@ -456,7 +459,7 @@ class AdminStockInstantStateControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initProcess(); diff --git a/controllers/admin/AdminStockManagementController.php b/controllers/admin/AdminStockManagementController.php index 79ecc0f8b..22319e557 100644 --- a/controllers/admin/AdminStockManagementController.php +++ b/controllers/admin/AdminStockManagementController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -61,7 +61,7 @@ class AdminStockManagementControllerCore extends AdminController ), 'stock' => array( 'title' => $this->l('Quantity'), - 'hint' => $this->l('Sum of quantities for all warehouses'), + 'hint' => $this->l('Quantitity total for all warehouses.'), 'width' => 100, 'orderby' => false, 'filter' => false, @@ -73,9 +73,9 @@ class AdminStockManagementControllerCore extends AdminController // overrides confirmation messages specifically for this controller $this->_conf = array( - 1 => $this->l('The product was successfully added to stock'), - 2 => $this->l('The product was successfully removed from the stock'), - 3 => $this->l('The transfer was successfully completed'), + 1 => $this->l('The product was successfully added to your stock.'), + 2 => $this->l('The product was successfully removed from your stock.'), + 3 => $this->l('The transfer was successfully completed.'), ); } @@ -104,11 +104,11 @@ class AdminStockManagementControllerCore extends AdminController $this->_group = 'GROUP BY a.id_product'; // displays informations - $this->displayInformation($this->l('This interface allows you to manage the stocks of each of your products and their variations.').'
        '); - $this->displayInformation($this->l('Through this interface, you can increase quantities (add) and decrease quantities (delete) of products for a given warehouse.')); - $this->displayInformation($this->l('Furthermore, you can move quantities of (transfer) products between warehouses, or within one warehouse.').'
        '); - $this->displayInformation($this->l('Note that if you want to increase quantities of multiple products at once, you can use the "Supply orders" page under the "Stock" menu.').'
        '); - $this->displayInformation($this->l('Finally, you will be asked to specify the state of the quantity you will add:')); + $this->displayInformation($this->l('This interface allows you to manage product stock and their variations.').'
        '); + $this->displayInformation($this->l('Through this interface, you can increase and decrease product stock for an given warehouse.')); + $this->displayInformation($this->l('Furthermore, you can alter product quantities between warehouses, or within one warehouse.').'
        '); + $this->displayInformation($this->l('If you want to increase quantities of multiple products at once, you can use the "Supply orders" page under the "Stock" menu.').'
        '); + $this->displayInformation($this->l('Finally, you need to provide the quantity that you\'ll be adding:')); $this->displayInformation($this->l('Usable for sale means that this quantity will be available in your shop(s),')); $this->displayInformation($this->l('otherwise it will be considered reserved (i.e. for other purposes).')); @@ -131,7 +131,7 @@ class AdminStockManagementControllerCore extends AdminController // displays warning if no warehouses if (!$warehouses_add) - $this->displayWarning($this->l('You have to have Warehouses before adding stock. See Stock/Warehouses')); + $this->displayWarning($this->l('You must choose a warehouses before adding stock. See Stock/Warehouses')); //get currencies list $currencies = Currency::getCurrencies(); @@ -160,12 +160,12 @@ class AdminStockManagementControllerCore extends AdminController $last_sm_unit_price_te = Tools::displayPrice((float)$last_sm['price_te'], $last_sm_currency); } - $this->displayInformation($this->l('Note that rolling over the quantity and price fields will give you the details of the last stock movement.')); + $this->displayInformation($this->l('Rolling over the quantity and price fields will give you the details about the last stock movement.')); // fields in the form $this->fields_form[]['form'] = array( 'legend' => array( - 'title' => $this->l('Add product to stock'), + 'title' => $this->l('Add a product to your stock.'), 'image' => '../img/admin/add_stock.png' ), 'input' => array( @@ -224,7 +224,7 @@ class AdminStockManagementControllerCore extends AdminController 'hint' => sprintf( $this->l('Last physical quantity added : %s (%s)'), ($last_sm_quantity > 0 ? $last_sm_quantity : $this->l('N/A')), - ($last_sm_quantity > 0 ? ($last_sm_quantity_is_usable >= 0 ? $this->l('usable') : $this->l('not usable')) : $this->l('N/A'))), + ($last_sm_quantity > 0 ? ($last_sm_quantity_is_usable >= 0 ? $this->l('Usable') : $this->l('Not usable')) : $this->l('N/A'))), ), array( 'type' => 'radio', @@ -245,7 +245,7 @@ class AdminStockManagementControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Is this quantity usable for sale on shops, or reserved in the warehouse for other purposes?') + 'desc' => $this->l('Is this quantity ready to be displayed in your shop, or is it reserved in the warehouse for other purposes?') ), array( 'type' => 'select', @@ -257,7 +257,7 @@ class AdminStockManagementControllerCore extends AdminController 'id' => 'id_warehouse', 'name' => 'name' ), - 'desc' => $this->l('Select the warehouse where you want to add the product into') + 'desc' => $this->l('Please select the warehouse that you\'ll be adding products to. ') ), array( 'type' => 'text', @@ -279,7 +279,7 @@ class AdminStockManagementControllerCore extends AdminController 'id' => 'id_currency', 'name' => 'name' ), - 'desc' => $this->l('The currency associated to the product unit price'), + 'desc' => $this->l('The currency associated to the product unit price.'), ), array( 'type' => 'select', @@ -307,7 +307,7 @@ class AdminStockManagementControllerCore extends AdminController case 'removestock' : $this->fields_form[]['form'] = array( 'legend' => array( - 'title' => $this->l('Remove product from stock'), + 'title' => $this->l('Remove the product from your stock.'), 'image' => '../img/admin/remove_stock.png' ), 'input' => array( @@ -388,7 +388,7 @@ class AdminStockManagementControllerCore extends AdminController 'id' => 'id_warehouse', 'name' => 'name' ), - 'desc' => $this->l('Select the warehouse from where you want to remove the product') + 'desc' => $this->l('Select the warehouse you\'d like to remove the product from.') ), array( 'type' => 'select', @@ -415,7 +415,7 @@ class AdminStockManagementControllerCore extends AdminController case 'transferstock' : $this->fields_form[]['form'] = array( 'legend' => array( - 'title' => $this->l('Transfer product from one warehouse to another'), + 'title' => $this->l('Transfer a product from one warehouse to another'), 'image' => '../img/admin/transfer_stock.png' ), 'input' => array( @@ -475,11 +475,11 @@ class AdminStockManagementControllerCore extends AdminController 'id' => 'id_warehouse', 'name' => 'name' ), - 'desc' => $this->l('Select the warehouse from which you want to transfer the product.') + 'desc' => $this->l('Select the warehouse you\'d like to transfer the product from.') ), array( 'type' => 'radio', - 'label' => $this->l('Usable for sale in source warehouse?'), + 'label' => $this->l('Is this product usable in your source warehouse?'), 'name' => 'usable_from', 'required' => true, 'class' => 't', @@ -496,11 +496,11 @@ class AdminStockManagementControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Is this a usable quantity for sale?') + 'desc' => $this->l('Is this the usable quantity for sale?') ), array( 'type' => 'select', - 'label' => $this->l('Destination Warehouse:'), + 'label' => $this->l('Destination warehouse:'), 'name' => 'id_warehouse_to', 'required' => true, 'options' => array( @@ -508,11 +508,11 @@ class AdminStockManagementControllerCore extends AdminController 'id' => 'id_warehouse', 'name' => 'name' ), - 'desc' => $this->l('Select the warehouse to which to transfer the product.') + 'desc' => $this->l('Select the warehouse you\'d like to transfer your product(s) to. ') ), array( 'type' => 'radio', - 'label' => $this->l('Usable for sale in destination warehouse?'), + 'label' => $this->l('Is this product for sale in your destination warehouse?'), 'name' => 'usable_to', 'required' => true, 'class' => 't', @@ -529,7 +529,7 @@ class AdminStockManagementControllerCore extends AdminController 'label' => $this->l('Disabled') ) ), - 'desc' => $this->l('Do you want it to be usable for sale?') + 'desc' => $this->l('Do you want it to be for sale/useable?') ), ), 'submit' => array( @@ -555,7 +555,7 @@ class AdminStockManagementControllerCore extends AdminController if (Tools::isSubmit('addStock') && !($this->tabAccess['add'] === '1')) $this->errors[] = Tools::displayError('You do not have the required permission to add stock.'); if (Tools::isSubmit('removeStock') && !($this->tabAccess['delete'] === '1')) - $this->errors[] = Tools::displayError('You do not have the required permission to delete stock.'); + $this->errors[] = Tools::displayError('You do not have the required permission to delete stock'); if (Tools::isSubmit('transferStock') && !($this->tabAccess['edit'] === '1')) $this->errors[] = Tools::displayError('You do not have the required permission to transfer stock.'); @@ -680,11 +680,11 @@ class AdminStockManagementControllerCore extends AdminController $usable_quantity_in_stock = (int)$stock_manager->getProductPhysicalQuantities($id_product, $id_product_attribute, array($warehouse->id), true); $not_usable_quantity = ($physical_quantity_in_stock - $usable_quantity_in_stock); if ($usable_quantity_in_stock < $quantity) - $this->errors[] = sprintf(Tools::displayError('You don\'t have enough usable quantity. Could not remove %d out of %d.'), (int)$quantity, (int)$usable_quantity_in_stock); + $this->errors[] = sprintf(Tools::displayError('You don\'t have enough usable quantity. Cannot remove %d out of %d.'), (int)$quantity, (int)$usable_quantity_in_stock); else if ($not_usable_quantity < $quantity) - $this->errors[] = sprintf(Tools::displayError('You don\'t have enough quantity (not usable). Could not remove %d out of %d.'), (int)$quantity, (int)$not_usable_quantity); + $this->errors[] = sprintf(Tools::displayError('You don\'t have enough usable quantity. Cannot remove %d out of %d.'), (int)$quantity, (int)$not_usable_quantity); else - $this->errors[] = Tools::displayError('It is not possible to remove the specified quantity or an error occurred. No stock was removed.'); + $this->errors[] = Tools::displayError('It is not possible to remove the specified quantity. Therefore no stock was removed.'); } } } @@ -704,13 +704,13 @@ class AdminStockManagementControllerCore extends AdminController // get usable flag for source warehouse $usable_from = Tools::getValue('usable_from', null); if (is_null($usable_from)) - $this->errors[] = Tools::displayError('You have to specify if the product quantity is usable for sale on shops in source warehouse.'); + $this->errors[] = Tools::displayError('You have to specify if the product quantity in your source warehous(es) is ready for sale.'); $usable_from = (bool)$usable_from; // get usable flag for destination warehouse $usable_to = Tools::getValue('usable_to', null); if (is_null($usable_to)) - $this->errors[] = Tools::displayError('You have to specify if the product quantity is usable for sale on shops in destination warehouse.'); + $this->errors[] = Tools::displayError('You have to specify if the product quantity in your destination warehous(es) is ready for sale.'); $usable_to = (bool)$usable_to; // if we can process stock transfers @@ -732,7 +732,7 @@ class AdminStockManagementControllerCore extends AdminController if ($is_transfer) Tools::redirectAdmin($redirect.'&conf=3'); else - $this->errors[] = Tools::displayError('It is not possible to transfer the specified quantity, or an error occurred. No stock was transferred.'); + $this->errors[] = Tools::displayError('It is not possible to transfer the specified quantity. No stock was transferred.'); } } } @@ -786,19 +786,19 @@ class AdminStockManagementControllerCore extends AdminController if (Tools::isSubmit('addstock')) { $this->display = 'addstock'; - $this->toolbar_title = $this->l('Stock: Add product'); + $this->toolbar_title = $this->l('Stock: Add a product'); } if (Tools::isSubmit('removestock')) { $this->display = 'removestock'; - $this->toolbar_title = $this->l('Stock: Remove product'); + $this->toolbar_title = $this->l('Stock: Remove a product'); } if (Tools::isSubmit('transferstock')) { $this->display = 'transferstock'; - $this->toolbar_title = $this->l('Stock: Transfer product'); + $this->toolbar_title = $this->l('Stock: Transfer a product'); } } @@ -952,7 +952,7 @@ class AdminStockManagementControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to using this feature.'); return false; } @@ -1060,8 +1060,8 @@ class AdminStockManagementControllerCore extends AdminController { $helper->fields_value['id_warehouse_from'] = Tools::getValue('id_warehouse_from', ''); $helper->fields_value['id_warehouse_to'] = Tools::getValue('id_warehouse_to', ''); - $helper->fields_value['usable_from'] = Tools::getValue('usable_from', ''); - $helper->fields_value['usable_to'] = Tools::getValue('usable_to', ''); + $helper->fields_value['usable_from'] = Tools::getValue('usable_from', '1'); + $helper->fields_value['usable_to'] = Tools::getValue('usable_to', '1'); } $this->content .= $helper->generateForm($this->fields_form); @@ -1071,7 +1071,7 @@ class AdminStockManagementControllerCore extends AdminController )); } else - $this->errors[] = Tools::displayError('The specified product is not valid'); + $this->errors[] = Tools::displayError('The product specified is not valid.'); } } else @@ -1148,7 +1148,7 @@ class AdminStockManagementControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to using this feature.'); return false; } parent::initProcess(); diff --git a/controllers/admin/AdminStockMvtController.php b/controllers/admin/AdminStockMvtController.php index 7a548e4e0..cfba4037f 100644 --- a/controllers/admin/AdminStockMvtController.php +++ b/controllers/admin/AdminStockMvtController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -187,7 +187,7 @@ class AdminStockMvtControllerCore extends AdminController die; } else - $this->displayWarning($this->l('There is nothing to export as CSV.')); + $this->displayWarning($this->l('There is nothing to export as a CSV.')); } return $list; @@ -297,7 +297,7 @@ class AdminStockMvtControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initContent(); @@ -307,7 +307,7 @@ class AdminStockMvtControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initProcess(); diff --git a/controllers/admin/AdminStoresController.php b/controllers/admin/AdminStoresController.php index 288787ee7..ec9175901 100644 --- a/controllers/admin/AdminStoresController.php +++ b/controllers/admin/AdminStoresController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -163,7 +163,7 @@ class AdminStoresControllerCore extends AdminController 'size' => 33, 'required' => false, 'hint' => sprintf($this->l('Allowed characters: letters, spaces and %s'), '().-'), - 'desc' => $this->l('Store name (e.g. Citycentre Mall Store)') + 'desc' => $this->l('Store name (e.g. City Center Mall Store)') ), array( 'type' => 'text', @@ -238,7 +238,7 @@ class AdminStoresControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('E-mail address'), + 'label' => $this->l('Email address'), 'name' => 'email', 'size' => 33 ), @@ -296,8 +296,12 @@ class AdminStoresControllerCore extends AdminController if (!($obj = $this->loadObject(true))) return; + + if (file_exists(_PS_TMP_IMG_DIR_.$this->table.'_'.(int)$obj->id.'.'.$this->imageType)) { + @unlink(_PS_TMP_IMG_DIR_.$this->table.'_'.(int)$obj->id.'.'.$this->imageType); + } - $image = ImageManager::thumbnail(_PS_STORE_IMG_DIR_.'/'.$obj->id.'.jpg', $this->table.'_'.(int)$obj->id.'.'.$this->imageType, 350, $this->imageType, true); + $image = ImageManager::thumbnail(_PS_STORE_IMG_DIR_.DIRECTORY_SEPARATOR.$obj->id.'.jpg', $this->table.'_'.(int)$obj->id.'.'.$this->imageType, 350, $this->imageType, true, true); $days = array(); $days[1] = $this->l('Monday'); @@ -316,7 +320,7 @@ class AdminStoresControllerCore extends AdminController 'latitude' => $this->getFieldValue($obj, 'latitude') ? $this->getFieldValue($obj, 'latitude') : Configuration::get('PS_STORES_CENTER_LAT'), 'longitude' => $this->getFieldValue($obj, 'longitude') ? $this->getFieldValue($obj, 'longitude') : Configuration::get('PS_STORES_CENTER_LONG'), 'image' => $image ? $image : false, - 'size' => $image ? filesize(_PS_STORE_IMG_DIR_.'/'.$obj->id.'.jpg') / 1000 : false, + 'size' => $image ? filesize(_PS_STORE_IMG_DIR_.DIRECTORY_SEPARATOR.$obj->id.'.jpg') / 1000 : false, 'days' => $days, 'hours' => isset($hours_unserialized) ? $hours_unserialized : false ); @@ -343,7 +347,7 @@ class AdminStoresControllerCore extends AdminController $country = new Country((int)$id_country); if ($id_country && $country && !(int)$country->contains_states && $id_state) - $this->errors[] = Tools::displayError('You have selected a state for a country that does not contain states.'); + $this->errors[] = Tools::displayError('You\'ve selected a state for a country that does not contain states.'); /* If the selected country contains states, then a state have to be selected */ if ((int)$country->contains_states && !$id_state) @@ -354,40 +358,15 @@ class AdminStoresControllerCore extends AdminController if (empty($latitude) || empty($longitude)) $this->errors[] = Tools::displayError('Latitude and longitude are required.'); - - /* Check zip code */ - if ($country->need_zip_code) - { - $zip_code_format = $country->zip_code_format; - if (($postcode = Tools::getValue('postcode')) && $zip_code_format) - { - $zip_regexp = '/^'.$zip_code_format.'$/ui'; - $zip_regexp = str_replace(' ', '( |)', $zip_regexp); - $zip_regexp = str_replace('-', '(-|)', $zip_regexp); - $zip_regexp = str_replace('N', '[0-9]', $zip_regexp); - $zip_regexp = str_replace('L', '[a-zA-Z]', $zip_regexp); - $zip_regexp = str_replace('C', $country->iso_code, $zip_regexp); - if (!preg_match($zip_regexp, $postcode)) - $this->errors[] = Tools::displayError('Your Postal Code/Zip Code is incorrect.').'
        '.Tools::displayError('Must be typed as follows:').' '. - str_replace( - 'C', - $country->iso_code, - str_replace( - 'N', - '0', - str_replace( - 'L', - 'A', - $zip_code_format - ) - ) - ); - } - else if ($zip_code_format) - $this->errors[] = Tools::displayError('Postal Code/Zip Code required.'); - else if ($postcode && !preg_match('/^[0-9a-zA-Z -]{4,9}$/ui', $postcode)) - $this->errors[] = Tools::displayError('Your Postal Code/Zip Code is incorrect.'); - } + + $postcode = Tools::getValue('postcode'); + /* Check zip code format */ + if ($country->zip_code_format && !$country->checkZipCode($postcode)) + $this->errors[] = Tools::displayError('Your Postal / Zip Code is incorrect.').'
        '.Tools::displayError('It must be entered as follows:').' '.str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $country->zip_code_format))); + elseif(empty($postcode) && $country->need_zip_code) + $this->errors[] = Tools::displayError('A Zip / Postal code is required.'); + elseif ($postcode && !Validate::isPostCode($postcode)) + $this->errors[] = Tools::displayError('The Zip / Postal code is invalid.'); /* Store hours */ $_POST['hours'] = array(); @@ -434,14 +413,14 @@ class AdminStoresControllerCore extends AdminController $formFields = array( 'PS_SHOP_NAME' => array( 'title' => $this->l('Shop name'), - 'desc' => $this->l('Displayed in e-mails and page titles'), + 'desc' => $this->l('Displayed in emails and page titles'), 'validation' => 'isGenericName', 'required' => true, 'size' => 30, 'type' => 'text' ), - 'PS_SHOP_EMAIL' => array('title' => $this->l('Shop e-mail'), - 'desc' => $this->l('Displayed in e-mails sent to customers'), + 'PS_SHOP_EMAIL' => array('title' => $this->l('Shop email'), + 'desc' => $this->l('Displayed in emails sent to customers'), 'validation' => 'isEmail', 'required' => true, 'size' => 30, @@ -557,7 +536,7 @@ class AdminStoresControllerCore extends AdminController AND `id_state` = '.(int)Tools::getValue('PS_SHOP_STATE_ID'); $isStateOk = Db::getInstance()->getValue($sql); if ($isStateOk != 1) - $this->errors[] = Tools::displayError('This state is not in this country.'); + $this->errors[] = Tools::displayError('The state specified is not located in this country.'); } } diff --git a/controllers/admin/AdminSuppliersController.php b/controllers/admin/AdminSuppliersController.php index 9059907bc..22e30efb4 100644 --- a/controllers/admin/AdminSuppliersController.php +++ b/controllers/admin/AdminSuppliersController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,6 +34,8 @@ class AdminSuppliersControllerCore extends AdminController $this->addRowAction('view'); $this->addRowAction('edit'); $this->addRowAction('delete'); + $this->allow_export = true; + $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->_select = 'COUNT(DISTINCT ps.`id_product`) AS products'; @@ -78,7 +80,7 @@ class AdminSuppliersControllerCore extends AdminController ), array( 'type' => 'text', - 'label' => $this->l('Name:'), + 'label' => $this->l('Name'), 'name' => 'name', 'size' => 40, 'required' => true, @@ -92,7 +94,7 @@ class AdminSuppliersControllerCore extends AdminController 'rows' => 10, 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', - 'desc' => $this->l('Will appear in supplier list') + 'desc' => $this->l('Will appear in the supplier list') ), array( 'type' => 'text', @@ -100,7 +102,7 @@ class AdminSuppliersControllerCore extends AdminController 'name' => 'phone', 'size' => 15, 'maxlength' => 16, - 'desc' => $this->l('Phone number of this supplier') + 'desc' => $this->l('Phone number for this supplier') ), array( 'type' => 'text', @@ -144,7 +146,6 @@ class AdminSuppliersControllerCore extends AdminController 'id' => 'id_country', 'name' => 'name', ), - 'desc' => $this->l('Country where the state, region or city is located') ), array( 'type' => 'select', @@ -161,7 +162,7 @@ class AdminSuppliersControllerCore extends AdminController 'label' => $this->l('Logo:'), 'name' => 'logo', 'display_image' => true, - 'desc' => $this->l('Upload supplier logo from your computer') + 'desc' => $this->l('Upload a supplier logo from your computer') ), array( 'type' => 'text', @@ -183,7 +184,7 @@ class AdminSuppliersControllerCore extends AdminController 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Forbidden characters:').' <>;=#{}', - 'desc' => $this->l('To add "tags" click in the field, write something, then press "Enter"') + 'desc' => $this->l('To add "tags" click in the field, write something and then press "Enter"') ), array( 'type' => 'radio', @@ -347,7 +348,7 @@ class AdminSuppliersControllerCore extends AdminController // checks access if (Tools::isSubmit('submitAdd'.$this->table) && !($this->tabAccess['add'] === '1')) { - $this->errors[] = Tools::displayError('You do not have the required permissions to add suppliers.'); + $this->errors[] = Tools::displayError('You do not have permission to add suppliers.'); return parent::postProcess(); } @@ -380,7 +381,7 @@ class AdminSuppliersControllerCore extends AdminController { foreach ($validation as $item) $this->errors[] = $item; - $this->errors[] = Tools::displayError('The address is not correct. Check if all required fields are filled.'); + $this->errors[] = Tools::displayError('The address is not correct. Please make sure all of the required fields are completed.'); } else { @@ -399,7 +400,7 @@ class AdminSuppliersControllerCore extends AdminController if (!($obj = $this->loadObject(true))) return; else if (SupplyOrder::supplierHasPendingOrders($obj->id)) - $this->errors[] = $this->l('It is not possible to delete a supplier if there are any pending supplier orders.'); + $this->errors[] = $this->l('It is not possible to delete a supplier if there are pending supplier orders.'); else { //delete all product_supplier linked to this supplier diff --git a/controllers/admin/AdminSupplyOrdersController.php b/controllers/admin/AdminSupplyOrdersController.php index 1d7f81cb2..c9ee41b3f 100644 --- a/controllers/admin/AdminSupplyOrdersController.php +++ b/controllers/admin/AdminSupplyOrdersController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -140,7 +140,7 @@ class AdminSupplyOrdersControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') $this->display = 'edit'; else - $this->errors[] = Tools::displayError($this->l('You do not have permission to edit here.')); + $this->errors[] = Tools::displayError($this->l('You do not have permission to edit this.')); } if (Tools::isSubmit('update_receipt') && Tools::isSubmit('id_supply_order')) @@ -166,10 +166,10 @@ class AdminSupplyOrdersControllerCore extends AdminController { if (Tools::isSubmit('addsupply_order') || Tools::isSubmit('submitAddsupply_order')) - $this->toolbar_title = $this->l('Stock: Create new supply order'); + $this->toolbar_title = $this->l('Stock: Create a new supply order'); if (Tools::isSubmit('updatesupply_order') || Tools::isSubmit('submitUpdatesupply_order')) - $this->toolbar_title = $this->l('Stock: Manage supply order'); + $this->toolbar_title = $this->l('Stock: Manage supply orders'); if (Tools::isSubmit('mod') && Tools::getValue('mod') === 'template' || $this->object->is_template) $this->toolbar_title .= ' ('.$this->l('template').')'; @@ -212,7 +212,7 @@ class AdminSupplyOrdersControllerCore extends AdminController 'name' => 'reference', 'size' => 50, 'required' => true, - 'desc' => $this->l('This is the reference for your order.'), + 'desc' => $this->l('Here\'s the reference number for your order.'), ), array( 'type' => 'select', @@ -224,8 +224,8 @@ class AdminSupplyOrdersControllerCore extends AdminController 'id' => 'id_supplier', 'name' => 'name' ), - 'desc' => $this->l('Select the supplier from whom you are buying products.'), - 'hint' => $this->l('Be careful! When changing this field, all products already added to the order will be removed.') + 'desc' => $this->l('Select the supplier you\'ll be purchasing from.'), + 'hint' => $this->l('Warning: All products already added to the order will be removed.') ), array( 'type' => 'select', @@ -237,7 +237,7 @@ class AdminSupplyOrdersControllerCore extends AdminController 'id' => 'id_warehouse', 'name' => 'name' ), - 'desc' => $this->l('Select the warehouse to which you want the order to be sent.'), + 'desc' => $this->l('Which warehouse will the order be sent to?'), ), array( 'type' => 'select', @@ -250,7 +250,7 @@ class AdminSupplyOrdersControllerCore extends AdminController 'name' => 'name' ), 'desc' => $this->l('The currency of the order.'), - 'hint' => $this->l('Be careful! When changing this field, all products already added to the order will be removed.') + 'hint' => $this->l('Warning: All products already added to the order will be removed.') ), array( 'type' => 'select', @@ -279,7 +279,7 @@ class AdminSupplyOrdersControllerCore extends AdminController 'size' => 10, 'required' => false, 'hint' => $this->l('This will reset the order'), - 'desc' => $this->l('If specified, each product which quantity is less than or equal to this value will be loaded.'), + 'desc' => $this->l('If specified, each product quantity less than or equal to this value will be loaded.'), ), ), 'submit' => array( @@ -309,7 +309,7 @@ class AdminSupplyOrdersControllerCore extends AdminController 'name' => 'date_delivery_expected', 'size' => 10, 'required' => true, - 'desc' => $this->l('This is the expected delivery date for this order.'), + 'desc' => $this->l('The expected delivery date for this order is...'), ); } @@ -327,14 +327,14 @@ class AdminSupplyOrdersControllerCore extends AdminController } $this->displayInformation( - $this->l('Please note that if you wish to order products, they have to be available for the specified Supplier/Warehouse.') + $this->l('If you wish to order products, they have to be available for the specified supplier/warehouse.') .' '. $this->l('See Catalog/Products/Your Product/Suppliers & Warehouses') .'
        '. - $this->l('Also, changing the currency or the supplier will reset the order.') + $this->l('Changing the currency or the supplier will reset the order.') .'
        ' .'
        '. - $this->l('Finally, please note that you can only order from one supplier at a time.') + $this->l('Please note that you can only order from one supplier at a time.') ); return parent::renderForm(); } @@ -371,7 +371,7 @@ class AdminSupplyOrdersControllerCore extends AdminController { $this->toolbar_btn['new'] = array( 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token, - 'desc' => $this->l('Add new') + 'desc' => $this->l('Add New') ); } } @@ -417,10 +417,10 @@ class AdminSupplyOrdersControllerCore extends AdminController public function renderList() { $this->displayInformation($this->l('This interface allows you to manage supply orders.').'
        '); - $this->displayInformation($this->l('Also, you can create templates that you can use later to generate actual orders.').'
        '); + $this->displayInformation($this->l('You can create templates to generate actual orders.').'
        '); if (count($this->warehouses) <= 1) - $this->displayWarning($this->l('You must have at least one warehouse before creating supply orders. See Stock/Warehouses')); + $this->displayWarning($this->l('You must choose at least one warehouse before creating supply orders. For more information, see Stock/Warehouses.')); // assigns warehouses $this->tpl_list_vars['warehouses'] = $this->warehouses; @@ -574,12 +574,12 @@ class AdminSupplyOrdersControllerCore extends AdminController // defines the fields of the form to display $this->fields_form[]['form'] = array( 'legend' => array( - 'title' => $this->l('Supply Order Status'), + 'title' => $this->l('Supply order status'), 'image' => '../img/admin/cms.gif' ), ); - $this->displayInformation($this->l('Be careful when changing status. Some of them cannot be changed afterwards (Canceled, for instance).')); + $this->displayInformation($this->l('Be careful when changing status\'. Some of those changes cannot be canceled. ')); // sets up the helper $helper = new HelperForm(); @@ -826,8 +826,8 @@ class AdminSupplyOrdersControllerCore extends AdminController // display these global order informations $this->displayInformation($this->l('This interface allows you to update the quantities of this ongoing order.').'
        '); - $this->displayInformation($this->l('Be careful : once you update, you cannot go back unless you add new negative stock movements.').'
        '); - $this->displayInformation($this->l('Please not that a green line means that you received what you expected, and a red line means that you received more than expected.').'
        '); + $this->displayInformation($this->l('Be careful! Once you update, you cannot go back unless you add new negative stock movements.').'
        '); + $this->displayInformation($this->l('A green line means that you\'ve received what you expected. A red line means that you\'ve received more than expected.').'
        '); // generates content $content = $helper->generateList($this->_list, $this->fields_list); @@ -846,7 +846,7 @@ class AdminSupplyOrdersControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to using this feature.'); return false; } // Manage the add stock form @@ -998,7 +998,7 @@ class AdminSupplyOrdersControllerCore extends AdminController $error_str = '
          '; foreach ($errors as $e) - $error_str .= '
        • '.$this->l('field').$e.'
        • '; + $error_str .= '
        • '.$this->l('Field').$e.'
        • '; $error_str .= '
        '; $this->errors[] = Tools::displayError($this->l('Please verify the product information:').$entry->name.' '.$error_str); @@ -1021,9 +1021,9 @@ class AdminSupplyOrdersControllerCore extends AdminController // Checks access if (Tools::isSubmit('submitAddsupply_order') && !($this->tabAccess['add'] === '1')) - $this->errors[] = Tools::displayError($this->l('You do not have the required permission to add a supply order.')); + $this->errors[] = Tools::displayError($this->l('You do not have permission to add a supply order.')); if (Tools::isSubmit('submitBulkUpdatesupply_order_detail') && !($this->tabAccess['edit'] === '1')) - $this->errors[] = Tools::displayError($this->l('You do not have the required permission to edit an order.')); + $this->errors[] = Tools::displayError($this->l('You do not have permission to edit an order.')); // Trick to use both Supply Order as template and actual orders if (Tools::isSubmit('is_template')) @@ -1074,9 +1074,12 @@ class AdminSupplyOrdersControllerCore extends AdminController $this->errors[] = Tools::displayError($this->l('The date you specified cannot be in the past.')); // gets threshold - $quantity_threshold = null; - if (Tools::getValue('load_products') && Validate::isInt(Tools::getValue('load_products'))) - $quantity_threshold = (int)Tools::getValue('load_products'); + $quantity_threshold = Tools::getValue('load_products'); + + if (is_numeric($quantity_threshold)) + $quantity_threshold = (int)$quantity_threshold; + else + $quantity_threshold = null; if (!count($this->errors)) { @@ -1095,15 +1098,14 @@ class AdminSupplyOrdersControllerCore extends AdminController //specific discount check $_POST['discount_rate'] = (float)str_replace(array(' ', ','), array('', '.'), Tools::getValue('discount_rate', 0)); - } // manage each associated product $this->manageOrderProducts(); // if the threshold is defined and we are saving the order - if (Tools::isSubmit('submitAddsupply_order') && $quantity_threshold != null) - $this->loadProducts($quantity_threshold); + if (Tools::isSubmit('submitAddsupply_order') && Validate::isInt($quantity_threshold)) + $this->loadProducts((int)$quantity_threshold); } // Manage state change @@ -1122,7 +1124,7 @@ class AdminSupplyOrdersControllerCore extends AdminController // get supply order ID $id_supply_order = (int)Tools::getValue('id_supply_order', 0); if ($id_supply_order <= 0) - $this->errors[] = Tools::displayError($this->l('The supply order id is not valid.')); + $this->errors[] = Tools::displayError($this->l('The supply order ID is not valid.')); if (!count($this->errors)) { @@ -1146,7 +1148,7 @@ class AdminSupplyOrdersControllerCore extends AdminController // special case of validate state - check if there are products in the order and the required state is not an enclosed state if ($supply_order->isEditable() && !$supply_order->hasEntries() && !$new_state->enclosed) $this->errors[] = Tools::displayError( - $this->l('It is not possible to change the status of this order because you did not order any products') + $this->l('It is not possible to change the status of this order because you did not order any products.') ); if (!count($this->errors)) @@ -1298,7 +1300,7 @@ class AdminSupplyOrdersControllerCore extends AdminController $rows = Tools::getValue('supply_order_detailBox'); if (!$rows) { - $this->errors[] = Tools::displayError($this->l('You did not select any product to update')); + $this->errors[] = Tools::displayError($this->l('You did not select any products to update.')); return; } @@ -1314,7 +1316,7 @@ class AdminSupplyOrdersControllerCore extends AdminController // checks if there is something to update if (!count($to_update)) { - $this->errors[] = Tools::displayError($this->l('You did not select any product to update')); + $this->errors[] = Tools::displayError($this->l('You did not select any products to update.')); return; } @@ -1351,7 +1353,7 @@ class AdminSupplyOrdersControllerCore extends AdminController $warehouse = new Warehouse($supply_order->id_warehouse); if (!Validate::isLoadedObject($warehouse)) { - $this->errors[] = Tools::displayError($this->l('Warehouse could not be loaded')); + $this->errors[] = Tools::displayError($this->l('The warehouse could not be loaded.')); return; } @@ -1362,7 +1364,7 @@ class AdminSupplyOrdersControllerCore extends AdminController // first, converts the price to the default currency $price_converted_to_default_currency = Tools::convertPrice($supply_order_detail->unit_price_te, $supply_order->id_currency, false); - // then, converts the newly calculated price from the default currency to the needed currency + // then, converts the newly calculated pri-ce from the default currency to the needed currency $price = Tools::ps_round(Tools::convertPrice($price_converted_to_default_currency, $warehouse->id_currency, true), @@ -1378,14 +1380,27 @@ class AdminSupplyOrdersControllerCore extends AdminController $price, true, $supply_order->id); - if ($res) // if product has been added + + if (!$res) + $this->errors[] = Tools::displayError($this->l('Something went wrong when adding products to the warehouse.')); + + $location = Warehouse::getProductLocation($supply_order_detail->id_product, + $supply_order_detail->id_product_attribute, + $warehouse->id); + + $res = Warehouse::setProductlocation($supply_order_detail->id_product, + $supply_order_detail->id_product_attribute, + $warehouse->id, + $location ? $location : ''); + + if ($res) { $supplier_receipt_history->add(); $supply_order_detail->save(); $supply_order->save(); } else - $this->errors[] = Tools::displayError($this->l('Something went wrong when adding products to the warehouse')); + $this->errors[] = Tools::displayError($this->l('Something went wrong when setting warehouse on product record')); } } } @@ -1408,7 +1423,7 @@ class AdminSupplyOrdersControllerCore extends AdminController public function displayUpdateReceiptLink($token = null, $id) { if (!array_key_exists('Receipt', self::$cache_lang)) - self::$cache_lang['Receipt'] = $this->l('Update ongoing receipt of products'); + self::$cache_lang['Receipt'] = $this->l('Update ongoing receipt of products.'); $this->context->smarty->assign(array( 'href' => self::$currentIndex. @@ -1450,7 +1465,7 @@ class AdminSupplyOrdersControllerCore extends AdminController public function displayCreateSupplyOrderLink($token = null, $id) { if (!array_key_exists('CreateSupplyOrder', self::$cache_lang)) - self::$cache_lang['CreateSupplyOrder'] = $this->l('Use this template to create a supply order'); + self::$cache_lang['CreateSupplyOrder'] = $this->l('Use this template to create a supply order.'); if (!array_key_exists('CreateSupplyOrderConfirm', self::$cache_lang)) self::$cache_lang['CreateSupplyOrderConfirm'] = $this->l('Are you sure you want to use this template?'); @@ -1695,9 +1710,9 @@ class AdminSupplyOrdersControllerCore extends AdminController if (Validate::isLoadedObject($supply_order)) { if (!$supply_order->is_template) - $this->displayInformation($this->l('This interface allows you to display detailed information on your order.').'
        '); + $this->displayInformation($this->l('This interface allows you to display detailed information about your order.').'
        '); else - $this->displayInformation($this->l('This interface allows you to display detailed information on your order template.').'
        '); + $this->displayInformation($this->l('This interface allows you to display detailed information about your order template.').'
        '); $lang_id = (int)$supply_order->id_lang; @@ -1877,9 +1892,9 @@ class AdminSupplyOrdersControllerCore extends AdminController 'supply_order_warehouse' => (Validate::isLoadedObject($warehouse) ? $warehouse->name : ''), 'supply_order_reference' => $supply_order->reference, 'supply_order_supplier_name' => $supply_order->supplier_name, - 'supply_order_creation_date' => Tools::displayDate($supply_order->date_add, $lang_id, false), - 'supply_order_last_update' => Tools::displayDate($supply_order->date_upd, $lang_id, false), - 'supply_order_expected' => Tools::displayDate($supply_order->date_delivery_expected, $lang_id, false), + 'supply_order_creation_date' => Tools::displayDate($supply_order->date_add,null , false), + 'supply_order_last_update' => Tools::displayDate($supply_order->date_upd,null , false), + 'supply_order_expected' => Tools::displayDate($supply_order->date_delivery_expected,null , false), 'supply_order_discount_rate' => Tools::ps_round($supply_order->discount_rate, 2), 'supply_order_total_te' => Tools::displayPrice($supply_order->total_te, $currency), 'supply_order_discount_value_te' => Tools::displayPrice($supply_order->discount_value_te, $currency), @@ -1980,7 +1995,7 @@ class AdminSupplyOrdersControllerCore extends AdminController */ protected function afterAdd($object) { - if (Tools::getValue('load_products') && Validate::isInt(Tools::getValue('load_products'))) + if (is_numeric(Tools::getValue('load_products'))) $this->loadProducts((int)Tools::getValue('load_products')); $this->object = $object; @@ -2053,7 +2068,7 @@ class AdminSupplyOrdersControllerCore extends AdminController $diff = (int)$threshold - (int)$real_quantity; } - if ($diff > 0) + if ($diff >= 0) { // sets supply_order_detail $supply_order_detail = new SupplyOrderDetail(); @@ -2066,7 +2081,7 @@ class AdminSupplyOrdersControllerCore extends AdminController $supply_order_detail->name = Product::getProductName($item['id_product'], $item['id_product_attribute'], $supply_order->id_lang); $supply_order_detail->ean13 = $item['ean13']; $supply_order_detail->upc = $item['upc']; - $supply_order_detail->quantity_expected = (int)$diff; + $supply_order_detail->quantity_expected = ((int)$diff == 0) ? 1 : (int)$diff; $supply_order_detail->exchange_rate = $order_currency->conversion_rate; $product_currency = new Currency($item['id_currency']); @@ -2173,7 +2188,7 @@ class AdminSupplyOrdersControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to using this feature.'); return false; } parent::initProcess(); diff --git a/controllers/admin/AdminTabsController.php b/controllers/admin/AdminTabsController.php index 3c7ee6add..beb37e2f1 100644 --- a/controllers/admin/AdminTabsController.php +++ b/controllers/admin/AdminTabsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -31,6 +31,7 @@ class AdminTabsControllerCore extends AdminController public function __construct() { $this->context = Context::getContext(); + $this->multishop_context = Shop::CONTEXT_ALL; $this->table = 'tab'; $this->className = 'Tab'; $this->lang = true; @@ -135,7 +136,7 @@ class AdminTabsControllerCore extends AdminController 'type' => 'file', 'label' => $this->l('Icon:'), 'name' => 'icon', - 'desc' => $this->l('Upload logo from your computer (.gif, .jpg, .jpeg or .png).') + 'desc' => $this->l('Upload a logo from your computer (.gif, .jpg, .jpeg or .png).') ), array( 'type' => 'radio', @@ -158,16 +159,6 @@ class AdminTabsControllerCore extends AdminController ), 'desc' => $this->l('Show or hide menu.') ), - array( - 'type' => 'select', - 'label' => $this->l('Parent:'), - 'name' => 'id_parent', - 'options' => array( - 'query' => $tabs, - 'id' => 'id_tab', - 'name' => 'name' - ) - ) ), 'submit' => array( 'title' => $this->l(' Save '), @@ -175,6 +166,22 @@ class AdminTabsControllerCore extends AdminController ) ); + $display_parent = true; + if (Validate::isLoadedObject($this->object) && !class_exists($this->object->class_name.'Controller')) + $display_parent = false; + + if ($display_parent) + $this->fields_form['input'][] = array( + 'type' => 'select', + 'label' => $this->l('Parent:'), + 'name' => 'id_parent', + 'options' => array( + 'query' => $tabs, + 'id' => 'id_tab', + 'name' => 'name' + ) + ); + return parent::renderForm(); } @@ -261,9 +268,9 @@ class AdminTabsControllerCore extends AdminController elseif (Tools::getValue('position') && !Tools::isSubmit('submitAdd'.$this->table)) { if ($this->tabAccess['edit'] !== '1') - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); elseif (!Validate::isLoadedObject($object = new Tab((int)Tools::getValue($this->identifier)))) - $this->errors[] = Tools::displayError('An error occurred while updating status for object.'). + $this->errors[] = Tools::displayError('An error occurred while updating the status for an object.'). ' '.$this->table.' '.Tools::displayError('(cannot load object)'); if (!$object->updatePosition((int)Tools::getValue('way'), (int)Tools::getValue('position'))) $this->errors[] = Tools::displayError('Failed to update the position.'); @@ -271,7 +278,7 @@ class AdminTabsControllerCore extends AdminController Tools::redirectAdmin(self::$currentIndex.'&conf=5&token='.Tools::getAdminTokenLite('AdminTabs')); } elseif (Tools::isSubmit('submitAddtab') && Tools::getValue('id_tab') === Tools::getValue('id_parent')) - $this->errors[] = Tools::displayError('You can\'t put this menu in itself'); + $this->errors[] = Tools::displayError('You can\'t put this menu inside itself. '); else { // Temporary add the position depend of the selection of the parent category @@ -323,4 +330,4 @@ class AdminTabsControllerCore extends AdminController } } } -} +} \ No newline at end of file diff --git a/controllers/admin/AdminTagsController.php b/controllers/admin/AdminTagsController.php index 070c44d16..57a158d37 100644 --- a/controllers/admin/AdminTagsController.php +++ b/controllers/admin/AdminTagsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -47,7 +47,7 @@ class AdminTagsControllerCore extends AdminController 'filter_key' => 'a!name' ), 'products' => array( - 'title' => $this->l('Products'), + 'title' => $this->l('Products:'), 'align' => 'right', 'havingFilter' => true ) @@ -77,8 +77,23 @@ class AdminTagsControllerCore extends AdminController public function postProcess() { if ($this->tabAccess['edit'] === '1' && Tools::getValue('submitAdd'.$this->table)) + { if (($id = (int)Tools::getValue($this->identifier)) && ($obj = new $this->className($id)) && Validate::isLoadedObject($obj)) + { + $previousProducts = $obj->getProducts(); + $removedProducts = array(); + + foreach ($previousProducts as $product) + if (!in_array($product['id_product'], $_POST['products'])) + $removedProducts[] = $product['id_product']; + + if (Configuration::get('PS_SEARCH_INDEXATION')) + Search::removeProductsSearchIndex($removedProducts); + $obj->setProducts($_POST['products']); + } + } + return parent::postProcess(); } diff --git a/controllers/admin/AdminTaxRulesGroupController.php b/controllers/admin/AdminTaxRulesGroupController.php index c7621c90f..63772700d 100644 --- a/controllers/admin/AdminTaxRulesGroupController.php +++ b/controllers/admin/AdminTaxRulesGroupController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -95,7 +95,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController 'width' => 140 ), 'zipcode' => array( - 'title' => $this->l('Zip Codes'), + 'title' => $this->l('Zip Code'), 'width' => 25, ), 'behavior' => array( @@ -131,6 +131,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController $this->_where = 'AND `id_tax_rules_group` = '.(int)$id_group; $this->show_toolbar = false; + $this->tpl_list_vars = array('id_tax_rules_group' => (int)$id_group); return parent::renderList(); } @@ -191,7 +192,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController $this->no_back = true; $this->toolbar_btn['new'] = array( 'href' => '#', - 'desc' => $this->l('Add new tax rule') + 'desc' => $this->l('Add a new tax rule') ); $content = parent::renderForm(); $this->tpl_folder = 'tax_rules/'; @@ -257,7 +258,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController 'label' => $this->l('Zip Code range:'), 'name' => 'zipcode', 'required' => false, - 'hint' => $this->l('You can define a range (eg: 75000-75015) or a simple zipcode') + 'hint' => $this->l('You can define a range of zipcodes (eg: 75000-75015) or simply use one zipcode.') ), array( 'type' => 'select', @@ -276,7 +277,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController ), array( 'id' => 2, - 'name' => $this->l('One After Another') + 'name' => $this->l('One after another') ) ), 'id' => 'id', @@ -285,8 +286,8 @@ class AdminTaxRulesGroupControllerCore extends AdminController 'hint' => $this->l('Define the behavior if an address matches multiple rules:').'
        '.$this->l('This Tax Only:').' '.$this->l('Will apply only this tax').'
        - '.$this->l('Combine:').' '.$this->l('Combine taxes (eg: 10% + 5% => 15%)').'
        - '.$this->l('One After Another:').' '.$this->l('Apply taxes one after another (eg: 100€ + 10% => 110€ + 5% => 115.5€)') + '.$this->l('Combine:').' '.$this->l('Combine taxes (eg: 10% + 5% = 15%)').'
        + '.$this->l('One After Another:').' '.$this->l('Apply taxes one after another (eg: 0 + 10% = 0 + 5% = 5.5)') ), array( 'type' => 'select', @@ -298,7 +299,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController 'id' => 'id_tax', 'name' => 'name', 'default' => array( - 'value' => 'name', + 'value' => 0, 'label' => $this->l('No Tax') ) ), @@ -355,21 +356,21 @@ class AdminTaxRulesGroupControllerCore extends AdminController if ($this->tabAccess['delete'] === '1') $this->action = 'delete_tax_rule'; else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } else if (Tools::isSubmit('submitBulkdeletetax_rule')) { if ($this->tabAccess['delete'] === '1') $this->action = 'bulk_delete_tax_rules'; else - $this->errors[] = Tools::displayError('You do not have permission to delete here.'); + $this->errors[] = Tools::displayError('You do not have permission to delete this.'); } else if (Tools::getValue('action') == 'create_rule') { if ($this->tabAccess['add'] === '1') $this->action = 'create_rule'; else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } else parent::initProcess(); @@ -398,11 +399,16 @@ class AdminTaxRulesGroupControllerCore extends AdminController if (empty($this->selected_states) || count($this->selected_states) == 0) $this->selected_states = array(0); - + $tax_rules_group = new TaxRulesGroup((int)$id_tax_rules_group); foreach ($this->selected_countries as $id_country) { foreach ($this->selected_states as $id_state) { + if ($tax_rules_group->hasUniqueTaxRuleForCountry($id_country, $id_state, $id_rule)) + { + $this->errors[] = Tools::displayError('A tax rule already exists for this country/state with tax only behavior'); + continue; + } $tr = new TaxRule(); // update or creation? @@ -416,7 +422,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController list($tr->zipcode_from, $tr->zipcode_to) = $tr->breakDownZipCode($zip_code); // Construct Object Country - $country = new Country((int)$id_country); + $country = new Country((int)$id_country, (int)$this->context->language->id); if ($zip_code && $country->need_zip_code) { @@ -427,8 +433,8 @@ class AdminTaxRulesGroupControllerCore extends AdminController if (!$country->checkZipCode($zip_code)) { $this->errors[] = sprintf( - Tools::displayError('Zip/Postal code is invalid. Must be typed as follows: %s'), - str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $country->zip_code_format))) + Tools::displayError('Zip/Postal code is invalid. Must be typed as follows: %s for %s'), + str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $country->zip_code_format))), $country->name ); } } @@ -443,7 +449,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController if (count($this->errors) == 0) if (!$tr->save()) - $this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current tax rule'); + $this->errors[] = Tools::displayError('An error has occurred: Cannot save the current tax rule.'); } } diff --git a/controllers/admin/AdminTaxesController.php b/controllers/admin/AdminTaxesController.php index a063033d8..c03938943 100644 --- a/controllers/admin/AdminTaxesController.php +++ b/controllers/admin/AdminTaxesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -49,7 +49,7 @@ class AdminTaxesControllerCore extends AdminController $ecotax_desc = ''; if (Configuration::get('PS_USE_ECOTAX')) - $ecotax_desc = $this->l('If you disable the ecotax, the ecotax for all your products will be set to 0'); + $ecotax_desc = $this->l('If you disable the ecotax, the ecotax for all your products will be set to 0.'); $this->fields_options = array( 'general' => array( @@ -60,12 +60,12 @@ class AdminTaxesControllerCore extends AdminController 'desc' => $this->l('Select whether or not to include tax on purchases'), 'cast' => 'intval', 'type' => 'bool'), 'PS_TAX_DISPLAY' => array( - 'title' => $this->l('Display tax in cart:'), - 'desc' => $this->l('Select whether or not to display tax on a distinct line in the cart'), + 'title' => $this->l('Display tax in the shopping cart:'), + 'desc' => $this->l('Select whether or not to display tax on a distinct line in the cart.'), 'cast' => 'intval', 'type' => 'bool'), 'PS_TAX_ADDRESS_TYPE' => array( - 'title' => $this->l('Base on:'), + 'title' => $this->l('Based on:'), 'cast' => 'pSQL', 'type' => 'select', 'list' => array( @@ -80,7 +80,7 @@ class AdminTaxesControllerCore extends AdminController 'identifier' => 'id' ), 'PS_USE_ECOTAX' => array( - 'title' => $this->l('Use ecotax'), + 'title' => $this->l('Use ecotax:'), 'desc' => $ecotax_desc, 'validation' => 'isBool', 'cast' => 'intval', @@ -93,8 +93,8 @@ class AdminTaxesControllerCore extends AdminController if (Configuration::get('PS_USE_ECOTAX')) $this->fields_options['general']['fields']['PS_ECOTAX_TAX_RULES_GROUP_ID'] = array( - 'title' => $this->l('Ecotax:'), - 'desc' => $this->l('The tax to apply on the ecotax (e.g. French ecotax: 19.6%).'), + 'title' => $this->l('Ecotax'), + 'desc' => $this->l('Define the ecotax (e.g. French ecotax: 19.6%).'), 'cast' => 'intval', 'type' => 'select', 'identifier' => 'id_tax', @@ -103,6 +103,8 @@ class AdminTaxesControllerCore extends AdminController ); parent::__construct(); + + $this->_where .= ' AND a.deleted = 0'; } /** @@ -117,7 +119,7 @@ class AdminTaxesControllerCore extends AdminController self::$cache_lang['DeleteItem'] = $this->l('Delete item #', __CLASS__, true, false); if (TaxRule::isTaxInUse($id)) - $confirm = $this->l('This tax is currently in use in a tax rule. Are you sure you would like to continue?'); + $confirm = $this->l('This tax is currently in use as tax rule. Are you sure you\'d like to continue?'); $this->context->smarty->assign(array( 'href' => self::$currentIndex.'&'.$this->identifier.'='.$id.'&delete'.$this->table.'&token='.($token != null ? $token : $this->token), @@ -141,7 +143,7 @@ class AdminTaxesControllerCore extends AdminController public function displayEnableLink($token, $id, $value, $active, $id_category = null, $id_product = null) { if ($value && TaxRule::isTaxInUse($id)) - $confirm = $this->l('This tax is currently in use in a tax rule. If you continue, this tax will be removed from the tax rule. Are you sure you would like to continue?'); + $confirm = $this->l('This tax is currently in use as a tax rule. If you continue, this tax will be removed from the tax rule. Are you sure you\'d like to continue?'); $tpl_enable = $this->context->smarty->createTemplate('helpers/list/list_action_enable.tpl'); $tpl_enable->assign(array( @@ -169,8 +171,8 @@ class AdminTaxesControllerCore extends AdminController 'size' => 33, 'required' => true, 'lang' => true, - 'hint' => $this->l('Invalid characters:').' <>;=#{}', - 'desc' => $this->l('Tax name to display in cart and on invoice, e.g. VAT') + 'hint' => $this->l('Invalid characters').' <>;=#{}', + 'desc' => $this->l('Tax name to display in carts and on invoices (e.g. VAT).') ), array( 'type' => 'text', @@ -179,7 +181,7 @@ class AdminTaxesControllerCore extends AdminController 'size' => 4, 'maxlength' => 6, 'required' => true, - 'hint' => $this->l('Invalid characters:').' <>;=#{}', + 'hint' => $this->l('Invalid characters').' <>;=#{}', 'desc' => $this->l('Format: XX.XX or XX.XXX (e.g. 19.60 or 13.925)') ), array( @@ -204,7 +206,7 @@ class AdminTaxesControllerCore extends AdminController ) ), 'submit' => array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save'), 'class' => 'button' ) ); @@ -232,12 +234,12 @@ class AdminTaxesControllerCore extends AdminController $result = $object->update(false, false); if (!$result) - $this->errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.''; + $this->errors[] = Tools::displayError('An error occurred while updating an object.').' '.$this->table.''; elseif ($this->postImage($object->id)) Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=4'.'&token='.$this->token); } else - $this->errors[] = Tools::displayError('An error occurred while updating object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); + $this->errors[] = Tools::displayError('An error occurred while updating an object.').' '.$this->table.' '.Tools::displayError('(cannot load object)'); } /* Object creation */ @@ -246,7 +248,7 @@ class AdminTaxesControllerCore extends AdminController $object = new $this->className(); $this->copyFromPost($object, $this->table); if (!$object->add()) - $this->errors[] = Tools::displayError('An error occurred while creating object.').' '.$this->table.''; + $this->errors[] = Tools::displayError('An error occurred while creating an object.').' '.$this->table.''; elseif (($_POST['id_'.$this->table] = $object->id /* voluntary */) && $this->postImage($object->id) && $this->_redirect) Tools::redirectAdmin(self::$currentIndex.'&id_'.$this->table.'='.$object->id.'&conf=3'.'&token='.$this->token); } diff --git a/controllers/admin/AdminThemesController.php b/controllers/admin/AdminThemesController.php index 029f43503..2d0c63706 100644 --- a/controllers/admin/AdminThemesController.php +++ b/controllers/admin/AdminThemesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -50,7 +50,6 @@ class AdminThemesControllerCore extends AdminController 'PS_JS_THEME_CACHE' => 0, 'PS_HTML_THEME_COMPRESSION' => 0, 'PS_JS_HTML_THEME_COMPRESSION' => 0, - 'PS_HIGH_HTML_THEME_COMPRESSION' => 0, ), ), ), @@ -105,8 +104,8 @@ class AdminThemesControllerCore extends AdminController $this->fields_options = array( 'theme' => array( - 'title' => sprintf($this->l('Select theme for shop %s'), $this->context->shop->name), - 'description' => (!$this->can_display_themes) ? $this->l('You must select a shop from the above list if you want to select a theme') : '', + 'title' => sprintf($this->l('Select a theme for shop %s'), $this->context->shop->name), + 'description' => (!$this->can_display_themes) ? $this->l('You must select a shop from the above list if you wish to choose a theme.') : '', 'fields' => array( 'theme_for_shop' => array( 'type' => 'theme', @@ -123,59 +122,75 @@ class AdminThemesControllerCore extends AdminController 'fields' => array( 'PS_LOGO' => array( 'title' => $this->l('Header logo'), - 'desc' => $this->l('Will appear on main page'), + 'desc' => $this->l('Will appear on main page.').' '.$this->l('Recommended height: 52px. Maximum height on default theme: 65px.'), 'type' => 'file', 'thumb' => _PS_IMG_.Configuration::get('PS_LOGO').'?date='.time() ), + 'PS_LOGO_MOBILE' => array( + 'title' => $this->l('Header logo for mobile'), + 'desc' => + ((Configuration::get('PS_LOGO_MOBILE') === false) ? ''.$this->l('Warning: No mobile logo has been defined. The header logo will be used instead.').'
        ' : ''). + $this->l('Will appear on the main page of your mobile template. If left undefined, the header logo will be used.'), + 'type' => 'file', + 'thumb' => (Configuration::get('PS_LOGO_MOBILE') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MOBILE'))) ? _PS_IMG_.Configuration::get('PS_LOGO_MOBILE').'?date='.time() : _PS_IMG_.Configuration::get('PS_LOGO').'?date='.time() + ), 'PS_LOGO_MAIL' => array( 'title' => $this->l('Mail logo'), 'desc' => - ((Configuration::get('PS_LOGO_MAIL') === false) ? ''.$this->l('Warning: No e-mail logo defined, the header logo is used instead.').'
        ' : ''). - $this->l('Will appear on e-mail headers. If undefined, the Header logo will be used'), + ((Configuration::get('PS_LOGO_MAIL') === false) ? ''.$this->l('Warning: No email logo has been indentified. The header logo will be used instead.').'
        ' : ''). + $this->l('Will appear on email headers. If undefined, the header logo will be used.'), 'type' => 'file', 'thumb' => (Configuration::get('PS_LOGO_MAIL') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MAIL'))) ? _PS_IMG_.Configuration::get('PS_LOGO_MAIL').'?date='.time() : _PS_IMG_.Configuration::get('PS_LOGO').'?date='.time() ), 'PS_LOGO_INVOICE' => array( 'title' => $this->l('Invoice logo'), 'desc' => - ((Configuration::get('PS_LOGO_INVOICE') === false) ? ''.$this->l('Warning: No invoice logo defined, the header logo is used instead.').'
        ' : ''). - $this->l('Will appear on invoice headers. If undefined, the Header logo will be used'), + ((Configuration::get('PS_LOGO_INVOICE') === false) ? ''.$this->l('Warning: No invoice logo has been defined. The header logo will be used instead.').'
        ' : ''). + $this->l('Will appear on invoice headers. If undefined, the header logo will be used.'), 'type' => 'file', 'thumb' => (Configuration::get('PS_LOGO_INVOICE') !== false && file_exists(_PS_IMG_DIR_.Configuration::get('PS_LOGO_INVOICE'))) ? _PS_IMG_.Configuration::get('PS_LOGO_INVOICE').'?date='.time() : _PS_IMG_.Configuration::get('PS_LOGO').'?date='.time() ), 'PS_FAVICON' => array( 'title' => $this->l('Favicon'), 'hint' => $this->l('Only ICO format allowed'), - 'desc' => $this->l('Will appear in the address bar of your web browser'), + 'desc' => $this->l('Will appear in the address bar of your web browser.'), 'type' => 'file', 'thumb' => _PS_IMG_.Configuration::get('PS_FAVICON').'?date='.time() ), 'PS_STORES_ICON' => array( 'title' => $this->l('Store icon'), - 'hint' => $this->l('Only GIF format allowed'), - 'desc' => $this->l('Will appear on the store locator (inside Google Maps)').'
        '.$this->l('Suggested size: 30x30, Transparent GIF'), + 'hint' => $this->l('Only GIF format allowed.'), + 'desc' => $this->l('Will appear on the store locator (inside Google Maps).').'
        '.$this->l('Suggested size: 30x30, Transparent GIF'), 'type' => 'file', 'thumb' => _PS_IMG_.Configuration::get('PS_STORES_ICON').'?date='.time() ), 'PS_NAVIGATION_PIPE' => array( 'title' => $this->l('Navigation pipe'), - 'desc' => $this->l('Used for navigation path inside categories/product'), + 'desc' => $this->l('Used for the navigation path inside categories/product.'), 'cast' => 'strval', 'type' => 'text', 'size' => 20 ), 'PS_ALLOW_MOBILE_DEVICE' => array( - 'title' => $this->l('Enable mobile theme'), - 'desc' => $this->l('Allows visitors browsing on a mobile device or on a touchpad, to have a light version of website'), + 'title' => $this->l('Enable the mobile theme.'), + 'desc' => $this->l('Allows visitors browsing on mobile devices to view a lighter version of your website.'), 'type' => 'radio', 'required' => true, 'validation' => 'isGenericName', 'choices' => array( - 0 => $this->l('I want to disable it'), - 1 => $this->l('I want to enable it only on mobiles devices'), - 2 => $this->l('I want to enable it only on touchpads'), - 3 => $this->l('I want to enable it on mobile and touchpad devices') + 0 => $this->l('I\'d like to disable it, please. '), + 1 => $this->l('I\'d like to enable it only on smart phones.'), + 2 => $this->l('I\'d like to enable it only on tablets.'), + 3 => $this->l('I\'d like to enable it on both smart phones and tablets.') ) + ), + 'PS_MAIL_COLOR' => array( + 'title' => $this->l('Mail color'), + 'desc' => $this->l('Your mail will be highlighted in this color. HTML colors only, please (e.g.').' "lightblue", "#CC6600")', + 'type' => 'color', + 'name' => 'PS_MAIL_COLOR', + 'size' => 30, + 'value' => Configuration::get('PS_MAIL_COLOR') ) ), 'submit' => array('title' => $this->l('Save'), 'class' => 'button') @@ -212,9 +227,9 @@ class AdminThemesControllerCore extends AdminController if (!$paypal_installed && in_array($iso_code, $paypal_countries)) { if (!$this->isXmlHttpRequest()) - $this->warnings[] = $this->l('The mobile theme only works with the PayPal\'s payment module at this time. Please activate the module to enable payments.') + $this->warnings[] = $this->l('At this time, the mobile theme only works with PayPal\'s payment module. Please activate and configure the PayPal module to enable mobile payments.') .'
        '. - $this->l('In order to use the mobile theme you have to install and configure the PayPal module.'); + $this->l('In order to use the mobile theme, you must install and configure the PayPal module.'); } } @@ -270,7 +285,7 @@ class AdminThemesControllerCore extends AdminController 'type' => 'select', 'name' => 'based_on', 'label' => $this->l('Copy missing files from existing theme:'), - 'desc' => $this->l('If you create a new theme, it\'s recommended to use default theme files.'), + 'desc' => $this->l('If you create a new theme, it\'s recommended that you use default theme files.'), 'options' => array( 'id' => 'id', 'name' => 'name', 'default' => array('value' => 0, 'label' => ' - '), @@ -346,7 +361,7 @@ class AdminThemesControllerCore extends AdminController { $res &= mkdir(_PS_ALL_THEMES_DIR_.$new_dir, Theme::$access_rights); if ($res) - $this->confirmations[] = $this->l('Directory successfully created'); + $this->confirmations[] = $this->l('The directory was successfully created.'); } if (0 !== $id_based = (int)Tools::getValue('based_on')) @@ -369,7 +384,7 @@ class AdminThemesControllerCore extends AdminController if ($obj && $obj->isUsed()) { - $this->errors[] = $this->l('This theme is already used by at least one shop. Please choose another theme first.'); + $this->errors[] = $this->l('The theme is already being used by at least one shop. Please choose another theme before continuing.'); return false; } @@ -400,6 +415,12 @@ class AdminThemesControllerCore extends AdminController Configuration::updateValue('SHOP_LOGO_HEIGHT', (int)round($height)); Configuration::updateValue('SHOP_LOGO_WIDTH', (int)round($width)); } + if (file_exists(_PS_IMG_DIR_.'logo_mobile.jpg')) + { + list($width, $height, $type, $attr) = getimagesize(_PS_IMG_DIR_.Configuration::get('PS_LOGO_MOBILE')); + Configuration::updateValue('SHOP_LOGO_MOBILE_HEIGHT', (int)round($height)); + Configuration::updateValue('SHOP_LOGO_MOBILE_WIDTH', (int)round($width)); + } $this->content .= $content; return parent::initContent(); @@ -458,7 +479,7 @@ class AdminThemesControllerCore extends AdminController } if ($xml_version_too_old && !$this->_checkConfigForFeatures(array_keys(AdminThemes::$check_features))) { - $this->errors[] .= Tools::displayError('config.xml theme file has not been created for this version of prestashop.'); + $this->errors[] .= Tools::displayError('config.xml theme file has not been created for this version of PrestaShop.'); $return = false; } return $return; @@ -504,7 +525,7 @@ class AdminThemesControllerCore extends AdminController .(!empty(AdminThemes::$check_features[$feature]['tab']) ?' ' - .Tools::displayError('You can disable this function on this page') + .Tools::displayError('You can disable this function.') .'':'' ).'
        '; $return = false; @@ -529,7 +550,7 @@ class AdminThemesControllerCore extends AdminController unset($_POST['submitThemes'.$this->table]); Tools::clearCache($this->context->smarty); - parent::postProcess(); + return parent::postProcess(); } /** @@ -539,6 +560,14 @@ class AdminThemesControllerCore extends AdminController { $this->updateLogo('PS_LOGO', 'logo'); } + + /** + * Update PS_LOGO_MOBILE + */ + public function updateOptionPsLogoMobile() + { + $this->updateLogo('PS_LOGO_MOBILE', 'logo_mobile'); + } /** * Update PS_LOGO_MAIL @@ -585,18 +614,18 @@ class AdminThemesControllerCore extends AdminController $ext = ($field_name == 'PS_STORES_ICON') ? '.gif' : '.jpg'; $logo_name = $logo_prefix.'-'.(int)$id_shop.$ext; - if (Context::getContext()->shop->getContext() == Shop::CONTEXT_ALL || $id_shop == 0) + if (Context::getContext()->shop->getContext() == Shop::CONTEXT_ALL || $id_shop == 0 || Shop::isFeatureActive() == false) $logo_name = $logo_prefix.$ext; if ($field_name == 'PS_STORES_ICON') { if (!@ImageManager::resize($tmp_name, _PS_IMG_DIR_.$logo_name, null, null, 'gif', true)) - $this->errors[] = Tools::displayError('An error occurred during logo copy.'); + $this->errors[] = Tools::displayError('An error occurred while attempting to copy your logo.'); } else { if (!@ImageManager::resize($tmp_name, _PS_IMG_DIR_.$logo_name)) - $this->errors[] = Tools::displayError('An error occurred during logo copy.'); + $this->errors[] = Tools::displayError('An error occurred while attempting to copy your logo.'); } Configuration::updateValue($field_name, $logo_name); diff --git a/controllers/admin/AdminTrackingController.php b/controllers/admin/AdminTrackingController.php index cf3efd77e..4510d998c 100644 --- a/controllers/admin/AdminTrackingController.php +++ b/controllers/admin/AdminTrackingController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -52,6 +52,9 @@ class AdminTrackingControllerCore extends AdminController public function initContent() { + if ($id_category = Tools::getValue('id_category') && Tools::getIsset('viewcategory')) + Tools::redirectAdmin($this->context->link->getAdminLink('AdminProducts').'&id_category='.(int)$id_category.'&viewcategory'); + $this->_helper_list = new HelperList(); if (!Configuration::get('PS_STOCK_MANAGEMENT')) @@ -149,9 +152,7 @@ class AdminTrackingControllerCore extends AdminController AND IFNULL(stock.quantity, 0) <= 0 )'; - $this->tpl_list_vars = array('sub_title' => $this->l('List of products with attributes and without available quantities for sale:')); - - + $this->tpl_list_vars = array('sub_title' => $this->l('List of products with attributes but without available quantities for sale:')); return $this->renderList(); } diff --git a/controllers/admin/AdminTranslationsController.php b/controllers/admin/AdminTranslationsController.php index 98cd2748a..67950d6fc 100644 --- a/controllers/admin/AdminTranslationsController.php +++ b/controllers/admin/AdminTranslationsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -52,9 +52,6 @@ class AdminTranslationsControllerCore extends AdminController /** @var array : List of theme by translation type : FRONT, BACK, ERRORS... */ protected $translations_informations = array(); - /** @var array : List of theme by translation type : FRONT, BACK, ERRORS... */ - protected $translations_type_for_theme = array('front', 'modules', 'pdf', 'mails'); - /** @var array : List of all languages */ protected $languages; @@ -107,7 +104,7 @@ class AdminTranslationsControllerCore extends AdminController $this->content = $this->initForm($method_name); else { - $this->errors[] = sprintf(Tools::displayError('"%s" does not exist. Maybe you typed the URL manually.'), $this->type_selected); + $this->errors[] = sprintf(Tools::displayError('"%s" does not exist.'), $this->type_selected); $this->content = $this->initMain(); } } @@ -130,7 +127,7 @@ class AdminTranslationsControllerCore extends AdminController $this->l('%1$s (Language: %2$s, Theme: %3$s)'), $this->translations_informations[$this->type_selected]['name'], $this->lang_selected->name, - $this->theme_selected + $this->theme_selected ? $this->theme_selected : $this->l('none') ); // Set vars for all forms @@ -199,7 +196,6 @@ class AdminTranslationsControllerCore extends AdminController 'token' => $this->token, 'languages' => $this->languages, 'translations_type' => $this->translations_informations, - 'translations_type_for_theme' => $this->translations_type_for_theme, 'packs_to_install' => $packs_to_install, 'packs_to_update' => $packs_to_update, 'url_submit' => self::$currentIndex.'&token='.$this->token, @@ -249,11 +245,12 @@ class AdminTranslationsControllerCore extends AdminController $path = dirname($dest); // If folder wasn't already added - if (!Tools::file_exists_cache($path)) + // Do not use Tools::file_exists_cache because it changes over time! + if (!file_exists($path)) if (!mkdir($path, 0777, true)) { $bool &= false; - $this->errors[] = sprintf($this->l('Cannot create the folder "%s". Check directory writing permisions.'), $path); + $this->errors[] = sprintf($this->l('Cannot create the folder "%s". Please check your directory writing permisions.'), $path); } return $bool; @@ -328,14 +325,27 @@ class AdminTranslationsControllerCore extends AdminController public function submitCopyLang() { - if (!($from_lang = strval(Tools::getValue('fromLang'))) || !($to_lang = strval(Tools::getValue('toLang')))) - $this->errors[] = $this->l('You must select 2 languages in order to copy data from one to another'); - else if (!($from_theme = strval(Tools::getValue('fromTheme'))) || !($to_theme = strval(Tools::getValue('toTheme')))) - $this->errors[] = $this->l('You must select 2 themes in order to copy data from one to another'); + if (!($from_lang = Tools::getValue('fromLang')) || !($to_lang = Tools::getValue('toLang'))) + $this->errors[] = $this->l('You must select two languages in order to copy data from one to another.'); + else if (!($from_theme = Tools::getValue('fromTheme')) || !($to_theme = Tools::getValue('toTheme'))) + $this->errors[] = $this->l('You must select two themes in order to copy data from one to another.'); else if (!Language::copyLanguageData(Language::getIdByIso($from_lang), Language::getIdByIso($to_lang))) - $this->errors[] = $this->l('An error occurred while copying data'); + $this->errors[] = $this->l('An error occurred while copying data.'); else if ($from_lang == $to_lang && $from_theme == $to_theme) - $this->errors[] = $this->l('Nothing to copy! (same language and theme)'); + $this->errors[] = $this->l('There is nothing to copy (same language and theme).'); + else + { + $theme_exists = array('from_theme' => false, 'to_theme' => false); + foreach ($this->themes as $theme) + { + if ($theme->directory == $from_theme) + $theme_exists['from_theme'] = true; + if ($theme->directory == $to_theme) + $theme_exists['to_theme'] = true; + } + if ($theme_exists['from_theme'] == false || $theme_exists['to_theme'] == false) + $this->errors[] = $this->l('Theme(s) not found'); + } if (count($this->errors)) return; @@ -343,15 +353,17 @@ class AdminTranslationsControllerCore extends AdminController $items = Language::getFilesList($from_lang, $from_theme, $to_lang, $to_theme, false, false, true); foreach ($items as $source => $dest) { - $bool &= $this->checkDirAndCreate($dest); - $bool &= @copy($source, $dest); - - if (strpos($dest, 'modules') && basename($source) === $from_lang.'.php' && $bool !== false) - $bool &= $this->changeModulesKeyTranslation($dest, $from_theme, $to_theme); + if (!$this->checkDirAndCreate($dest)) + $this->errors[] = sprintf($this->l('Impossible to create the directory "%s".'), $dest); + elseif (!copy($source, $dest)) + $this->errors[] = sprintf($this->l('Impossible to copy "%s" to "%s".'), $source, $dest); + elseif (strpos($dest, 'modules') && basename($source) === $from_lang.'.php' && $bool !== false) + if (!$this->changeModulesKeyTranslation($dest, $from_theme, $to_theme)) + $this->errors[] = sprintf($this->l('Impossible to translate "$dest".'), $dest); } - if ($bool) + if (!count($this->errors)) $this->redirect(false, 14); - $this->errors[] = $this->l('A part of the data has been copied but some language files could not be found or copied'); + $this->errors[] = $this->l('A part of the data has been copied but some of the language files could not be found.'); } /** @@ -416,8 +428,8 @@ class AdminTranslationsControllerCore extends AdminController { $this->exportTabs(); $items = array_flip(Language::getFilesList($this->lang_selected->iso_code, $this->theme_selected, false, false, false, false, true)); - $gz = new Archive_Tar(_PS_TRANSLATIONS_DIR_.'/export/'.$this->lang_selected->iso_code.'.gzip', true); - $file_name = Tools::getCurrentUrlProtocolPrefix().Tools::getShopDomain().__PS_BASE_URI__.'translations/export/'.$this->lang_selected->iso_code.'.gzip'; + $file_name = _PS_TRANSLATIONS_DIR_.'/export/'.$this->lang_selected->iso_code.'.gzip'; + $gz = new Archive_Tar($file_name, true); if ($gz->createModify($items, null, _PS_ROOT_DIR_)); { ob_start(); @@ -430,18 +442,25 @@ class AdminTranslationsControllerCore extends AdminController header('Content-Disposition: attachment; filename="'.$this->lang_selected->iso_code.'.gzip'.'"'); header('Content-Transfer-Encoding: binary'); ob_end_flush(); - @readfile($file_name); + readfile($file_name); + @unlink($file_name); exit; } $this->errors[] = Tools::displayError('An error occurred while creating archive.'); } - $this->errors[] = Tools::displayError('Please choose a language and a theme.'); + $this->errors[] = Tools::displayError('Please select a language and a theme.'); } public static function checkAndAddMailsFiles($iso_code, $files_list) { + if (Language::getIdByIso('en')) + $default_language = 'en'; + else + $default_language = Language::getIsoById((int)Configuration::get('PS_LANG_DEFAULT')); + if (!$default_language || !Validate::isLanguageIsoCode($default_language)) + return false; // 1 - Scan mails files - $mails = scandir(_PS_MAIL_DIR_.'en/'); + $mails = scandir(_PS_MAIL_DIR_.$default_language.'/'); $mails_new_lang = array(); @@ -461,7 +480,7 @@ class AdminTranslationsControllerCore extends AdminController // Add mails files foreach ($arr_mails_needed as $mail_to_add) if (!in_array($mail_to_add, self::$ignore_folder)) - @copy(_PS_MAIL_DIR_.'en/'.$mail_to_add, _PS_MAIL_DIR_.$iso_code.'/'.$mail_to_add); + @copy(_PS_MAIL_DIR_.$default_language.'/'.$mail_to_add, _PS_MAIL_DIR_.$iso_code.'/'.$mail_to_add); // 2 - Scan modules files $modules = scandir(_PS_MODULE_DIR_); @@ -471,15 +490,15 @@ class AdminTranslationsControllerCore extends AdminController foreach ($modules as $module) { - if (!in_array($module, self::$ignore_folder) && Tools::file_exists_cache(_PS_MODULE_DIR_.$module.'/mails/en/')) + if (!in_array($module, self::$ignore_folder) && Tools::file_exists_cache(_PS_MODULE_DIR_.$module.'/mails/'.$default_language.'/')) { - $arr_files = scandir(_PS_MODULE_DIR_.$module.'/mails/en/'); + $arr_files = scandir(_PS_MODULE_DIR_.$module.'/mails/'.$default_language.'/'); foreach ($arr_files as $file) { if (!in_array($file, self::$ignore_folder)) { - if (Tools::file_exists_cache(_PS_MODULE_DIR_.$module.'/mails/en/'.$file)) + if (Tools::file_exists_cache(_PS_MODULE_DIR_.$module.'/mails/'.$default_language.'/'.$file)) $module_mail_en[] = _PS_MODULE_DIR_.$module.'/mails/ISO_CODE/'.$file; if (Tools::file_exists_cache(_PS_MODULE_DIR_.$module.'/mails/'.$iso_code.'/'.$file)) @@ -495,7 +514,7 @@ class AdminTranslationsControllerCore extends AdminController // Add mails files for this modules foreach ($arr_modules_mails_needed as $file) { - $file_en = str_replace('ISO_CODE', 'en', $file); + $file_en = str_replace('ISO_CODE', $default_language, $file); $file_iso_code = str_replace('ISO_CODE', $iso_code, $file); $dir_iso_code = substr($file_iso_code, 0, -(strlen($file_iso_code) - strrpos($file_iso_code, '/') - 1)); @@ -553,6 +572,7 @@ class AdminTranslationsControllerCore extends AdminController */ public static function addNewTabs($iso_code, $files) { + $errors = array(); foreach ($files as $file) { // Check if file is a file theme @@ -565,25 +585,66 @@ class AdminTranslationsControllerCore extends AdminController { // Get instance of this tab by class name $tab = Tab::getInstanceFromClassName($class_name); - //Check if class name exists if (isset($tab->class_name) && !empty($tab->class_name)) { $id_lang = Language::getIdByIso($iso_code); - $tab->name[(int)$id_lang] = pSQL($translations); + $tab->name[(int)$id_lang] = $translations; - // Update this tab - $tab->update(); + if (!Validate::isGenericName($tab->name[(int)$id_lang])) + $errors[] = sprintf(Tools::displayError('Tab "%s" is not valid'), $tab->name[(int)$id_lang]); + else + $tab->update(); } } } } + return $errors; + } + + public static function checkTranslationFile($content) + { + $lines = array_map('trim', explode("\n", $content)); + $global = false; + foreach ($lines as $line) + { + // PHP tags + if (in_array($line, array('', ''))) + continue; + + // Global variable declaration + if (!$global && preg_match('/^global\s+\$([a-z0-9-_]+)\s*;$/i', $line, $matches)) + { + $global = $matches[1]; + continue; + } + // Global variable initialization + if ($global != false && preg_match('/^\$'.preg_quote($global, '/').'\s*=\s*array\(\s*\)\s*;$/i', $line)) + continue; + + // Global variable initialization without declaration + if (!$global && preg_match('/^\$([a-z0-9-_]+)\s*=\s*array\(\s*\)\s*;$/i', $line, $matches)) + { + $global = $matches[1]; + continue; + } + + // Assignation + if (preg_match('/^\$'.preg_quote($global, '/').'\[\''._PS_TRANS_PATTERN_.'\'\]\s*=\s*\''._PS_TRANS_PATTERN_.'\'\s*;$/i', $line)) + continue; + + // Sometimes the global variable is returned... + if (preg_match('/^return\s+\$'.preg_quote($global, '/').'\s*;$/i', $line, $matches)) + continue; + return false; + } + return true; } public function submitImportLang() { if (!isset($_FILES['file']['tmp_name']) || !$_FILES['file']['tmp_name']) - $this->errors[] = Tools::displayError('No file selected'); + $this->errors[] = Tools::displayError('No file has been selected.'); else { $gz = new Archive_Tar($_FILES['file']['tmp_name'], true); @@ -593,19 +654,63 @@ class AdminTranslationsControllerCore extends AdminController { $themes_selected = Tools::getValue('theme', array(self::DEFAULT_THEME_NAME)); $files_list = $gz->listContent(); + + $uniqid = uniqid(); + $sandbox = _PS_CACHE_DIR_.'sandbox'.DIRECTORY_SEPARATOR.$uniqid.DIRECTORY_SEPARATOR; + if ($gz->extract($sandbox, false)) + { + foreach ($files_list as $file2check) + { + //don't validate index.php, will be overwrite when extract in translation directory + if (pathinfo($file2check['filename'], PATHINFO_BASENAME) == 'index.php') + continue; + + if (preg_match('@^[0-9a-z-_/\\\\]+\.php$@i', $file2check['filename'])) + { + if (!AdminTranslationsController::checkTranslationFile(file_get_contents($sandbox.$file2check['filename']))) + $this->errors[] = sprintf(Tools::displayError('Validation failed for: %s'), $file2check['filename']); + } + elseif (!preg_match('@^[0-9a-z-_/\\\\]+\.(html|tpl|txt)$@i', $file2check['filename'])) + $this->errors[] = sprintf(Tools::displayError('Unidentified file found: %s'), $file2check['filename']); + } + Tools::deleteDirectory($sandbox, true); + } + + if (count($this->errors)) + return false; + if ($gz->extract(_PS_TRANSLATIONS_DIR_.'../', false)) { - AdminTranslationsController::checkAndAddMailsFiles($iso_code, $files_list); - $this->checkAndAddThemesFiles($files_list, $themes_selected); - AdminTranslationsController::addNewTabs($iso_code, $files_list); + foreach ($files_list as $file2check) + if (pathinfo($file2check['filename'], PATHINFO_BASENAME) == 'index.php' && file_put_contents(_PS_TRANSLATIONS_DIR_.'../'.$file2check['filename'], Tools::getDefaultIndexContent())) + continue; + + // Clear smarty modules cache + Tools::clearCache(); + if (Validate::isLanguageFileName($filename)) { if (!Language::checkAndAddLanguage($iso_code)) $conf = 20; + else + { + // Reset cache + Language::loadLanguages(); + + AdminTranslationsController::checkAndAddMailsFiles($iso_code, $files_list); + $this->checkAndAddThemesFiles($files_list, $themes_selected); + $tab_errors = AdminTranslationsController::addNewTabs($iso_code, $files_list); + + if (count($tab_errors)) + { + $this->errors += $tab_errors; + return false; + } + } } $this->redirect(false, (isset($conf) ? $conf : '15')); } - $this->errors[] = Tools::displayError('Archive cannot be extracted.'); + $this->errors[] = Tools::displayError('The archive cannot be extracted.'); } else $this->errors[] = sprintf(Tools::displayError('ISO CODE invalid "%1$s" for the following file: "%2$s"'), $iso_code, $filename); @@ -618,34 +723,47 @@ class AdminTranslationsControllerCore extends AdminController if (Validate::isLangIsoCode($arr_import_lang[0])) { if ($content = Tools::file_get_contents( - 'http://www.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.$arr_import_lang[0].'.gzip', false, + 'http://www.prestashop.com/download/lang_packs/gzip/'.$arr_import_lang[1].'/'.Tools::strtolower($arr_import_lang[0]).'.gzip', false, @stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 5))))) { $file = _PS_TRANSLATIONS_DIR_.$arr_import_lang[0].'.gzip'; - if (file_put_contents($file, $content)) + if ((bool)@file_put_contents($file, $content)) { $gz = new Archive_Tar($file, true); $files_list = $gz->listContent(); - if ($gz->extract(_PS_TRANSLATIONS_DIR_.'../', false)) + if ($error = $gz->extract(_PS_TRANSLATIONS_DIR_.'../', false)) { - AdminTranslationsController::checkAndAddMailsFiles($arr_import_lang[0], $files_list); - AdminTranslationsController::addNewTabs($arr_import_lang[0], $files_list); - if (!Language::checkAndAddLanguage($arr_import_lang[0])) - $conf = 20; - if (!unlink($file)) - $this->errors[] = Tools::displayError('Cannot delete archive'); + if (is_object($error) && !empty($error->message)) + $this->errors[] = Tools::displayError('The archive cannot be extracted.'). ' '.$error->message; + else + { + if (!Language::checkAndAddLanguage($arr_import_lang[0])) + $conf = 20; + else + { + // Reset cache + Language::loadLanguages(); + // Clear smarty modules cache + Tools::clearCache(); - $this->redirect(false, (isset($conf) ? $conf : '15')); + AdminTranslationsController::checkAndAddMailsFiles($arr_import_lang[0], $files_list); + if ($tab_errors = AdminTranslationsController::addNewTabs($arr_import_lang[0], $files_list)) + $this->errors += $tab_errors; + } + if (!unlink($file)) + $this->errors[] = sprintf(Tools::displayError('Cannot delete the archive %s.'), $file); + + $this->redirect(false, (isset($conf) ? $conf : '15')); + } } - $this->errors[] = Tools::displayError('Archive cannot be extracted.'); - if (!unlink($file)) - $this->errors[] = Tools::displayError('Cannot delete archive'); + elseif (!unlink($file)) + $this->errors[] = sprintf(Tools::displayError('Cannot delete the archive %s.'), $file); } else - $this->errors[] = Tools::displayError('Server does not have permissions for writing.'); + $this->errors[] = Tools::displayError('The server does not have permissions for writing.').' '.sprintf(Tools::displayError('Please check rights for %s'), dirname($file)); } else - $this->errors[] = Tools::displayError('Language not found'); + $this->errors[] = Tools::displayError('Language not found.'); } else $this->errors[] = Tools::displayError('Invalid parameter'); @@ -669,14 +787,13 @@ class AdminTranslationsControllerCore extends AdminController static $str_write = ''; static $array_check_duplicate = array(); - // Default translations and Prestashop overriding themes are distinguish - $is_default = $theme_name === self::DEFAULT_THEME_NAME ? true : false; - // Set file_name in static var, this allow to open and wright the file just one time if (!isset($cache_file[$theme_name.'-'.$file_name])) { $str_write = ''; $cache_file[$theme_name.'-'.$file_name] = true; + if (!Tools::file_exists_cache(dirname($file_name))) + mkdir(dirname($file_name), 0777, true); if (!Tools::file_exists_cache($file_name)) file_put_contents($file_name, ''); if (!is_writable($file_name)) @@ -692,32 +809,32 @@ class AdminTranslationsControllerCore extends AdminController foreach ($files as $file) { - if (preg_match('/^(.*).(tpl|php)$/', $file) && Tools::file_exists_cache($file_path = $dir.$file) && !in_array($file, self::$ignore_folder)) + if (preg_match('/^(.*).(tpl|php)$/', $file) && Tools::file_exists_cache($dir.$file) && !in_array($file, self::$ignore_folder)) { // Get content for this file - $content = file_get_contents($file_path); + $content = file_get_contents($dir.$file); // Get file type $type_file = substr($file, -4) == '.tpl' ? 'tpl' : 'php'; // Parse this content - $matches = $this->userParseFile($content, $this->type_selected, $type_file); + $matches = $this->userParseFile($content, $this->type_selected, $type_file, $module_name); // Write each translation on its module file $template_name = substr(basename($file), 0, -4); foreach ($matches as $key) { - if ($is_default) - { - $post_key = md5(strtolower($module_name).'_'.self::DEFAULT_THEME_NAME.'_'.strtolower($template_name).'_'.md5($key)); - $pattern = '\'<{'.strtolower($module_name).'}prestashop>'.strtolower($template_name).'_'.md5($key).'\''; - } - else + if ($theme_name) { $post_key = md5(strtolower($module_name).'_'.strtolower($theme_name).'_'.strtolower($template_name).'_'.md5($key)); $pattern = '\'<{'.strtolower($module_name).'}'.strtolower($theme_name).'>'.strtolower($template_name).'_'.md5($key).'\''; } + else + { + $post_key = md5(strtolower($module_name).'_'.strtolower($template_name).'_'.md5($key)); + $pattern = '\'<{'.strtolower($module_name).'}prestashop>'.strtolower($template_name).'_'.md5($key).'\''; + } if (array_key_exists($post_key, $_POST) && !empty($_POST[$post_key]) && !in_array($pattern, $array_check_duplicate)) { @@ -744,7 +861,7 @@ class AdminTranslationsControllerCore extends AdminController public function clearModuleFiles($files, $type_clear = 'file', $path = '') { // List of directory which not must be parsed - $arr_exclude = array('img', 'js', 'mails'); + $arr_exclude = array('img', 'js', 'mails','override'); // List of good extention files $arr_good_ext = array('.tpl', '.php'); @@ -781,9 +898,6 @@ class AdminTranslationsControllerCore extends AdminController // added for compatibility $GLOBALS[$name_var] = array_change_key_case($GLOBALS[$name_var]); - // Default translations and Prestashop overriding themes are distinguish - $is_default = $theme_name === self::DEFAULT_THEME_NAME ? true : false; - // Thank to this var similar keys are not duplicate // in AndminTranslation::modules_translations array // see below @@ -803,24 +917,26 @@ class AdminTranslationsControllerCore extends AdminController $type_file = substr($file, -4) == '.tpl' ? 'tpl' : 'php'; // Parse this content - $matches = $this->userParseFile($content, $this->type_selected, $type_file); + $matches = $this->userParseFile($content, $this->type_selected, $type_file, $module_name); // Write each translation on its module file $template_name = substr(basename($file), 0, -4); foreach ($matches as $key) { - $module_key = '<{'.Tools::strtolower($module_name).'}'. - strtolower($is_default ? 'prestashop' : $theme_name).'>'.Tools::strtolower($template_name).'_'.md5($key); + $md5_key = md5($key); + $module_key = '<{'.Tools::strtolower($module_name).'}'.strtolower($theme_name).'>'.Tools::strtolower($template_name).'_'.$md5_key; + $default_key = '<{'.Tools::strtolower($module_name).'}prestashop>'.Tools::strtolower($template_name).'_'.$md5_key; // to avoid duplicate entry if (!in_array($module_key, $array_check_duplicate)) { $array_check_duplicate[] = $module_key; if (!isset($this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'])) $this->total_expression++; - - if (array_key_exists($module_key, $GLOBALS[$name_var])) + if ($theme_name && array_key_exists($module_key, $GLOBALS[$name_var])) $this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$module_key], ENT_COMPAT, 'UTF-8'); + elseif (array_key_exists($default_key, $GLOBALS[$name_var])) + $this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$default_key], ENT_COMPAT, 'UTF-8'); else { $this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = ''; @@ -869,8 +985,6 @@ class AdminTranslationsControllerCore extends AdminController 'header.inc.php', 'footer.inc.php', 'index.php', - 'login.php', - 'password.php', 'functions.php' ) ) @@ -943,15 +1057,16 @@ class AdminTranslationsControllerCore extends AdminController * @param $content * @param $type_translation : front, back, errors, modules... * @param string|bool $type_file : (tpl|php) + * @param string $module_name : name of the module * @return return $matches */ - protected function userParseFile($content, $type_translation, $type_file = false) + protected function userParseFile($content, $type_translation, $type_file = false, $module_name = '') { switch ($type_translation) { case 'front': // Parsing file in Front office - $regex = '/\{l\s*s=\''._PS_TRANS_PATTERN_.'\'(\s*sprintf=.*)?(\s*js=1)?\s*\}/U'; + $regex = '/\{l\s*s=(?:\''._PS_TRANS_PATTERN_.'\'|\"'._PS_TRANS_PATTERN_.'\")(\s*sprintf=.*)?(\s*js=1)?\s*\}/U'; break; case 'back': @@ -959,14 +1074,14 @@ class AdminTranslationsControllerCore extends AdminController if ($type_file == 'php') $regex = '/this->l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U'; else if ($type_file == 'specific') - $regex = '/translate\(\''._PS_TRANS_PATTERN_.'\'\)/U'; + $regex = '/Translate::getAdminTranslation\(\''._PS_TRANS_PATTERN_.'\'\)/U'; else - $regex = '/\{l\s*s\s*=\''._PS_TRANS_PATTERN_.'\'(\s*sprintf=.*)?(\s*js=1)?(\s*slashes=1)?\s*\}/U'; + $regex = '/\{l\s*s\s*=(?:\''._PS_TRANS_PATTERN_.'\'|\"'._PS_TRANS_PATTERN_.'\")(\s*sprintf=.*)?(\s*js=1)?(\s*slashes=1)?\s*\}/U'; break; case 'errors': // Parsing file for all errors syntax - $regex = '/Tools::displayError\(\''._PS_TRANS_PATTERN_.'\'(,\s*(true|false))?\)/U'; + $regex = '/Tools::displayError\(\''._PS_TRANS_PATTERN_.'\'(,\s*(.+))?\)/U'; break; case 'modules': @@ -974,7 +1089,8 @@ class AdminTranslationsControllerCore extends AdminController if ($type_file == 'php') $regex = '/->l\(\''._PS_TRANS_PATTERN_.'\'(, ?\'(.+)\')?(, ?(.+))?\)/U'; else - $regex = '/\{l\s*s=\''._PS_TRANS_PATTERN_.'\'(\s*sprintf=.*)?(\s*mod=\'.+\')?(\s*js=1)?\s*\}/U'; + // In tpl file look for something that should contain mod='module_name' according to the documentation + $regex = '/\{l\s*s=(?:\''._PS_TRANS_PATTERN_.'\'|\"'._PS_TRANS_PATTERN_.'\").*\s+mod=\''.$module_name.'\'.*\}/U'; break; case 'pdf': @@ -982,7 +1098,7 @@ class AdminTranslationsControllerCore extends AdminController if ($type_file == 'php') $regex = '/HTMLTemplate.*::l\(\''._PS_TRANS_PATTERN_.'\'[\)|\,]/U'; else - $regex = '/\{l\s*s=\''._PS_TRANS_PATTERN_.'\'(\s*sprintf=.*)?(\s*js=1)?(\s*pdf=\'true\')?\s*\}/U'; + $regex = '/\{l\s*s=(?:\''._PS_TRANS_PATTERN_.'\'|\"'._PS_TRANS_PATTERN_.'\")(\s*sprintf=.*)?(\s*js=1)?(\s*pdf=\'true\')?\s*\}/U'; break; } @@ -1009,7 +1125,7 @@ class AdminTranslationsControllerCore extends AdminController 'front' => array( 'name' => $this->l('Front Office translations'), 'var' => '_LANG', - 'dir' => _PS_THEME_SELECTED_DIR_.'lang/', + 'dir' => defined('_PS_THEME_SELECTED_DIR_') ? _PS_THEME_SELECTED_DIR_.'lang/' : '', 'file' => $this->lang_selected->iso_code.'.php' ), 'back' => array( @@ -1031,36 +1147,31 @@ class AdminTranslationsControllerCore extends AdminController 'file' => 'fields.php' ), 'modules' => array( - 'name' => $this->l('Installed module translations'), + 'name' => $this->l('Installed modules translations'), 'var' => '_MODULES', 'dir' => _PS_MODULE_DIR_, - 'file' => '', - 'override' => array( - 'dir' => _PS_THEME_SELECTED_DIR_.'modules/', - 'file' => '' - ) + 'file' => '' ), 'pdf' => array( 'name' => $this->l('PDF translations'), 'var' => '_LANGPDF', 'dir' => _PS_TRANSLATIONS_DIR_.$this->lang_selected->iso_code.'/', - 'file' => 'pdf.php', - 'override' => array( - 'dir' => _PS_THEME_SELECTED_DIR_.'pdf/lang/', - 'file' => $this->lang_selected->iso_code.'.php' - ) + 'file' => 'pdf.php' ), 'mails' => array( - 'name' => $this->l('E-mail template translations'), + 'name' => $this->l('Email templates translations'), 'var' => '_LANGMAIL', 'dir' => _PS_MAIL_DIR_.$this->lang_selected->iso_code.'/', - 'file' => 'lang.php', - 'override' => array( - 'dir' => _PS_THEME_SELECTED_DIR_.'mails/'.$this->lang_selected->iso_code.'/', - 'file' => 'lang.php' - ) + 'file' => 'lang.php' ) ); + + if (defined('_PS_THEME_SELECTED_DIR_')) + { + $this->translations_informations['modules']['override'] = array('dir' => _PS_THEME_SELECTED_DIR_.'modules/', 'file' => ''); + $this->translations_informations['pdf']['override'] = array('dir' => _PS_THEME_SELECTED_DIR_.'pdf/lang/', 'file' => $this->lang_selected->iso_code.'.php'); + $this->translations_informations['mails']['override'] = array('dir' => _PS_THEME_SELECTED_DIR_.'mails/'.$this->lang_selected->iso_code.'/', 'file' => 'lang.php'); + } } /** @@ -1080,12 +1191,16 @@ class AdminTranslationsControllerCore extends AdminController // Get folder name of theme if (($theme = Tools::getValue('theme')) && !is_array($theme)) + { + $theme_exists = $this->theme_exists($theme); + if (!$theme_exists) + throw new PrestaShopException(sprintf(Tools::displayError('Invalid theme "%s"'), $theme)); $this->theme_selected = Tools::safeOutput($theme); - else - $this->theme_selected = self::DEFAULT_THEME_NAME; + } // Set the path of selected theme - define('_PS_THEME_SELECTED_DIR_', _PS_ROOT_DIR_.'/themes/'.$this->theme_selected.'/'); + if ($this->theme_selected) + define('_PS_THEME_SELECTED_DIR_', _PS_ROOT_DIR_.'/themes/'.$this->theme_selected.'/'); // Get type of translation if (($type = Tools::getValue('type')) && !is_array($type)) @@ -1132,67 +1247,67 @@ class AdminTranslationsControllerCore extends AdminController if ($this->tabAccess['add'] === '1') $this->submitCopyLang(); else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } else if (Tools::isSubmit('submitExport')) { if ($this->tabAccess['add'] === '1') $this->submitExportLang(); else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } else if (Tools::isSubmit('submitImport')) { if ($this->tabAccess['add'] === '1') $this->submitImportLang(); else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } else if (Tools::isSubmit('submitAddLanguage')) { if ($this->tabAccess['add'] === '1') $this->submitAddLang(); else - $this->errors[] = Tools::displayError('You do not have permission to add here.'); + $this->errors[] = Tools::displayError('You do not have permission to add this.'); } else if (Tools::isSubmit('submitTranslationsFront')) { if ($this->tabAccess['edit'] === '1') $this->writeTranslationFile(); else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else if (Tools::isSubmit('submitTranslationsPdf')) { if ($this->tabAccess['edit'] === '1') // Only the PrestaShop team should write the translations into the _PS_TRANSLATIONS_DIR_ - if (($this->theme_selected == self::DEFAULT_THEME_NAME) && _PS_MODE_DEV_) + if (!$this->theme_selected) $this->writeTranslationFile(); else $this->writeTranslationFile(true); else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else if (Tools::isSubmit('submitTranslationsBack')) { if ($this->tabAccess['edit'] === '1') $this->writeTranslationFile(); else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else if (Tools::isSubmit('submitTranslationsErrors')) { if ($this->tabAccess['edit'] === '1') $this->writeTranslationFile(); else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else if (Tools::isSubmit('submitTranslationsFields')) { if ($this->tabAccess['edit'] === '1') $this->writeTranslationFile(); else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else if (Tools::isSubmit('submitTranslationsMails') || Tools::isSubmit('submitTranslationsMailsAndStay')) @@ -1200,28 +1315,25 @@ class AdminTranslationsControllerCore extends AdminController if ($this->tabAccess['edit'] === '1') $this->submitTranslationsMails(); else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } else if (Tools::isSubmit('submitTranslationsModules')) { if ($this->tabAccess['edit'] === '1') { - // Get a good path for module directory - if ($this->theme_selected == self::DEFAULT_THEME_NAME) - $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; - else - $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; - // Get list of modules if ($modules = $this->getListModules()) { // Get files of all modules - $arr_files = $this->getAllModuleFiles($modules, $i18n_dir, $this->lang_selected->iso_code, true); - + $arr_files = $this->getAllModuleFiles($modules, null, $this->lang_selected->iso_code, true); + // Find and write all translation modules files foreach ($arr_files as $value) $this->findAndWriteTranslationsIntoFile($value['file_name'], $value['files'], $value['theme'], $value['module'], $value['dir']); + // Clear modules cache + Tools::clearCache(); + // Redirect if (Tools::getValue('submitTranslationsModulesAndStay')) $this->redirect(true); @@ -1230,7 +1342,7 @@ class AdminTranslationsControllerCore extends AdminController } } else - $this->errors[] = Tools::displayError('You do not have permission to edit here.'); + $this->errors[] = Tools::displayError('You do not have permission to edit this.'); } } catch (PrestaShopException $e) { $this->errors[] = $e->getMessage(); @@ -1284,10 +1396,10 @@ class AdminTranslationsControllerCore extends AdminController $arr_mail_content['core_mail'] = Tools::getValue('core_mail'); // Get path of directory for find a good path of translation file - if ($this->theme_selected != self::DEFAULT_THEME_NAME) - $arr_mail_path['core_mail'] = $this->translations_informations[$this->type_selected]['override']['dir']; - else + if (!$this->theme_selected) $arr_mail_path['core_mail'] = $this->translations_informations[$this->type_selected]['dir']; + else + $arr_mail_path['core_mail'] = $this->translations_informations[$this->type_selected]['override']['dir']; } if (Tools::getValue('module_mail')) @@ -1295,10 +1407,10 @@ class AdminTranslationsControllerCore extends AdminController $arr_mail_content['module_mail'] = Tools::getValue('module_mail'); // Get path of directory for find a good path of translation file - if ($this->theme_selected != self::DEFAULT_THEME_NAME) - $arr_mail_path['module_mail'] = $this->translations_informations['modules']['override']['dir'].'{module}/mails/'.$this->lang_selected->iso_code.'/'; - else + if (!$this->theme_selected) $arr_mail_path['module_mail'] = $this->translations_informations['modules']['dir'].'{module}/mails/'.$this->lang_selected->iso_code.'/'; + else + $arr_mail_path['module_mail'] = $this->translations_informations['modules']['override']['dir'].'{module}/mails/'.$this->lang_selected->iso_code.'/'; } // Save each mail content @@ -1344,10 +1456,12 @@ class AdminTranslationsControllerCore extends AdminController $path = $arr_mail_path[$group_name]; if ($module_name) $path = str_replace('{module}', $module_name, $path); + if (!file_exists($path) && !mkdir($path, 0777, true)) + throw new PrestaShopException(sprintf(Tools::displayError('Directory "%s" cannot be created'), dirname($file_path))); file_put_contents($path.$mail_name.'.'.$type_content, $content); } else - throw new PrestaShopException(Tools::displayError('HTML e-mail templates cannot contain JavaScript code.')); + throw new PrestaShopException(Tools::displayError('Your HTML email templates cannot contain JavaScript code.')); } } } @@ -1356,12 +1470,10 @@ class AdminTranslationsControllerCore extends AdminController $array_subjects = array(); if (($subjects = Tools::getValue('subject')) && is_array($subjects)) { - $array_subjects['core_and_modules'] = array('translations'=>array(), 'path'=>$arr_mail_path['core_mail'].'lang.php'); - + $array_subjects['core_and_modules'] = array('translations' => array(), 'path' => $arr_mail_path['core_mail'].'lang.php'); foreach ($subjects as $subject_translation) $array_subjects['core_and_modules']['translations'] = array_merge($array_subjects['core_and_modules']['translations'], $subject_translation); } - if (!empty($array_subjects)) foreach ($array_subjects as $infos) $this->writeSubjectTranslationFile($infos['translations'], $infos['path']); @@ -1434,8 +1546,8 @@ class AdminTranslationsControllerCore extends AdminController $language_code = Tools::htmlentitiesUTF8(Language::getLanguageCodeByIso(Tools::getValue('lang'))); return array('language_code' => $language_code, - 'not_available' => addslashes(html_entity_decode($this->l('this language is not available in Google Translate\'s API'), ENT_QUOTES, 'utf-8')), - 'tooltip_title' => addslashes(html_entity_decode($this->l('Google Translate suggests:'), ENT_QUOTES, 'utf-8')) + 'not_available' => addslashes(html_entity_decode($this->l('This language is not available in Google Translate\'s API'), ENT_QUOTES, 'utf-8')), + 'tooltip_title' => addslashes(html_entity_decode($this->l('Google Translate suggests :'), ENT_QUOTES, 'utf-8')) ); } @@ -1476,6 +1588,12 @@ class AdminTranslationsControllerCore extends AdminController */ public function initFormFront() { + if (!$this->theme_exists(Tools::getValue('theme'))) + { + $this->errors[] = sprintf(Tools::displayError('Invalid theme "%s"'), Tools::getValue('theme')); + return; + } + $missing_translations_front = array(); $name_var = $this->translations_informations[$this->type_selected]['var']; $GLOBALS[$name_var] = $this->fileExists(); @@ -1655,9 +1773,17 @@ class AdminTranslationsControllerCore extends AdminController if (preg_match('#controllers#', $tmp)) { - $parent_class = explode(DIRECTORY_SEPARATOR, $tmp); - $key = array_search('controllers', $parent_class); - $prefix_key = 'Admin'.ucfirst($parent_class[$key + 1]); + $parent_class = explode(DIRECTORY_SEPARATOR, str_replace('/', DIRECTORY_SEPARATOR, $tmp)); + $override = array_search('override', $parent_class); + if ($override !== false) + // case override/controllers/admin/templates/controller_name + $prefix_key = 'Admin'.ucfirst($parent_class[$override + 4]); + else + { + // case admin_name/themes/theme_name/template/controllers/controller_name + $key = array_search('controllers', $parent_class); + $prefix_key = 'Admin'.ucfirst($parent_class[$key + 1]); + } } else $prefix_key = 'Admin'.ucfirst(substr($tmp, strrpos($tmp, DIRECTORY_SEPARATOR) + 1, $pos)); @@ -1688,7 +1814,7 @@ class AdminTranslationsControllerCore extends AdminController { if (empty($english_string)) { - $this->errors[] = sprintf($this->l('Error in template - Empty string found, please edit: "%s"'), $file_path); + $this->errors[] = sprintf($this->l('There\'s an error in template, an empty string has been found. Please edit: "%s"'), $file_path); $new_lang[$english_string] = ''; } else @@ -1746,29 +1872,15 @@ class AdminTranslationsControllerCore extends AdminController public function getListModules() { if (!Tools::file_exists_cache($this->translations_informations['modules']['dir'])) - throw new PrestaShopException(Tools::displayError('Fatal error: Module directory does not exist').'('.$this->translations_informations['modules']['dir'].')'); + throw new PrestaShopException(Tools::displayError('Fatal error: The module directory does not exist.').'('.$this->translations_informations['modules']['dir'].')'); if (!is_writable($this->translations_informations['modules']['dir'])) - throw new PrestaShopException(Tools::displayError('The module directory must be writable')); + throw new PrestaShopException(Tools::displayError('The module directory must be writable.')); $modules = array(); - if (!_PS_MODE_DEV_ && $this->theme_selected == self::DEFAULT_THEME_NAME) - { - // Get all module which are installed for to have a minimum of POST - $modules = Module::getModulesInstalled(); - - foreach ($modules as &$module) - $module = $module['name']; - } - else if ($this->theme_selected == self::DEFAULT_THEME_NAME) - if (Tools::file_exists_cache($this->translations_informations['modules']['dir'])) - $modules = scandir($this->translations_informations['modules']['dir']); - else - $this->displayWarning(Tools::displayError('There are no modules in your copy of PrestaShop. Use the Modules page to activate them or go to our Website to download additional Modules.')); - else - if (Tools::file_exists_cache($this->translations_informations['modules']['override']['dir'])) - $modules = scandir($this->translations_informations['modules']['override']['dir']); - else - $this->displayWarning(Tools::displayError('There are no modules in your copy of PrestaShop. Use the Modules page to activate them or go to our Website to download additional Modules.')); + // Get all module which are installed for to have a minimum of POST + $modules = Module::getModulesInstalled(); + foreach ($modules as &$module) + $module = $module['name']; return $modules; } @@ -1936,6 +2048,12 @@ class AdminTranslationsControllerCore extends AdminController public function getMailFiles($dir, $group_name = 'mail') { $arr_return = array(); + if (Language::getIdByIso('en')) + $default_language = 'en'; + else + $default_language = Language::getIsoById((int)Configuration::get('PS_LANG_DEFAULT')); + if (!$default_language || !Validate::isLanguageIsoCode($default_language)) + return false; // Very usefull to name input and textarea fields $arr_return['group_name'] = $group_name; @@ -1944,7 +2062,7 @@ class AdminTranslationsControllerCore extends AdminController $arr_return['directory'] = $dir; // Get path for english mail directory - $dir_en = str_replace('/'.$this->lang_selected->iso_code.'/', '/en/', $dir); + $dir_en = str_replace('/'.$this->lang_selected->iso_code.'/', '/'.$default_language.'/', $dir); if (Tools::file_exists_cache($dir_en)) { @@ -1977,7 +2095,7 @@ class AdminTranslationsControllerCore extends AdminController } } else - $this->warnings[] = sprintf(Tools::displayError('mail directory exists for %1$s but not for english in %2$s'), + $this->warnings[] = sprintf(Tools::displayError('A mail directory exists for %1$s but not for English in %2$s'), $this->lang_selected->iso_code, str_replace(_PS_ROOT_DIR_, '', $dir)); return $arr_return; } @@ -2028,38 +2146,43 @@ class AdminTranslationsControllerCore extends AdminController
        '; if (!empty($mails['files'])) { + $topic_already_displayed = array(); foreach ($mails['files'] as $mail_name => $mail_files) { if (array_key_exists('html', $mail_files) || array_key_exists('txt', $mail_files)) { if (array_key_exists($mail_name, $all_subject_mail)) { - $subject_mail = $all_subject_mail[$mail_name]; - $value_subject_mail = isset($mails['subject'][$subject_mail]) ? $mails['subject'][$subject_mail] : ''; - $str_return .= ' -
        - -
        - '.$subject_mail.'
        '; - if (isset($value_subject_mail['trad']) && $value_subject_mail['trad']) - $str_return .= ''; - else - $str_return .= ''; + foreach ($all_subject_mail[$mail_name] as $subject_mail) + { + $subject_key = 'subject['.Tools::htmlentitiesUTF8($group_name).']['.Tools::htmlentitiesUTF8($subject_mail).']'; + if (in_array($subject_key, $topic_already_displayed)) + continue; + $topic_already_displayed[] = $subject_key; + $value_subject_mail = isset($mails['subject'][$subject_mail]) ? $mails['subject'][$subject_mail] : ''; + $str_return .= ' +
        + +
        + '.$subject_mail.'
        '; + if (isset($value_subject_mail['trad']) && $value_subject_mail['trad']) + $str_return .= ''; + else + $str_return .= ''; - if (isset($value_subject_mail['use_sprintf']) && $value_subject_mail['use_sprintf']) - { - $str_return .= ' - '.$value_subject_mail['use_sprintf'].' - '; - } + if (isset($value_subject_mail['use_sprintf']) && $value_subject_mail['use_sprintf']) + $str_return .= ' + '.$value_subject_mail['use_sprintf'].' + '; $str_return .= '
        -
        '; +
        '; + } } else { $str_return .= '
        - '.sprintf($this->l('No Subject was found for %s, or subject is generated in database.'), ''.$mail_name.'').' + '.sprintf($this->l('No Subject was found for %s in the database.'), ''.$mail_name.'').'
        '; } if (array_key_exists('html', $mail_files)) @@ -2075,12 +2198,11 @@ class AdminTranslationsControllerCore extends AdminController } } else - { - $str_return .= ' -

        '.$this->l('There is a problem getting the Mail files.').'
        ' - .sprintf($this->l('Please ensure that English files exist in %s folder'), ''.$mails['directory'].'en') - .'

        '; - } + $str_return .= '

        + '.$this->l('There was a problem getting the mail files.').'
        + '.sprintf($this->l('English language files must exist in %s folder'), ''.preg_replace('@/[a-z]{2}(/?)$@', '/en$1', $mails['directory']).'').' +

        '; + $str_return .= '
        @@ -2156,7 +2278,7 @@ class AdminTranslationsControllerCore extends AdminController
        '; $str_return .= ' - '.$this->l('Edit this e-mail template').' + '.$this->l('Edit this email template.').'
        @@ -2171,20 +2293,24 @@ class AdminTranslationsControllerCore extends AdminController */ public function getModulesHasMails($with_module_name = false) { - if ($this->theme_selected != self::DEFAULT_THEME_NAME) - $i18n_dir = $this->translations_informations['modules']['override']['dir']; - else - $i18n_dir = $this->translations_informations['modules']['dir']; - $arr_modules = array(); - foreach (scandir($i18n_dir) as $module_dir) + foreach (scandir($this->translations_informations['modules']['dir']) as $module_dir) { - $dir = $i18n_dir.$module_dir.'/'; - if (!in_array($module_dir, self::$ignore_folder) && Tools::file_exists_cache($dir.'mails/')) - if ($with_module_name) - $arr_modules[$module_dir] = $dir; - else - $arr_modules[$dir] = scandir($dir); + if (!in_array($module_dir, self::$ignore_folder)) + { + $dir = false; + if ($this->theme_selected && Tools::file_exists_cache($this->translations_informations['modules']['override']['dir'].$module_dir.'/mails/')) + $dir = $this->translations_informations['modules']['override']['dir'].$module_dir.'/'; + elseif (Tools::file_exists_cache($this->translations_informations['modules']['dir'].$module_dir.'/mails/')) + $dir = $this->translations_informations['modules']['dir'].$module_dir.'/'; + if ($dir !== false) + { + if ($with_module_name) + $arr_modules[$module_dir] = $dir; + else + $arr_modules[$dir] = scandir($dir); + } + } } return $arr_modules; } @@ -2232,7 +2358,7 @@ class AdminTranslationsControllerCore extends AdminController $subject_mail = $this->getSubjectMail($dir, $file, $subject_mail); // Get path of directory for find a good path of translation file - if ($this->theme_selected != self::DEFAULT_THEME_NAME && @filemtime($this->translations_informations[$this->type_selected]['override']['dir'])) + if ($this->theme_selected && @filemtime($this->translations_informations[$this->type_selected]['override']['dir'])) $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; else $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; @@ -2244,7 +2370,7 @@ class AdminTranslationsControllerCore extends AdminController { $module_mails[$module_name] = $this->getMailFiles($module_path.'mails/'.$this->lang_selected->iso_code.'/', 'module_mail'); $module_mails[$module_name]['subject'] = $core_mails['subject']; - $module_mails[$module_name]['display'] = $this->displayMailContent($module_mails[$module_name], $subject_mail, $this->lang_selected, Tools::strtolower($module_name), sprintf($this->l('E-mails for %s module'), ''.$module_name.''), $module_name); + $module_mails[$module_name]['display'] = $this->displayMailContent($module_mails[$module_name], $subject_mail, $this->lang_selected, Tools::strtolower($module_name), sprintf($this->l('Emails for %s module'), ''.$module_name.''), $module_name); } if ($no_display) @@ -2264,7 +2390,7 @@ class AdminTranslationsControllerCore extends AdminController $this->tpl_view_vars = array_merge($this->tpl_view_vars, array( 'limit_warning' => $this->displayLimitPostWarning($this->total_expression), 'tinyMCE' => $this->getTinyMCEForMails($this->lang_selected->iso_code), - 'mail_content' => $this->displayMailContent($core_mails, $subject_mail, $this->lang_selected, 'core', $this->l('Core e-mails')), + 'mail_content' => $this->displayMailContent($core_mails, $subject_mail, $this->lang_selected, 'core', $this->l('Core emails')), 'module_mails' => $module_mails, 'theme_name' => $this->theme_selected )); @@ -2287,21 +2413,27 @@ class AdminTranslationsControllerCore extends AdminController $content = file_get_contents($dir.'/'.$file); $content = str_replace("\n", ' ', $content); + // Subject must match with a template, therefor we first grep the Mail::Send() function then the Mail::l() inside. if (preg_match_all('/Mail::Send([^;]*);/si', $content, $tab)) for ($i = 0; isset($tab[1][$i]); $i++) { $tab2 = explode(',', $tab[1][$i]); - if (is_array($tab2)) - if ($tab2 && isset($tab2[1])) - { - $tab2[1] = trim(str_replace('\'', '', $tab2[1])); - if (preg_match('/Mail::l\(\''._PS_TRANS_PATTERN_.'\'/s', $tab2[2], $matches)) - $subject_mail[$tab2[1]] = $matches[1]; - } + if (is_array($tab2) && isset($tab2[1])) + { + $template = trim(str_replace('\'', '', $tab2[1])); + foreach ($tab2 as $tab3) + if (preg_match('/Mail::l\(\''._PS_TRANS_PATTERN_.'\'\)/Us', $tab3.')', $matches)) + { + if (!isset($subject_mail[$template])) + $subject_mail[$template] = array(); + if (!in_array($matches[1], $subject_mail[$template])) + $subject_mail[$template][] = $matches[1]; + } + } } if (!in_array($file, self::$ignore_folder) && is_dir($dir.'/'.$file)) - $subject_mail = $this->getSubjectMail($dir, $file, $subject_mail); + $subject_mail = $this->getSubjectMail($dir, $file, $subject_mail); return $subject_mail; } @@ -2335,6 +2467,9 @@ class AdminTranslationsControllerCore extends AdminController protected function writeSubjectTranslationFile($sub, $path) { + if (!Tools::file_exists_cache(dirname(path))) + if (!mkdir(dirname(path), 0700)) + throw new PrestaShopException('Directory '.dirname(path).' cannot be created.'); if ($fd = @fopen($path, 'w')) { $tab = 'LANGMAIL'; @@ -2352,7 +2487,7 @@ class AdminTranslationsControllerCore extends AdminController fclose($fd); } else - throw new PrestaShopException(sprintf(Tools::displayError('Cannot write language file for e-mail subjects, path is: %s'), $path)); + throw new PrestaShopException(sprintf(Tools::displayError('Cannot write language file for email subjects. Path is: %s'), $path)); } /** @@ -2398,19 +2533,46 @@ class AdminTranslationsControllerCore extends AdminController * @param boolean $is_default set it if modules are located in root/prestashop/modules folder * This allow to distinguish overrided prestashop theme and original module */ - protected function getAllModuleFiles($modules, $root_dir, $lang, $is_default = false) + protected function getAllModuleFiles($modules, $root_dir = null, $lang, $is_default = false) { $array_files = array(); + $initial_root_dir = $root_dir; foreach ($modules as $module) { - if ($module{0} != '.' && is_dir($root_dir.$module)) + $root_dir = $initial_root_dir; + if ($module{0} == '.') + continue; + + // First we load the default translation file + if ($root_dir == null) { - if (Tools::file_exists_cache($root_dir.$module.'/translations/'.$lang.'.php')) - $lang_file = $root_dir.$module.'/translations/'.$lang.'.php'; - else + $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; + if (is_dir($i18n_dir.$module)) + $root_dir = $i18n_dir; + + $lang_file = $root_dir.$module.'/translations/'.$lang.'.php'; + if (!Tools::file_exists_cache($root_dir.$module.'/translations/'.$lang.'.php') && Tools::file_exists_cache($root_dir.$module.'/'.$lang.'.php')) $lang_file = $root_dir.$module.'/'.$lang.'.php'; @include($lang_file); + $this->getModuleTranslations(); + // If a theme is selected, then the destination translation file must be in the theme + if ($this->theme_selected) + $lang_file = $this->translations_informations[$this->type_selected]['override']['dir'].$module.'/translations/'.$lang.'.php'; + $this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $lang_file, $is_default); + } + $root_dir = $initial_root_dir; + // Then we load the overriden translation file + if ($this->theme_selected && isset($this->translations_informations[$this->type_selected]['override'])) + { + $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; + if (is_dir($i18n_dir.$module)) + $root_dir = $i18n_dir; + if (Tools::file_exists_cache($root_dir.$module.'/translations/'.$lang.'.php')) + $lang_file = $root_dir.$module.'/translations/'.$lang.'.php'; + elseif (Tools::file_exists_cache($root_dir.$module.'/'.$lang.'.php')) + $lang_file = $root_dir.$module.'/'.$lang.'.php'; + @include($lang_file); $this->getModuleTranslations(); $this->recursiveGetModuleFiles($root_dir.$module.'/', $array_files, $module, $lang_file, $is_default); } @@ -2423,20 +2585,13 @@ class AdminTranslationsControllerCore extends AdminController */ public function initFormModules() { - // Get path of directory for find a good path of translation file - if ($this->theme_selected != self::DEFAULT_THEME_NAME) - $i18n_dir = $this->translations_informations[$this->type_selected]['override']['dir']; - else - $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; - // Get list of modules $modules = $this->getListModules(); if (!empty($modules)) { // Get all modules files and include all translation files - $arr_files = $this->getAllModuleFiles($modules, $i18n_dir, $this->lang_selected->iso_code, true); - + $arr_files = $this->getAllModuleFiles($modules, null, $this->lang_selected->iso_code, true); foreach ($arr_files as $value) $this->findAndFillTranslations($value['files'], $value['theme'], $value['module'], $value['dir']); @@ -2503,7 +2658,7 @@ class AdminTranslationsControllerCore extends AdminController $i18n_dir = $this->translations_informations[$this->type_selected]['dir']; $default_i18n_file = $i18n_dir.$this->translations_informations[$this->type_selected]['file']; - if (($this->theme_selected == self::DEFAULT_THEME_NAME) && _PS_MODE_DEV_) + if (!$this->theme_selected) $i18n_file = $default_i18n_file; else { @@ -2598,5 +2753,16 @@ class AdminTranslationsControllerCore extends AdminController } return $list; } + + protected function theme_exists($theme) + { + if (!is_array($this->themes)) + $this->themes = Theme::getThemes(); + $theme_exists = false; + foreach ($this->themes as $existing_theme) + if ($existing_theme->directory == $theme) + return true; + return false; + } } diff --git a/controllers/admin/AdminWarehousesController.php b/controllers/admin/AdminWarehousesController.php index 7ccfcae70..dc4d2d1ec 100644 --- a/controllers/admin/AdminWarehousesController.php +++ b/controllers/admin/AdminWarehousesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -105,12 +105,12 @@ class AdminWarehousesControllerCore extends AdminController // display help informations $this->displayInformation($this->l('This interface allows you to manage your warehouses.').'
        '); - $this->displayInformation($this->l('Before adding stock in your warehouses, you should check the general default currency used.').'
        '); - $this->displayInformation($this->l('Furthermore, for each warehouse, you should check:')); - $this->displayInformation($this->l('the management type (according to the law in your country), the valuation currency, its associated carriers and shops.').'
        '); - $this->displayInformation($this->l('Finally, you can see detailed informations on your stock per warehouse, such as its overall value, the number of products and quantities stored, etc.') + $this->displayInformation($this->l('Before adding stock in your warehouses, you should check the default currency used.').'
        '); + $this->displayInformation($this->l('You should also check:')); + $this->displayInformation($this->l('the management type (according to the law in your country), the valuation currency and its associated carriers and shops.').'
        '); + $this->displayInformation($this->l('You can also see detailed information about your stock, such as its overall value, the number of products and quantities stored, etc...') .'

        '); - $this->displayInformation($this->l('Be careful, products from different warehouses will need to be shipped in different packages.')); + $this->displayInformation($this->l('Be careful! Products from different warehouses will need to be shipped in different packages.')); return parent::renderList(); } @@ -134,9 +134,9 @@ class AdminWarehousesControllerCore extends AdminController // sets the title of the toolbar if (Tools::isSubmit('add'.$this->table)) - $this->toolbar_title = $this->l('Stock: create warehouse'); + $this->toolbar_title = $this->l('Stock: Create a warehouse'); else - $this->toolbar_title = $this->l('Stock: warehouse management'); + $this->toolbar_title = $this->l('Stock: Warehouse management'); // sets the fields of the form $this->fields_form = array( @@ -219,7 +219,7 @@ class AdminWarehousesControllerCore extends AdminController 'id' => 'id_country', 'name' => 'name', ), - 'desc' => $this->l('Country where the state, region or city is located') + 'desc' => $this->l('Warehouse location country') ), array( 'type' => 'select', @@ -254,8 +254,8 @@ class AdminWarehousesControllerCore extends AdminController 'id' => 'id_reference', 'name' => 'name' ), - 'desc' => $this->l('Associated carriers. Use CTRL+CLICK to select several.'), - 'hint' => $this->l('You can specify the carriers available to ship orders from this warehouse'), + 'desc' => $this->l('Associated carriers. Use CTRL+CLICK to select several.').'
        '.$this->l('You must select at least one carrier, if you do not select a carrier none will be able to ship from this warehouse.'), + 'hint' => $this->l('You can specify the number of carriers available to ship orders from particular warehouses.'), ), ), @@ -280,7 +280,7 @@ class AdminWarehousesControllerCore extends AdminController $this->fields_form['input'][] = array( 'type' => 'select', 'label' => $this->l('Management type:'), - 'hint' => $this->l('Careful! You won\'t be able to change this value later!'), + 'hint' => $this->l('Be careful! You won\'t be able to change this value later!'), 'name' => 'management_type', 'required' => true, 'options' => array( @@ -308,7 +308,7 @@ class AdminWarehousesControllerCore extends AdminController $this->fields_form['input'][] = array( 'type' => 'select', 'label' => $this->l('Stock valuation currency:'), - 'hint' => $this->l('Careful! You won\'t be able to change this value later!'), + 'hint' => $this->l('Be careful! You won\'t be able to change this value later!'), 'name' => 'id_currency', 'required' => true, 'options' => array( @@ -424,7 +424,7 @@ class AdminWarehousesControllerCore extends AdminController $address = new Address($object->id_address); if (Validate::isLoadedObject($address)) { - $address->id_warehouse = $object->id_address; + $address->id_warehouse = (int)$object->id; $address->save(); } @@ -470,7 +470,7 @@ class AdminWarehousesControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initContent(); @@ -480,7 +480,7 @@ class AdminWarehousesControllerCore extends AdminController { if (!Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')) { - $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management prior to use this feature.'); + $this->warnings[md5('PS_ADVANCED_STOCK_MANAGEMENT')] = $this->l('You need to activate advanced stock management before using this feature.'); return false; } parent::initProcess(); @@ -532,7 +532,7 @@ class AdminWarehousesControllerCore extends AdminController { foreach ($validation as $item) $this->errors[] = $item; - $this->errors[] = Tools::displayError('The address is not correct. Check if all required fields are filled.'); + $this->errors[] = Tools::displayError('The address is not correct. Please make sure all of the required fields are completed.'); } else // valid { @@ -557,7 +557,7 @@ class AdminWarehousesControllerCore extends AdminController if (!($obj = $this->loadObject(true))) return; else if ($obj->getQuantitiesOfProducts() > 0) // not possible : products - $this->errors[] = $this->l('It is not possible to delete a Warehouse when there are products in it.'); + $this->errors[] = $this->l('It is not possible to delete a warehouse when there are products in it.'); else if (SupplyOrder::warehouseHasPendingOrders($obj->id)) // not possible : supply orders $this->errors[] = $this->l('It is not possible to delete a Warehouse if it has pending supply orders.'); else // else, it can be deleted diff --git a/controllers/admin/AdminWebserviceController.php b/controllers/admin/AdminWebserviceController.php index 8331fbcf7..0f58c680c 100755 --- a/controllers/admin/AdminWebserviceController.php +++ b/controllers/admin/AdminWebserviceController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -70,17 +70,17 @@ class AdminWebserviceControllerCore extends AdminController 'general' => array( 'title' => $this->l('Configuration'), 'fields' => array( - 'PS_WEBSERVICE' => array('title' => $this->l('Enable PrestaShop Webservice'), + 'PS_WEBSERVICE' => array('title' => $this->l('Enable PrestaShop\'s webservice'), 'desc' => $this->l('Before activating the webservice, you must be sure to: '). '
          -
        1. '.$this->l('be certain that URL rewriting is available on this server').'
        2. -
        3. '.$this->l('be certain that the 5 methods GET, POST, PUT, DELETE and HEAD are supported by this server').'
        4. +
        5. '.$this->l('Check that URL rewriting is available on this server').'
        6. +
        7. '.$this->l('Check that the five methods GET, POST, PUT, DELETE and HEAD are supported by this server.').'
        ', 'cast' => 'intval', 'type' => 'bool'), 'PS_WEBSERVICE_CGI_HOST' => array( 'title' => $this->l('Active mode CGI for PHP'), - 'desc' => $this->l('Be sure PHP is not configured as an Apache module on your server'), + 'desc' => $this->l('Be sure PHP is not configured as an Apache module on your server.'), 'cast' => 'intval', 'type' => 'bool' ), @@ -113,7 +113,7 @@ class AdminWebserviceControllerCore extends AdminController 'id' => 'code', 'size' => 32, 'required' => true, - 'desc' => $this->l('Webservice account key'), + 'desc' => $this->l('Webservice account key.'), ), array( 'type' => 'textarea', @@ -161,7 +161,7 @@ class AdminWebserviceControllerCore extends AdminController } $this->fields_form['submit'] = array( - 'title' => $this->l(' Save '), + 'title' => $this->l('Save '), 'class' => 'button' ); @@ -220,9 +220,9 @@ class AdminWebserviceControllerCore extends AdminController public function postProcess() { if (Tools::getValue('key') && strlen(Tools::getValue('key')) < 32) - $this->errors[] = Tools::displayError($this->l('Key length must be 32 character long')); + $this->errors[] = Tools::displayError($this->l('Key length must be 32 character long.')); if (WebserviceKey::keyExists(Tools::getValue('key')) && !Tools::getValue('id_webservice_account')) - $this->errors[] = Tools::displayError($this->l('Key already exists')); + $this->errors[] = Tools::displayError($this->l('This key already exists.')); return parent::postProcess(); } @@ -247,17 +247,17 @@ class AdminWebserviceControllerCore extends AdminController { $apache_modules = apache_get_modules(); if (!in_array('mod_auth_basic', $apache_modules)) - $this->warnings[] = $this->l('Please activate the Apache module \'mod_auth_basic\' to allow authentication of PrestaShop webservice.'); + $this->warnings[] = $this->l('Please activate the Apache module \'mod_auth_basic\' to allow authentication of PrestaShop\'s webservice.'); if (!in_array('mod_rewrite', $apache_modules)) $this->warnings[] = $this->l('Please activate the Apache module \'mod_rewrite\' to allow the PrestaShop webservice.'); } else - $this->warnings[] = $this->l('We could not check if basic authentication and rewrite extensions are activated. Please manually check if they are activated in order to use the PrestaShop webservice.'); + $this->warnings[] = $this->l('We could not check to see if basic authentication and rewrite extensions have been activated. Please manually check if they\'ve been activated in order to use the PrestaShop webservice.'); } if (!extension_loaded('SimpleXML')) - $this->warnings[] = $this->l('Please activate the PHP extension \'SimpleXML\' to allow testing of PrestaShop webservice.'); + $this->warnings[] = $this->l('Please activate the PHP extension \'SimpleXML\' to allow testing of PrestaShop\'s webservice.'); if (!configuration::get('PS_SSL_ENABLED')) - $this->warnings[] = $this->l('If possible, it is preferable to use SSL (https) for webservice calls, as it avoids the security issues of type "man in the middle".'); + $this->warnings[] = $this->l('It is preferable to use SSL (https:) for webservice calls, as it avoids the "man in the middle" type security issues. '); foreach ($this->_list as $k => $item) if ($item['is_module'] && $item['class_name'] && $item['module_name'] && diff --git a/controllers/admin/AdminZonesController.php b/controllers/admin/AdminZonesController.php index 483da16e7..2a8d8e98c 100644 --- a/controllers/admin/AdminZonesController.php +++ b/controllers/admin/AdminZonesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -80,7 +80,7 @@ class AdminZonesControllerCore extends AdminController 'input' => array( array( 'type' => 'text', - 'label' => $this->l('Name'), + 'label' => $this->l('Name:'), 'name' => 'name', 'size' => 33, 'required' => true, diff --git a/controllers/admin/index.php b/controllers/admin/index.php index cadb1ea6e..5ca842ada 100644 --- a/controllers/admin/index.php +++ b/controllers/admin/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/controllers/front/AddressController.php b/controllers/front/AddressController.php index 214720329..699a37287 100644 --- a/controllers/front/AddressController.php +++ b/controllers/front/AddressController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -117,20 +117,17 @@ class AddressControllerCore extends FrontController */ protected function processSubmitAddress() { - /*if ($this->context->customer->is_guest) - Tools::redirect('index.php?controller=addresses');*/ - $address = new Address(); $this->errors = $address->validateController(); $address->id_customer = (int)$this->context->customer->id; // Check page token if ($this->context->customer->isLogged() && !$this->isTokenValid()) - $this->errors[] = Tools::displayError('Invalid token'); + $this->errors[] = Tools::displayError('Invalid token.'); // Check phone if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !Tools::getValue('phone') && !Tools::getValue('phone_mobile')) - $this->errors[] = Tools::displayError('You must register at least one phone number'); + $this->errors[] = Tools::displayError('You must register at least one phone number.'); if ($address->id_country) { // Check country @@ -138,55 +135,48 @@ class AddressControllerCore extends FrontController throw new PrestaShopException('Country cannot be loaded with address->id_country'); if ((int)$country->contains_states && !(int)$address->id_state) - $this->errors[] = Tools::displayError('This country requires a state selection.'); + $this->errors[] = Tools::displayError('This country requires you to chose a State.'); // US customer: normalize the address - if ($address->id_country == Country::getByIso('US')) + if ($address->id_country == Country::getByIso('US') && Configuration::get('PS_TAASC')) { include_once(_PS_TAASC_PATH_.'AddressStandardizationSolution.php'); $normalize = new AddressStandardizationSolution; $address->address1 = $normalize->AddressLineStandardization($address->address1); $address->address2 = $normalize->AddressLineStandardization($address->address2); } - - // Check country zip code - $zip_code_format = $country->zip_code_format; - if ($country->need_zip_code) - { - if (($postcode = Tools::getValue('postcode')) && $zip_code_format) - { - if (!$country->checkZipCode($postcode)) - $this->errors[] = sprintf( - Tools::displayError('Zip/Postal code is invalid. Must be typed as follows: %s'), - str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $country->zip_code_format))) - ); - } - else if ($zip_code_format) - $this->errors[] = Tools::displayError('Zip/Postal code is required.'); - else if ($postcode && !preg_match('/^[0-9a-zA-Z -]{4,9}$/ui', $postcode)) - $this->errors[] = sprintf( - Tools::displayError('Zip/Postal code is invalid. Must be typed as follows: %s'), - str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $country->zip_code_format))) - ); - } + + $postcode = Tools::getValue('postcode'); + /* Check zip code format */ + if ($country->zip_code_format && !$country->checkZipCode($postcode)) + $this->errors[] = sprintf(Tools::displayError('The Zip/Postal code you\'ve entered is invalid. It must follow this format: %s'), str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $country->zip_code_format)))); + elseif(empty($postcode) && $country->need_zip_code) + $this->errors[] = Tools::displayError('A Zip / Postal code is required.'); + elseif ($postcode && !Validate::isPostCode($postcode)) + $this->errors[] = Tools::displayError('The Zip / Postal code is invalid.'); // Check country DNI if ($country->isNeedDni() && (!Tools::getValue('dni') || !Validate::isDniLite(Tools::getValue('dni')))) - $this->errors[] = Tools::displayError('Identification number is incorrect or has already been used.'); + $this->errors[] = Tools::displayError('The identification number is incorrect or has already been used.'); else if (!$country->isNeedDni()) $address->dni = null; } // Check if the alias exists - if (!$this->context->customer->is_guest && !empty($_POST['alias']) - && (int)$this->context->customer->id > 0 - && Db::getInstance()->getValue(' + if (!$this->context->customer->is_guest && !empty($_POST['alias']) && (int)$this->context->customer->id > 0) + { + $id_address = Tools::getValue('id_address'); + if(Configuration::get('PS_ORDER_PROCESS_TYPE') && (int)Tools::getValue('opc_id_address_'.Tools::getValue('type')) > 0) + $id_address = Tools::getValue('opc_id_address_'.Tools::getValue('type')); + + if (Db::getInstance()->getValue(' SELECT count(*) FROM '._DB_PREFIX_.'address WHERE `alias` = \''.pSql($_POST['alias']).'\' - AND id_address != '.(int)Tools::getValue('id_address').' + AND id_address != '.(int)$id_address.' AND id_customer = '.(int)$this->context->customer->id.' AND deleted = 0') > 0) - $this->errors[] = sprintf(Tools::displayError('The alias "%s" is already used, please chose another one.'), Tools::safeOutput($_POST['alias'])); + $this->errors[] = sprintf(Tools::displayError('The alias "%s" has already been used. Please select another one.'), Tools::safeOutput($_POST['alias'])); + } // Check the requires fields which are settings in the BO $this->errors = array_merge($this->errors, $address->validateFieldsRequiredDatabase()); @@ -212,16 +202,35 @@ class AddressControllerCore extends FrontController } } } - + + if ($this->ajax && Tools::getValue('type') == 'invoice' && Configuration::get('PS_ORDER_PROCESS_TYPE')) + { + $this->errors = array_unique(array_merge($this->errors, $address->validateController())); + if (count($this->errors)) + { + $return = array( + 'hasError' => (bool)$this->errors, + 'errors' => $this->errors + ); + die(Tools::jsonEncode($return)); + } + } + // Save address if ($result = $address->save()) - { + { // Update id address of the current cart if necessary if (isset($address_old) && $address_old->isUsed()) $this->context->cart->updateAddressId($address_old->id, $address->id); else // Update cart address $this->context->cart->autosetProductAddress(); + if ((bool)(Tools::getValue('select_address', false)) == true OR Tools::getValue('type') == 'invoice' && Configuration::get('PS_ORDER_PROCESS_TYPE')) + { + $this->context->cart->id_address_invoice = (int)$address->id; + $this->context->cart->update(); + } + if ($this->ajax) { $return = array( @@ -241,7 +250,7 @@ class AddressControllerCore extends FrontController } else Tools::redirect('index.php?controller=addresses'); - } + } $this->errors[] = Tools::displayError('An error occurred while updating your address.'); } @@ -253,17 +262,14 @@ class AddressControllerCore extends FrontController { parent::initContent(); - /* Secure restriction for guest */ - if ($this->context->customer->is_guest) - Tools::redirect('index.php?controller=addresses'); - $this->assignCountries(); $this->assignVatNumber(); $this->assignAddressFormat(); // Assign common vars $this->context->smarty->assign(array( - 'onr_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'), + 'one_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'), + 'onr_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'), //retro compat 'ajaxurl' => _MODULE_DIR_, 'errors' => $this->errors, 'token' => Tools::getToken(false), diff --git a/controllers/front/AddressesController.php b/controllers/front/AddressesController.php index 655818cc8..d3a46f311 100644 --- a/controllers/front/AddressesController.php +++ b/controllers/front/AddressesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -50,7 +50,7 @@ class AddressesControllerCore extends FrontController parent::init(); if (!Validate::isLoadedObject($this->context->customer)) - die(Tools::displayError('Customer not found')); + die(Tools::displayError('The customer could not be found.')); } /** diff --git a/controllers/front/AttachmentController.php b/controllers/front/AttachmentController.php index 11eb8a71a..3c5daedda 100644 --- a/controllers/front/AttachmentController.php +++ b/controllers/front/AttachmentController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -32,6 +32,9 @@ class AttachmentControllerCore extends FrontController if (!$a->id) Tools::redirect('index.php'); + if (ob_get_level()) + ob_end_clean(); + header('Content-Transfer-Encoding: binary'); header('Content-Type: '.$a->mime); header('Content-Length: '.filesize(_PS_DOWNLOAD_DIR_.$a->file)); diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index 92859d12c..717937594 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -43,7 +43,7 @@ class AuthControllerCore extends FrontController parent::init(); if (!Tools::getIsset('step') && $this->context->customer->isLogged() && !$this->ajax) - Tools::redirect('index.php?controller=my-account'); + Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account')); if (Tools::getValue('create_account')) $this->create_account = true; @@ -56,7 +56,8 @@ class AuthControllerCore extends FrontController public function setMedia() { parent::setMedia(); - $this->addCSS(_THEME_CSS_DIR_.'authentication.css'); + if (Context::getContext()->getMobileDevice() === false) + $this->addCSS(_THEME_CSS_DIR_.'authentication.css'); $this->addJqueryPlugin('typewatch'); $this->addJS(_THEME_JS_DIR_.'tools/statesManagement.js'); } @@ -84,11 +85,7 @@ class AuthControllerCore extends FrontController $this->assignCountries(); - $active_module_newsletter = false; - if ($module_newsletter = Module::getInstanceByName('blocknewsletter')) - $active_module_newsletter = $module_newsletter->active; - - $this->context->smarty->assign('newsletter', (int)$active_module_newsletter); + $this->context->smarty->assign('newsletter', 1); $back = Tools::getValue('back'); $key = Tools::safeOutput(Tools::getValue('key')); @@ -103,12 +100,21 @@ class AuthControllerCore extends FrontController $countries = Carrier::getDeliveredCountries($this->context->language->id, true, true); else $countries = Country::getCountries($this->context->language->id, true); - + + if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) + { + $array = preg_split('/,|-/', $_SERVER['HTTP_ACCEPT_LANGUAGE']); + if (!Validate::isLanguageIsoCode($array[0]) || !($sl_country = Country::getByIso($array[0]))) + $sl_country = (int)Configuration::get('PS_COUNTRY_DEFAULT'); + } + else + $sl_country = (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT')); + $this->context->smarty->assign(array( 'inOrderProcess' => true, 'PS_GUEST_CHECKOUT_ENABLED' => Configuration::get('PS_GUEST_CHECKOUT_ENABLED'), 'PS_REGISTRATION_PROCESS_TYPE' => Configuration::get('PS_REGISTRATION_PROCESS_TYPE'), - 'sl_country' => (int)Tools::getValue('id_country', Configuration::get('PS_COUNTRY_DEFAULT')), + 'sl_country' => (int)$sl_country, 'countries' => $countries )); } @@ -129,6 +135,9 @@ class AuthControllerCore extends FrontController 'HOOK_CREATE_ACCOUNT_TOP' => Hook::exec('displayCustomerAccountFormTop') )); + // Just set $this->template value here in case it's used by Ajax + $this->setTemplate(_PS_THEME_DIR_.'authentication.tpl'); + if ($this->ajax) { // Call a hook to display more information on form @@ -140,12 +149,11 @@ class AuthControllerCore extends FrontController $return = array( 'hasError' => !empty($this->errors), 'errors' => $this->errors, - 'page' => $this->context->smarty->fetch(_PS_THEME_DIR_.'authentication.tpl'), + 'page' => $this->context->smarty->fetch($this->template), 'token' => Tools::getToken(false) ); die(Tools::jsonEncode($return)); } - $this->setTemplate(_PS_THEME_DIR_.'authentication.tpl'); } /** @@ -166,7 +174,8 @@ class AuthControllerCore extends FrontController $days = Tools::dateDays(); $this->context->smarty->assign(array( - 'onr_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'), + 'one_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'), + 'onr_phone_at_least' => (int)Configuration::get('PS_ONE_PHONE_AT_LEAST'), //retro compat 'years' => $years, 'sl_year' => (isset($selectedYears) ? $selectedYears : 0), 'months' => $months, @@ -264,19 +273,19 @@ class AuthControllerCore extends FrontController $passwd = trim(Tools::getValue('passwd')); $email = trim(Tools::getValue('email')); if (empty($email)) - $this->errors[] = Tools::displayError('E-mail address required'); + $this->errors[] = Tools::displayError('An email address required.'); elseif (!Validate::isEmail($email)) - $this->errors[] = Tools::displayError('Invalid e-mail address'); + $this->errors[] = Tools::displayError('Invalid email address.'); elseif (empty($passwd)) - $this->errors[] = Tools::displayError('Password is required'); + $this->errors[] = Tools::displayError('Password is required.'); elseif (!Validate::isPasswd($passwd)) - $this->errors[] = Tools::displayError('Invalid password'); + $this->errors[] = Tools::displayError('Invalid password.'); else { $customer = new Customer(); $authentication = $customer->getByEmail(trim($email), trim($passwd)); if (!$authentication || !$customer->id) - $this->errors[] = Tools::displayError('Authentication failed'); + $this->errors[] = Tools::displayError('Authentication failed.'); else { $this->context->cookie->id_compare = isset($this->context->cookie->id_compare) ? $this->context->cookie->id_compare: CompareProduct::getIdCompareByIdCustomer($customer->id); @@ -292,17 +301,20 @@ class AuthControllerCore extends FrontController // Add customer to the context $this->context->customer = $customer; - if (Configuration::get('PS_CART_FOLLOWING') && (empty($this->context->cookie->id_cart) || Cart::getNbProducts($this->context->cookie->id_cart) == 0)) - $this->context->cookie->id_cart = (int)Cart::lastNoneOrderedCart($this->context->customer->id); - - // Update cart address - $this->context->cart->id = $this->context->cookie->id_cart; - $this->context->cart->setDeliveryOption(null); - $this->context->cart->id_address_delivery = Address::getFirstCustomerAddressId((int)($customer->id)); - - $this->context->cart->id_address_invoice = Address::getFirstCustomerAddressId((int)($customer->id)); + if (Configuration::get('PS_CART_FOLLOWING') && (empty($this->context->cookie->id_cart) || Cart::getNbProducts($this->context->cookie->id_cart) == 0) && $id_cart = (int)Cart::lastNoneOrderedCart($this->context->customer->id)) + $this->context->cart = new Cart($id_cart); + else + { + $this->context->cart->id_carrier = 0; + $this->context->cart->setDeliveryOption(null); + $this->context->cart->id_address_delivery = Address::getFirstCustomerAddressId((int)($customer->id)); + $this->context->cart->id_address_invoice = Address::getFirstCustomerAddressId((int)($customer->id)); + } + $this->context->cart->id_customer = (int)$customer->id; $this->context->cart->secure_key = $customer->secure_key; - $this->context->cart->update(); + $this->context->cart->save(); + $this->context->cookie->id_cart = (int)$this->context->cart->id; + $this->context->cookie->write(); $this->context->cart->autosetProductAddress(); Hook::exec('actionAuthentication'); @@ -315,7 +327,7 @@ class AuthControllerCore extends FrontController { if ($back = Tools::getValue('back')) Tools::redirect(html_entity_decode($back)); - Tools::redirect('index.php?controller=my-account'); + Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account')); } } } @@ -363,7 +375,7 @@ class AuthControllerCore extends FrontController $this->context->smarty->assign('email_create', 1); // New Guest customer if (!Tools::getValue('is_new_customer', 1) && !Configuration::get('PS_GUEST_CHECKOUT_ENABLED')) - $this->errors[] = Tools::displayError('You cannot create a guest account.'); + $this->errors[] = Tools::displayError('You cannot create a guest account..'); if (!Tools::getValue('is_new_customer', 1)) $_POST['passwd'] = md5(time()._COOKIE_KEY_); if (isset($_POST['guest_email']) && $_POST['guest_email']) @@ -371,45 +383,61 @@ class AuthControllerCore extends FrontController // Checked the user address in case he changed his email address if (Validate::isEmail($email = Tools::getValue('email')) && !empty($email)) if (Customer::customerExists($email)) - $this->errors[] = Tools::displayError('An account is already registered with this e-mail.', false); + $this->errors[] = Tools::displayError('An account using this email address has already been registered.', false); // Preparing customer $customer = new Customer(); + $lastnameAddress = Tools::getValue('lastname'); + $firstnameAddress = Tools::getValue('firstname'); $_POST['lastname'] = Tools::getValue('customer_lastname'); $_POST['firstname'] = Tools::getValue('customer_firstname'); - if (Configuration::get('PS_ONE_PHONE_AT_LEAST') && !Tools::getValue('phone') && !Tools::getValue('phone_mobile') && - (Configuration::get('PS_REGISTRATION_PROCESS_TYPE') || Configuration::get('PS_GUEST_CHECKOUT_ENABLED'))) - $this->errors[] = Tools::displayError('You must register at least one phone number'); - + $error_phone = false; + if (Configuration::get('PS_ONE_PHONE_AT_LEAST')) + { + if (Tools::isSubmit('submitGuestAccount') || !Tools::getValue('is_new_customer')) + { + if (!Tools::getValue('phone') && !Tools::getValue('phone_mobile')) + $error_phone = true; + } + elseif (((Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && Configuration::get('PS_ORDER_PROCESS_TYPE')) + || (Configuration::get('PS_ORDER_PROCESS_TYPE') && !Tools::getValue('email_create'))) + && (!Tools::getValue('phone') && !Tools::getValue('phone_mobile'))) + $error_phone = true; + elseif (((Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && Configuration::get('PS_ORDER_PROCESS_TYPE') && Tools::getValue('email_create'))) + && (!Tools::getValue('phone') && !Tools::getValue('phone_mobile'))) + $error_phone = true; + } + + if ($error_phone) + $this->errors[] = Tools::displayError('You must register at least one phone number.'); + $this->errors = array_unique(array_merge($this->errors, $customer->validateController())); // Check the requires fields which are settings in the BO - $this->errors = array_merge($this->errors, $customer->validateFieldsRequiredDatabase()); + $this->errors = $this->errors + $customer->validateFieldsRequiredDatabase(); if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax && !Tools::isSubmit('submitGuestAccount')) { - if (!count($this->errors)) { if (Tools::isSubmit('newsletter')) $this->processCustomerNewsletter($customer); + $customer->birthday = (empty($_POST['years']) ? '' : (int)$_POST['years'].'-'.(int)$_POST['months'].'-'.(int)$_POST['days']); if (!Validate::isBirthDate($customer->birthday)) - $this->errors[] = Tools::displayError('Invalid birthday.'); - $customer->active = 1; + $this->errors[] = Tools::displayError('Invalid date of birth.'); + // New Guest customer - if (Tools::isSubmit('is_new_customer')) - $customer->is_guest = !Tools::getValue('is_new_customer', 1); - else - $customer->is_guest = 0; + $customer->is_guest = (Tools::isSubmit('is_new_customer') ? !Tools::getValue('is_new_customer', 1) : 0); + $customer->active = 1; + if (!count($this->errors)) - if (!$customer->add()) - $this->errors[] = Tools::displayError('An error occurred while creating your account.'); - else + { + if ($customer->add()) { if (!$customer->is_guest) if (!$this->sendConfirmationMail($customer)) - $this->errors[] = Tools::displayError('Cannot send e-mail'); + $this->errors[] = Tools::displayError('The email cannot be sent.'); $this->updateContext($customer); @@ -431,20 +459,24 @@ class AuthControllerCore extends FrontController ); die(Tools::jsonEncode($return)); } + + if ($back = Tools::getValue('back')) + Tools::redirect(html_entity_decode($back)); // redirection: if cart is not empty : redirection to the cart if (count($this->context->cart->getProducts(true)) > 0) Tools::redirect('index.php?controller=order&multi-shipping='.(int)Tools::getValue('multi-shipping')); // else : redirection to the account else - Tools::redirect('index.php?controller=my-account'); + Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account')); } + else + $this->errors[] = Tools::displayError('An error occurred while creating your account.'); + } } } else // if registration type is in one step, we save the address { - $lastnameAddress = $_POST['lastname']; - $firstnameAddress = $_POST['firstname']; // Preparing address $address = new Address(); $_POST['lastname'] = $lastnameAddress; @@ -453,7 +485,7 @@ class AuthControllerCore extends FrontController $this->errors = array_unique(array_merge($this->errors, $address->validateController())); // US customer: normalize the address - if ($address->id_country == Country::getByIso('US')) + if ($address->id_country == Country::getByIso('US') && Configuration::get('PS_TAASC')) { include_once(_PS_TAASC_PATH_.'AddressStandardizationSolution.php'); $normalize = new AddressStandardizationSolution; @@ -461,25 +493,19 @@ class AuthControllerCore extends FrontController $address->address2 = $normalize->AddressLineStandardization($address->address2); } - $country = new Country((int)Tools::getValue('id_country')); - if ($country->need_zip_code) - { - if (($postcode = Tools::getValue('postcode')) && $country->zip_code_format) - { - if (!$country->checkZipCode($postcode)) - $this->errors[] = sprintf( - Tools::displayError('Zip/Postal code is invalid. Must be typed as follows: %s'), - str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $country->zip_code_format))) - ); - } - elseif ($country->zip_code_format) - $this->errors[] = Tools::displayError('Zip/Postal code is required.'); - elseif ($postcode && !preg_match('/^[0-9a-zA-Z -]{4,9}$/ui', $postcode)) - $this->errors[] = Tools::displayError('Zip/Postal code is invalid.'); - } + if (!($country = new Country($address->id_country)) || !Validate::isLoadedObject($country)) + $this->errors[] = Tools::displayError('Country cannot be loaded with address->id_country'); + $postcode = Tools::getValue('postcode'); + /* Check zip code format */ + if ($country->zip_code_format && !$country->checkZipCode($postcode)) + $this->errors[] = sprintf(Tools::displayError('The Zip/Postal code you\'ve entered is invalid. It must follow this format: %s'), str_replace('C', $country->iso_code, str_replace('N', '0', str_replace('L', 'A', $country->zip_code_format)))); + elseif(empty($postcode) && $country->need_zip_code) + $this->errors[] = Tools::displayError('A Zip / Postal code is required.'); + elseif ($postcode && !Validate::isPostCode($postcode)) + $this->errors[] = Tools::displayError('The Zip / Postal code is invalid.'); if ($country->need_identification_number && (!Tools::getValue('dni') || !Validate::isDniLite(Tools::getValue('dni')))) - $this->errors[] = Tools::displayError('Identification number is incorrect or has already been used.'); + $this->errors[] = Tools::displayError('The identification number is incorrect or has already been used.'); elseif (!$country->need_identification_number) $address->dni = null; } @@ -490,24 +516,24 @@ class AuthControllerCore extends FrontController if (!count($this->errors)) { if (Customer::customerExists(Tools::getValue('email'))) - $this->errors[] = Tools::displayError('An account is already registered with this e-mail, please enter your password or request a new one.', false); + $this->errors[] = Tools::displayError('An account using this email address has already been registered. Please enter a valid password or request a new one. ', false); if (Tools::isSubmit('newsletter')) $this->processCustomerNewsletter($customer); $customer->birthday = (empty($_POST['years']) ? '' : (int)$_POST['years'].'-'.(int)$_POST['months'].'-'.(int)$_POST['days']); if (!Validate::isBirthDate($customer->birthday)) - $this->errors[] = Tools::displayError('Invalid birthday.'); + $this->errors[] = Tools::displayError('Invalid date of birth'); if (!count($this->errors)) { // if registration type is in one step, we save the address - if (Configuration::get('PS_REGISTRATION_PROCESS_TYPE')) + if (Tools::isSubmit('submitAccount') || Tools::isSubmit('submitGuestAccount')) if (!($country = new Country($address->id_country, Configuration::get('PS_LANG_DEFAULT'))) || !Validate::isLoadedObject($country)) die(Tools::displayError()); $contains_state = isset($country) && is_object($country) ? (int)$country->contains_states: 0; $id_state = isset($address) && is_object($address) ? (int)$address->id_state: 0; - if (Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && $contains_state && !$id_state) - $this->errors[] = Tools::displayError('This country requires a state selection.'); + if ((Tools::isSubmit('submitAccount')|| Tools::isSubmit('submitGuestAccount')) && $contains_state && !$id_state) + $this->errors[] = Tools::displayError('This country requires you to choose a State.'); else { $customer->active = 1; @@ -533,7 +559,7 @@ class AuthControllerCore extends FrontController // we add the guest customer in the default customer group $customer->addGroups(array((int)Configuration::get('PS_CUSTOMER_GROUP'))); if (!$this->sendConfirmationMail($customer)) - $this->errors[] = Tools::displayError('Cannot send e-mail'); + $this->errors[] = Tools::displayError('The email cannot be sent.'); } else { @@ -571,15 +597,16 @@ class AuthControllerCore extends FrontController // if registration type is in two steps, we redirect to register address if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax && !Tools::isSubmit('submitGuestAccount')) Tools::redirect('index.php?controller=address'); + if ($back = Tools::getValue('back')) - Tools::redirect($back); - Tools::redirect('index.php?controller=my-account'); + Tools::redirect(html_entity_decode($back)); + // redirection: if cart is not empty : redirection to the cart if (count($this->context->cart->getProducts(true)) > 0) Tools::redirect('index.php?controller=order&multi-shipping='.(int)Tools::getValue('multi-shipping')); // else : redirection to the account else - Tools::redirect('index.php?controller=my-account'); + Tools::redirect('index.php?controller='.(($this->authRedirection !== false) ? url_encode($this->authRedirection) : 'my-account')); } } } @@ -614,10 +641,10 @@ class AuthControllerCore extends FrontController protected function processSubmitCreate() { if (!Validate::isEmail($email = Tools::getValue('email_create')) || empty($email)) - $this->errors[] = Tools::displayError('Invalid e-mail address'); + $this->errors[] = Tools::displayError('Invalid email address.'); elseif (Customer::customerExists($email)) { - $this->errors[] = Tools::displayError('An account is already registered with this e-mail, please enter your password or request a new one.', false); + $this->errors[] = Tools::displayError('An account using this email address has already been registered. Please enter a valid password or request a new one. ', false); $_POST['email'] = $_POST['email_create']; unset($_POST['email_create']); } @@ -659,6 +686,9 @@ class AuthControllerCore extends FrontController */ protected function sendConfirmationMail(Customer $customer) { + if (!Configuration::get('PS_CUSTOMER_CREATION_EMAIL')) + return true; + return Mail::Send( $this->context->language->id, 'account', diff --git a/controllers/front/BestSalesController.php b/controllers/front/BestSalesController.php index 170f6c715..f21146e04 100644 --- a/controllers/front/BestSalesController.php +++ b/controllers/front/BestSalesController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -40,7 +40,7 @@ class BestSalesControllerCore extends FrontController 'products' => ProductSale::getBestSales($this->context->language->id, $this->p - 1, $this->n, $this->orderBy, $this->orderWay), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), 'nbProducts' => $nbProducts, - 'homeSize' => Image::getSize('home_default'), + 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'comparator_max_item' => Configuration::get('PS_COMPARATOR_MAX_ITEM') )); diff --git a/controllers/front/CartController.php b/controllers/front/CartController.php index 61ab0a91b..828238c7c 100644 --- a/controllers/front/CartController.php +++ b/controllers/front/CartController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -128,7 +128,7 @@ class CartControllerCore extends FrontController if (!count(Carrier::getAvailableCarrierList(new Product($this->id_product), null, $new_id_address_delivery))) die(Tools::jsonEncode(array( 'hasErrors' => true, - 'error' => Tools::displayError('It\'s not possible to deliver this product to the selected address.', false), + 'error' => Tools::displayError('It is not possible to deliver this product to the selected address.', false), ))); $this->context->cart->setProductAddressDelivery( @@ -177,14 +177,14 @@ class CartControllerCore extends FrontController $mode = (Tools::getIsset('update') && $this->id_product) ? 'update' : 'add'; if ($this->qty == 0) - $this->errors[] = Tools::displayError('Null quantity'); + $this->errors[] = Tools::displayError('Null quantity.'); else if (!$this->id_product) $this->errors[] = Tools::displayError('Product not found'); $product = new Product($this->id_product, true, $this->context->language->id); if (!$product->id || !$product->active) { - $this->errors[] = Tools::displayError('Product is no longer available.', false); + $this->errors[] = Tools::displayError('This product is no longer available.', false); return; } @@ -192,7 +192,7 @@ class CartControllerCore extends FrontController if ($this->id_product_attribute) { if (!Product::isAvailableWhenOutOfStock($product->out_of_stock) && !Attribute::checkAttributeQty($this->id_product_attribute, $this->qty)) - $this->errors[] = Tools::displayError('There is not enough product in stock.'); + $this->errors[] = Tools::displayError('There isn\'t enough product in stock.'); } else if ($product->hasAttributes()) { @@ -202,10 +202,10 @@ class CartControllerCore extends FrontController if (!$this->id_product_attribute) Tools::redirectAdmin($this->context->link->getProductLink($product)); else if (!Product::isAvailableWhenOutOfStock($product->out_of_stock) && !Attribute::checkAttributeQty($this->id_product_attribute, $this->qty)) - $this->errors[] = Tools::displayError('There is not enough product in stock.'); + $this->errors[] = Tools::displayError('There isn\'t enough product in stock.'); } else if (!$product->checkQty($this->qty)) - $this->errors[] = Tools::displayError('There is not enough product in stock.'); + $this->errors[] = Tools::displayError('There isn\'t enough product in stock.'); // If no errors, process product addition if (!$this->errors && $mode == 'add') @@ -213,6 +213,11 @@ class CartControllerCore extends FrontController // Add cart if no cart found if (!$this->context->cart->id) { + if (Context::getContext()->cookie->id_guest) + { + $guest = new Guest(Context::getContext()->cookie->id_guest); + $this->context->cart->mobile_theme = $guest->mobile_theme; + } $this->context->cart->add(); if ($this->context->cart->id) $this->context->cookie->id_cart = (int)$this->context->cart->id; @@ -220,7 +225,7 @@ class CartControllerCore extends FrontController // Check customizable fields if (!$product->hasAllRequiredCustomizableFields() && !$this->customization_id) - $this->errors[] = Tools::displayError('Please fill in all required fields, then save the customization.'); + $this->errors[] = Tools::displayError('Please fill in all of the required fields, and then save your customizations.'); if (!$this->errors) { @@ -257,6 +262,7 @@ class CartControllerCore extends FrontController } $removed = CartRule::autoRemoveFromCart(); + CartRule::autoAddToCart(); if (count($removed) && (int)Tools::getValue('allow_refresh')) $this->ajax_refresh = true; } @@ -310,7 +316,7 @@ class CartControllerCore extends FrontController foreach ($result['summary']['products'] as $key => &$product) { $product['quantity_without_customization'] = $product['quantity']; - if ($result['customizedDatas']) + if ($result['customizedDatas'] && isset($result['customizedDatas'][(int)$product['id_product']][(int)$product['id_product_attribute']])) { foreach ($result['customizedDatas'][(int)$product['id_product']][(int)$product['id_product_attribute']] as $addresses) foreach ($addresses as $customization) @@ -329,7 +335,8 @@ class CartControllerCore extends FrontController if ($result['customizedDatas']) Product::addCustomizationPrice($result['summary']['products'], $result['customizedDatas']); - die(Tools::jsonEncode($result)); + Hook::exec('actionCartListOverride', array('summary' => $result, 'json' => &$json)); + die(Tools::jsonEncode(array_merge($result, (array)Tools::jsonDecode($json, true)))); } // @todo create a hook elseif (file_exists(_PS_MODULE_DIR_.'/blockcart/blockcart-ajax.php')) diff --git a/controllers/front/CategoryController.php b/controllers/front/CategoryController.php index bb498b364..33dfc3bf3 100644 --- a/controllers/front/CategoryController.php +++ b/controllers/front/CategoryController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -28,6 +28,7 @@ class CategoryControllerCore extends FrontController { public $php_self = 'category'; protected $category; + public $customer_access = true; /** * Set default medias for this controller @@ -76,14 +77,30 @@ class CategoryControllerCore extends FrontController $this->category = new Category($id_category, $this->context->language->id); parent::init(); - + //check if the category is active and return 404 error if is disable. + if (!$this->category->active) + { + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + } + //check if category can be accessible by current customer and return 403 if not if (!$this->category->checkAccess($this->context->customer->id)) + { + header('HTTP/1.1 403 Forbidden'); + header('Status: 403 Forbidden'); $this->errors[] = Tools::displayError('You do not have access to this category.'); + $this->customer_access = false; + } } - + public function initContent() { parent::initContent(); + + $this->setTemplate(_PS_THEME_DIR_.'category.tpl'); + + if (!$this->customer_access) + return; if (isset($this->context->cookie->id_compare)) $this->context->smarty->assign('compareProducts', CompareProduct::getCompareProducts((int)$this->context->cookie->id_compare)); @@ -103,17 +120,14 @@ class CategoryControllerCore extends FrontController 'return_category_name' => Tools::safeOutput($this->category->name), 'path' => Tools::getPath($this->category->id), 'add_prod_display' => Configuration::get('PS_ATTRIBUTE_CATEGORY_DISPLAY'), - 'categorySize' => Image::getSize('category_default'), - 'mediumSize' => Image::getSize('medium_default'), - 'thumbSceneSize' => Image::getSize('m_scene_default'), - 'homeSize' => Image::getSize('home_default'), + 'categorySize' => Image::getSize(ImageType::getFormatedName('category')), + 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), + 'thumbSceneSize' => Image::getSize(ImageType::getFormatedName('m_scene')), + 'homeSize' => Image::getSize(ImageType::getFormatedName('home')), 'allow_oosp' => (int)Configuration::get('PS_ORDER_OUT_OF_STOCK'), 'comparator_max_item' => (int)Configuration::get('PS_COMPARATOR_MAX_ITEM'), 'suppliers' => Supplier::getSuppliers() )); - - - $this->setTemplate(_PS_THEME_DIR_.'category.tpl'); } /** @@ -130,9 +144,9 @@ class CategoryControllerCore extends FrontController { foreach ($sceneImageTypes as $sceneImageType) { - if ($sceneImageType['name'] == 'm_scene_default') + if ($sceneImageType['name'] == ImageType::getFormatedName('m_scene')) $thumbSceneImageType = $sceneImageType; - elseif ($sceneImageType['name'] == 'scene_default') + elseif ($sceneImageType['name'] == ImageType::getFormatedName('scene')) $largeSceneImageType = $sceneImageType; } @@ -185,7 +199,7 @@ class CategoryControllerCore extends FrontController foreach ($this->cat_products as &$product) { - if ($product['id_product_attribute']) + if ($product['id_product_attribute'] && isset($product['product_attribute_minimal_quantity'])) $product['minimal_quantity'] = $product['product_attribute_minimal_quantity']; } diff --git a/controllers/front/ChangeCurrencyController.php b/controllers/front/ChangeCurrencyController.php index b2ca943d5..beada9d37 100644 --- a/controllers/front/ChangeCurrencyController.php +++ b/controllers/front/ChangeCurrencyController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/controllers/front/CmsController.php b/controllers/front/CmsController.php index 8a040d93f..75877f647 100644 --- a/controllers/front/CmsController.php +++ b/controllers/front/CmsController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -51,16 +51,28 @@ class CmsControllerCore extends FrontController $this->cms = new CMS($id_cms, $this->context->language->id); else if ($id_cms_category = (int)Tools::getValue('id_cms_category')) $this->cms_category = new CMSCategory($id_cms_category, $this->context->language->id); + $this->canonicalRedirection(); - /* assignCase (1 = CMS page, 2 = CMS category) */ - if (Validate::isLoadedObject($this->cms) - && ($this->cms->isAssociatedToShop() && $this->cms->active || (Tools::getValue('adtoken') == Tools::getAdminToken('AdminCmsContent'.(int)Tab::getIdFromClassName('AdminCmsContent').(int)Tools::getValue('id_employee'))))) - $this->assignCase = 1; + // assignCase (1 = CMS page, 2 = CMS category) + if (Validate::isLoadedObject($this->cms)) + { + $adtoken = Tools::getAdminToken('AdminCmsContent'.(int)Tab::getIdFromClassName('AdminCmsContent').(int)Tools::getValue('id_employee')); + if (!$this->cms->isAssociatedToShop() || !$this->cms->active && Tools::getValue('adtoken') != $adtoken) + { + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + } + else + $this->assignCase = 1; + } else if (Validate::isLoadedObject($this->cms_category)) $this->assignCase = 2; else - Tools::redirect('index.php?controller=404'); + { + header('HTTP/1.1 404 Not Found'); + header('Status: 404 Not Found'); + } } public function setMedia() @@ -87,7 +99,7 @@ class CmsControllerCore extends FrontController $this->context->smarty->assign('cgv_id', Configuration::get('PS_CONDITIONS_CMS_ID')); if (isset($this->cms->id_cms_category) && $this->cms->id_cms_category) $path = Tools::getFullPath($this->cms->id_cms_category, $this->cms->meta_title, 'CMS'); - else + else if (isset($this->cms_category->meta_title)) $path = Tools::getFullPath(1, $this->cms_category->meta_title, 'CMS'); if ($this->assignCase == 1) { @@ -100,6 +112,7 @@ class CmsControllerCore extends FrontController else if ($this->assignCase == 2) { $this->context->smarty->assign(array( + 'category' => $this->cms_category, //for backward compatibility 'cms_category' => $this->cms_category, 'sub_category' => $this->cms_category->getSubCategories($this->context->language->id), 'cms_pages' => CMS::getCMSPages($this->context->language->id, (int)($this->cms_category->id) ), diff --git a/controllers/front/CompareController.php b/controllers/front/CompareController.php index 16aae6a1b..410946a84 100644 --- a/controllers/front/CompareController.php +++ b/controllers/front/CompareController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -31,7 +31,7 @@ class CompareControllerCore extends FrontController public function setMedia() { parent::setMedia(); - $this->addCSS(_THEME_CSS_DIR_.'/comparator.css'); + $this->addCSS(_THEME_CSS_DIR_.'comparator.css'); if (Configuration::get('PS_COMPARATOR_MAX_ITEM') > 0) $this->addJS(_THEME_JS_DIR_.'products-comparison.js'); @@ -55,7 +55,7 @@ class CompareControllerCore extends FrontController } else if (Tools::getValue('action') == 'remove') { - if (isset(self::$cookie->id_compare)) + if (isset($this->context->cookie->id_compare)) CompareProduct::removeCompareProduct((int)$this->context->cookie->id_compare, (int)Tools::getValue('id_product')); else die('0'); @@ -103,23 +103,10 @@ class CompareControllerCore extends FrontController foreach ($ids as $k => &$id) { $curProduct = new Product((int)$id, true, $this->context->language->id); - if (!$curProduct->active || !$curProduct->isAssociatedToShop()) - { - unset($ids[$k]); - continue; - } - - if (!$curProduct->active || !$curProduct->isAssociatedToShop()) - { - unset($ids[$k]); - continue; - } - - if (!Validate::isLoadedObject($curProduct)) - continue; - - if (!$curProduct->active) + if (!Validate::isLoadedObject($curProduct) || !$curProduct->active || !$curProduct->isAssociatedToShop()) { + if (isset($this->context->cookie->id_compare)) + CompareProduct::removeCompareProduct($this->context->cookie->id_compare, $id); unset($ids[$k]); continue; } @@ -145,15 +132,21 @@ class CompareControllerCore extends FrontController 'product_features' => $listFeatures, 'products' => $listProducts, 'width' => $width, - 'homeSize' => Image::getSize('home_default') + 'homeSize' => Image::getSize(ImageType::getFormatedName('home')) )); $this->context->smarty->assign('HOOK_EXTRA_PRODUCT_COMPARISON', Hook::exec('displayProductComparison', array('list_ids_product' => $ids))); } + else if (isset($this->context->cookie->id_compare)) + { + $object = new CompareProduct((int)$this->context->cookie->id_compare); + if (Validate::isLoadedObject($object)) + $object->delete(); + } } } $this->context->smarty->assign('hasProduct', $hasProduct); $this->setTemplate(_PS_THEME_DIR_.'products-comparison.tpl'); } -} - + +} \ No newline at end of file diff --git a/controllers/front/ContactController.php b/controllers/front/ContactController.php index 8746bfe09..01941bf4d 100644 --- a/controllers/front/ContactController.php +++ b/controllers/front/ContactController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -37,27 +37,20 @@ class ContactControllerCore extends FrontController { if (Tools::isSubmit('submitMessage')) { - $fileAttachment = null; - if (isset($_FILES['fileUpload']['name']) && !empty($_FILES['fileUpload']['name']) && !empty($_FILES['fileUpload']['tmp_name'])) - { - $extension = array('.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg'); - $filename = uniqid().substr($_FILES['fileUpload']['name'], -5); - $fileAttachment['content'] = file_get_contents($_FILES['fileUpload']['tmp_name']); - $fileAttachment['name'] = $_FILES['fileUpload']['name']; - $fileAttachment['mime'] = $_FILES['fileUpload']['type']; - } + $extension = array('.txt', '.rtf', '.doc', '.docx', '.pdf', '.zip', '.png', '.jpeg', '.gif', '.jpg'); + $fileAttachment = Tools::fileAttachment('fileUpload'); $message = Tools::getValue('message'); // Html entities is not usefull, iscleanHtml check there is no bad html tags. if (!($from = trim(Tools::getValue('from'))) || !Validate::isEmail($from)) - $this->errors[] = Tools::displayError('Invalid e-mail address'); + $this->errors[] = Tools::displayError('Invalid email address.'); else if (!$message) - $this->errors[] = Tools::displayError('Message cannot be blank'); + $this->errors[] = Tools::displayError('The message cannot be blank.'); else if (!Validate::isCleanHtml($message)) $this->errors[] = Tools::displayError('Invalid message'); else if (!($id_contact = (int)(Tools::getValue('id_contact'))) || !(Validate::isLoadedObject($contact = new Contact($id_contact, $this->context->language->id)))) - $this->errors[] = Tools::displayError('Please select a subject from the list.'); - else if (!empty($_FILES['fileUpload']['name']) && $_FILES['fileUpload']['error'] != 0) - $this->errors[] = Tools::displayError('An error occurred during the file upload'); - else if (!empty($_FILES['fileUpload']['name']) && !in_array(substr($_FILES['fileUpload']['name'], -4), $extension) && !in_array(substr($_FILES['fileUpload']['name'], -5), $extension)) + $this->errors[] = Tools::displayError('Please select a subject from the list provided. '); + else if (!empty($fileAttachment['name']) && $fileAttachment['error'] != 0) + $this->errors[] = Tools::displayError('An error occurred during the file-upload process.'); + else if (!empty($fileAttachment['name']) && !in_array( Tools::strtolower(substr($fileAttachment['name'], -4)), $extension) && !in_array( Tools::strtolower(substr($fileAttachment['name'], -5)), $extension)) $this->errors[] = Tools::displayError('Bad file extension'); else { @@ -114,27 +107,6 @@ class ContactControllerCore extends FrontController $contact->email = ''; $contact->customer_service = 0; } - if (!empty($contact->email)) - { - $id_order = (int)Tools::getValue('id_order', 0); - $order = new Order($id_order); - - $mail_var_list = array( - '{email}' => $from, - '{message}' => Tools::nl2br(stripslashes($message)), - '{id_order}' => $id_order, - '{order_name}' => $order->getUniqReference(), - '{attached_file}' => isset($_FILES['fileUpload'], $_FILES['fileUpload']['name']) ? $_FILES['fileUpload']['name'] : '' - ); - - if (Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form'), - $mail_var_list, $contact->email, $contact->name, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''), - $fileAttachment) && - Mail::Send($this->context->language->id, 'contact_form', Mail::l('Your message has been correctly sent'), $mail_var_list, $from)) - $this->context->smarty->assign('confirmation', 1); - else - $this->errors[] = Tools::displayError('An error occurred while sending message.'); - } if ($contact->customer_service) { @@ -173,38 +145,67 @@ class ContactControllerCore extends FrontController $cm = new CustomerMessage(); $cm->id_customer_thread = $ct->id; $cm->message = Tools::htmlentitiesUTF8($message); - if (isset($filename) && rename($_FILES['fileUpload']['tmp_name'], _PS_MODULE_DIR_.'../upload/'.$filename)) - $cm->file_name = $filename; + if (isset($fileAttachment['rename']) && !empty($fileAttachment['rename']) && rename($fileAttachment['tmp_name'], _PS_MODULE_DIR_.'../upload/'.basename($fileAttachment['rename']))) + $cm->file_name = $fileAttachment['rename']; $cm->ip_address = ip2long($_SERVER['REMOTE_ADDR']); $cm->user_agent = $_SERVER['HTTP_USER_AGENT']; - if ($cm->add()) - { - if (empty($contact->email)) - { - $var_list = array( - '{order_name}' => '-', - '{attached_file}' => '-', - '{message}' => stripslashes($message) - ); - if ($ct->id_order) - { - $order = new Order($ct->id_order); - $var_list['{order_name}'] = $order->reference; - } - if (isset($filename)) - $var_list['{attached_file}'] = $_FILES['fileUpload']['name']; - Mail::Send($this->context->language->id, 'contact_form', Mail::l('Your message has been correctly sent'), $var_list, $from); - } - $this->context->smarty->assign('confirmation', 1); - } - else - $this->errors[] = Tools::displayError('An error occurred while sending message.'); + if (!$cm->add()) + $this->errors[] = Tools::displayError('An error occurred while sending the message.'); } else - $this->errors[] = Tools::displayError('An error occurred while sending message.'); + $this->errors[] = Tools::displayError('An error occurred while sending the message.'); } + + if (!count($this->errors)) + { + $var_list = array( + '{order_name}' => '-', + '{attached_file}' => '-', + '{message}' => Tools::nl2br(stripslashes($message)), + '{email}' => $from, + '{product_name}' => '', + ); + + if (isset($fileAttachment['name'])) + $var_list['{attached_file}'] = $fileAttachment['name']; + + $id_order = (int)Tools::getValue('id_order'); + + $id_product = (int)Tools::getValue('id_product'); + + if (isset($ct) && Validate::isLoadedObject($ct) && $ct->id_order) + $id_order = $ct->id_order; + + if ($id_order) + { + $order = new Order((int)$id_order); + $var_list['{order_name}'] = $order->getUniqReference(); + $var_list['{id_order}'] = $id_order; + } + + if ($id_product) + { + $product = new Product((int)$id_product); + if (Validate::isLoadedObject($product) && isset($product->name[Context::getContext()->language->id])) + $var_list['{product_name}'] = $product->name[Context::getContext()->language->id]; + } + + if (empty($contact->email)) + Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $var_list, $from, null, null, null, $fileAttachment); + else + { + if (!Mail::Send($this->context->language->id, 'contact', Mail::l('Message from contact form').' [no_sync]', + $var_list, $contact->email, $contact->name, $from, ($customer->id ? $customer->firstname.' '.$customer->lastname : ''), + $fileAttachment) || + !Mail::Send($this->context->language->id, 'contact_form', ((isset($ct) && Validate::isLoadedObject($ct)) ? sprintf(Mail::l('Your message has been correctly sent #ct%1$s #tc%2$s'), $ct->id, $ct->token) : Mail::l('Your message has been correctly sent')), $var_list, $from, null, $contact->email, $contact->name, $fileAttachment)) + $this->errors[] = Tools::displayError('An error occurred while sending the message.'); + } + } + if (count($this->errors) > 1) array_unique($this->errors); + else + $this->context->smarty->assign('confirmation', 1); } } } @@ -235,7 +236,7 @@ class ContactControllerCore extends FrontController )); - if ($id_customer_thread = (int)Tools::getValue('id_customer_thread') && $token = Tools::getValue('token')) + if (($id_customer_thread = (int)Tools::getValue('id_customer_thread')) && $token = Tools::getValue('token')) { $customerThread = Db::getInstance()->getRow(' SELECT cm.* @@ -277,12 +278,11 @@ class ContactControllerCore extends FrontController $tmp = $order->getProducts(); foreach ($tmp as $key => $val) $products[$row['id_order']][$val['product_id']] = array('value' => $val['product_id'], 'label' => $val['product_name']); - $orders[] = array('value' => $order->id, 'label' => $order->getUniqReference().' - '.Tools::displayDate($date[0], $this->context->language->id), 'selected' => (int)Tools::getValue('id_order') == $order->id); + $orders[] = array('value' => $order->id, 'label' => $order->getUniqReference().' - '.Tools::displayDate($date[0],null) , 'selected' => (int)Tools::getValue('id_order') == $order->id); } $this->context->smarty->assign('orderList', $orders); $this->context->smarty->assign('orderedProductList', $products); } } -} - +} \ No newline at end of file diff --git a/controllers/front/DiscountController.php b/controllers/front/DiscountController.php index ac41e2cc4..afe4bf328 100644 --- a/controllers/front/DiscountController.php +++ b/controllers/front/DiscountController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -42,7 +42,7 @@ class DiscountControllerCore extends FrontController $cart_rules = CartRule::getCustomerCartRules($this->context->language->id, $this->context->customer->id, true, false); $nb_cart_rules = count($cart_rules); - $this->context->smarty->assign(array('nb_cart_rules' => (int)$nb_cart_rules, 'cart_rules' => $cart_rules)); + $this->context->smarty->assign(array('nb_cart_rules' => (int)$nb_cart_rules, 'cart_rules' => $cart_rules, 'discount' => $cart_rules, 'nbDiscounts' => (int)$nb_cart_rules)); $this->setTemplate(_PS_THEME_DIR_.'discount.tpl'); } } diff --git a/controllers/front/GetFileController.php b/controllers/front/GetFileController.php index ad4f02d9f..f39990b4d 100644 --- a/controllers/front/GetFileController.php +++ b/controllers/front/GetFileController.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -270,12 +270,14 @@ class GetFileControllerCore extends FrontController $mimeType = 'application/octet-stream'; } + if (ob_get_level()) + ob_end_clean(); + /* Set headers for download */ header('Content-Transfer-Encoding: binary'); header('Content-Type: '.$mimeType); header('Content-Length: '.filesize($file)); header('Content-Disposition: attachment; filename="'.$filename.'"'); - ob_end_flush(); $fp = fopen($file, 'rb'); while (!feof($fp)) echo fgets($fp, 16384); @@ -296,8 +298,8 @@ class GetFileControllerCore extends FrontController 'This file no longer exists.' => Tools::displayError('This file no longer exists.'), 'This product has been refunded.' => Tools::displayError('This product has been refunded.'), 'The product deadline is in the past.' => Tools::displayError('The product deadline is in the past.'), - 'Expiration date exceeded' => Tools::displayError('Expiration date has passed, you cannot download this product'), - 'You have reached the maximum number of allowed downloads.' => Tools::displayError('You have reached the maximum number of allowed downloads.')); + 'Expiration date exceeded' => Tools::displayError('The product expiration date has passed, preventing you from download this product.'), + 'You have reached the maximum number of allowed downloads.' => Tools::displayError('You have reached the maximum number of downloads allowed.')); ?> '; + $errors[] = $error; + break; } } return $errors; } + + public function createDatabase($server, $database, $login, $password, $dropit = false) + { + $class = Db::getClass(); + return $class::createDatabase($server, $login, $password, $database, $dropit); + } + + public function getBestEngine($server, $database, $login, $password) + { + $class = Db::getClass(); + $instance = new $class($server, $login, $password, $database, true); + $engine = $instance->getBestEngine(); + unset($instance); + return $engine; + } } diff --git a/install-dev/models/index.php b/install-dev/models/index.php index cadb1ea6e..5ca842ada 100644 --- a/install-dev/models/index.php +++ b/install-dev/models/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/models/install.php b/install-dev/models/install.php index e20ea6e71..f2be6f8ee 100644 --- a/install-dev/models/install.php +++ b/install-dev/models/install.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -176,7 +176,7 @@ class InstallModelInstall extends InstallAbstractModel // Install languages try { - $languages = $this->installLanguages(); + $languages = $this->installLanguages(array($this->language->getLanguageIso())); } catch (PrestashopInstallerException $e) { @@ -197,7 +197,7 @@ class InstallModelInstall extends InstallAbstractModel public function populateDatabase($entity = null) { $languages = array(); - foreach (Language::getLanguages(false) as $lang) + foreach (Language::getLanguages(true) as $lang) $languages[$lang['id_lang']] = $lang['iso_code']; // Install XML data (data/xml/ folder) @@ -293,34 +293,35 @@ class InstallModelInstall extends InstallAbstractModel * * @return array Association between ID and iso array(id_lang => iso, ...) */ - public function installLanguages() + public function installLanguages($languages_list = null) { + if ($languages_list == null || !is_array($languages_list) || !count($languages_list)) + $languages_list = $this->language->getIsoList(); + $languages = array(); - foreach ($this->language->getIsoList() as $iso) + foreach ($languages_list as $iso) { if (!file_exists(_PS_INSTALL_LANGS_PATH_.$iso.'/language.xml')) throw new PrestashopInstallerException($this->language->l('File "language.xml" not found for language iso "%s"', $iso)); if (!$xml = @simplexml_load_file(_PS_INSTALL_LANGS_PATH_.$iso.'/language.xml')) throw new PrestashopInstallerException($this->language->l('File "language.xml" not valid for language iso "%s"', $iso)); + + $params_lang = array('name' => (string)$xml->name, 'iso_code' => substr((string)$xml->language_code, 0, 2)); + + if (InstallSession::getInstance()->safe_mode) + Language::checkAndAddLanguage($iso, false, true, $params_lang); + else + Language::downloadAndInstallLanguagePack($iso, _PS_INSTALL_VERSION_, $params_lang); - // Add language in database - $language = new Language(); - $language->iso_code = $iso; - $language->active = ($iso == $this->language->getLanguageIso()) ? true : false; - $language->name = ($xml->name) ? (string)$xml->name : 'Unknown (Unknown)'; - $language->language_code = ($xml->language_code) ? (string)$xml->language_code : $iso; - $language->date_format_lite = ($xml->date_format_lite) ? (string)$xml->date_format_lite : 'm/j/Y'; - $language->date_format_full = ($xml->date_format_full) ? (string)$xml->date_format_full : 'm/j/Y H:i:s'; - $language->is_rtl = ($xml->is_rtl && ($xml->is_rtl == 'true' || $xml->is_rtl == '1')) ? 1 : 0; - if (!$language->add()) + if (!$id_lang = Language::getIdByIso($iso)) throw new PrestashopInstallerException($this->language->l('Cannot install language "%s"', ($xml->name) ? $xml->name : $iso)); - $languages[$language->id] = $iso; + $languages[$id_lang] = $iso; // Copy language flag if (is_writable(_PS_IMG_DIR_.'l/')) - if (!copy(_PS_INSTALL_LANGS_PATH_.$iso.'/flag.jpg', _PS_IMG_DIR_.'l/'.$language->id.'.jpg')) - throw new PrestashopInstallerException($this->language->l('Cannot copy flag language "%s"', _PS_INSTALL_LANGS_PATH_.$iso.'/flag.jpg => '._PS_IMG_DIR_.'l/'.$language->id.'.jpg')); + if (!copy(_PS_INSTALL_LANGS_PATH_.$iso.'/flag.jpg', _PS_IMG_DIR_.'l/'.$id_lang.'.jpg')) + throw new PrestashopInstallerException($this->language->l('Cannot copy flag language "%s"', _PS_INSTALL_LANGS_PATH_.$iso.'/flag.jpg => '._PS_IMG_DIR_.'l/'.$id_lang.'.jpg')); } return $languages; @@ -391,6 +392,11 @@ class InstallModelInstall extends InstallAbstractModel Context::getContext()->shop = new Shop(1); Configuration::loadConfiguration(); + + // use the old image system if the safe_mod is enabled otherwise the installer will fail with the fixtures installation + if (InstallSession::getInstance()->safe_mode) + Configuration::updateGlobalValue('PS_LEGACY_IMAGES', 1); + $id_country = Country::getByIso($data['shop_country']); // Set default configuration @@ -551,10 +557,8 @@ class InstallModelInstall extends InstallAbstractModel 'graphvisifire', 'graphxmlswfcharts', 'gridhtml', - 'gsitemap', 'homefeatured', 'homeslider', - 'moneybookers', 'pagesnotfound', 'sekeywords', 'statsbestcategories', @@ -578,21 +582,62 @@ class InstallModelInstall extends InstallAbstractModel 'statssearch', 'statsstock', 'statsvisits', - 'themeinstallator', ); } - return $modules; } - + + public function getAddonsModulesList($params = array()) + { + $addons_modules = array(); + $content = Tools::addonsRequest('install-modules', $params); + $xml = @simplexml_load_string($content, null, LIBXML_NOCDATA); + + if ($xml !== false and isset($xml->module)) + foreach ($xml->module as $modaddons) + $addons_modules[] = array('id_module' => $modaddons->id, 'name' => $modaddons->name); + + return $addons_modules; + } + /** * PROCESS : installModules - * Install all modules in ~/modules/ directory + * Download module from addons and Install all modules in ~/modules/ directory + */ + public function installModulesAddons($module = null) + { + $addons_modules = $module ? array($module) : $this->getAddonsModulesList(); + $modules = array(); + if (!InstallSession::getInstance()->safe_mode) + { + foreach($addons_modules as $addons_module) + if (file_put_contents(_PS_MODULE_DIR_.$addons_module['name'].'.zip', Tools::addonsRequest('module', array('id_module' => $addons_module['id_module'])))) + if (Tools::ZipExtract(_PS_MODULE_DIR_.$addons_module['name'].'.zip', _PS_MODULE_DIR_)) + { + $modules[] = (string)$addons_module['name'];//if the module has been unziped we add the name in the modules list to install + unlink(_PS_MODULE_DIR_.$addons_module['name'].'.zip'); + } + } + $errors = array(); + foreach ($modules as $module_name) + $this->installModules($module_name); + + if ($errors) + { + $this->setError($errors); + return false; + } + return true; + } + + /** + * PROCESS : installModules + * Download module from addons and Install all modules in ~/modules/ directory */ public function installModules($module = null) { $modules = $module ? array($module) : $this->getModulesList(); - + $errors = array(); foreach ($modules as $module_name) { @@ -605,7 +650,7 @@ class InstallModelInstall extends InstallAbstractModel } if ($errors) - { + { $this->setError($errors); return false; } diff --git a/install-dev/models/mail.php b/install-dev/models/mail.php index 11177f158..a7c583768 100644 --- a/install-dev/models/mail.php +++ b/install-dev/models/mail.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/models/system.php b/install-dev/models/system.php index 312652ca0..665cb3f2f 100644 --- a/install-dev/models/system.php +++ b/install-dev/models/system.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -39,6 +39,7 @@ class InstallModelSystem extends InstallAbstractModel public function checkTests($list, $type) { $tests = ConfigurationTest::check($list); + $success = true; foreach ($tests as $result) $success &= ($result == 'ok') ? true : false; diff --git a/install-dev/theme/img/help.png b/install-dev/theme/img/help.png new file mode 100644 index 000000000..0bf44fc16 Binary files /dev/null and b/install-dev/theme/img/help.png differ diff --git a/install-dev/theme/img/index.php b/install-dev/theme/img/index.php index ec45b2dfe..f42f03e4d 100644 --- a/install-dev/theme/img/index.php +++ b/install-dev/theme/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/theme/img/print.png b/install-dev/theme/img/print.png new file mode 100644 index 000000000..403eb761d Binary files /dev/null and b/install-dev/theme/img/print.png differ diff --git a/install-dev/theme/index.php b/install-dev/theme/index.php index cadb1ea6e..5ca842ada 100644 --- a/install-dev/theme/index.php +++ b/install-dev/theme/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/theme/js/configure.js b/install-dev/theme/js/configure.js index 0232e2a1e..98a647702 100644 --- a/install-dev/theme/js/configure.js +++ b/install-dev/theme/js/configure.js @@ -14,15 +14,28 @@ $(document).ready(function() data: 'timezoneByIso=true&iso='+iso, dataType: 'json', cache: true, - success: function(json) - { - if (json.success) + success: function(json) { + if (json.success) { $('#infosTimezone').val(json.message).trigger("liszt:updated"); + if (in_array(iso, ['us','ca','ru','me','au','id'])) + $('#timezone_div').show(); + else + $('#timezone_div').hide(); + } } }); }); }); +function in_array(needle, haystack) { + var length = haystack.length; + for (var i = 0; i < length; i++) { + if (haystack[i] == needle) + return true; + } + return false; +} + /** * Upload a new logo */ diff --git a/install-dev/theme/js/database.js b/install-dev/theme/js/database.js index 6e47831bd..f19e8f651 100644 --- a/install-dev/theme/js/database.js +++ b/install-dev/theme/js/database.js @@ -1,89 +1,76 @@ -$(document).ready(function() -{ - // Check database configuration - $('#btTestDB').click(function() - { - $("#dbResultCheck").slideUp('slow'); - $.ajax({ - url: 'index.php', - data: { - 'checkDb': 'true', - 'dbServer': $('#dbServer').val(), - 'dbName': $('#dbName').val(), - 'dbLogin': $('#dbLogin').val(), - 'dbPassword': $('#dbPassword').val(), - 'dbEngine': $('#dbEngine').val(), - 'db_prefix': $('#db_prefix').val(), - 'clear': $('#db_clear').prop('checked') ? '1' : '0' - }, - dataType: 'json', - cache: false, - success: function(json) - { - $("#dbResultCheck") - .addClass((json.success) ? 'okBlock' : 'errorBlock') - .removeClass((json.success) ? 'errorBlock' : 'okBlock') - .html(json.message) - .slideDown('slow'); - }, - error: function(xhr) - { - $("#dbResultCheck") - .addClass('errorBlock') - .removeClass('okBlock') - .html('An error occurred:

        '+xhr.responseText) - .slideDown('slow'); - } - }); - }); - - // Check mails configuration - if (!$('#set_stmp').prop('checked')) - $("div#mailSMTPParam").hide(); - - $("#set_stmp").click(function() - { - if ($("input#set_stmp").prop('checked')) - $("div#mailSMTPParam").slideDown('slow'); - else - $("div#mailSMTPParam").slideUp('slow'); - }); - - // Send test email - $('#btVerifyMail').click(function() - { - $("#mailResultCheck").slideUp('slow'); - $.ajax({ - url: 'index.php', - data: { - 'sendMail': 'true', - 'smtpSrv': $('#smtpSrv').val(), - 'smtpEnc': $('#smtpEnc').val(), - 'smtpPort': $('#smtpPort').val(), - 'smtpLogin': $('#smtpLogin').val(), - 'smtpPassword': $('#smtpPassword').val(), - 'testEmail': $('#smtpSrv').val(), - 'testEmail': $('#testEmail').val(), - 'smtpChecked': ($('#set_stmp').prop('checked') ? 'true' : 'false') - }, - dataType: 'json', - cache: false, - success: function(json) - { - $("#mailResultCheck") - .addClass((json.success) ? 'infosBlock' : 'errorBlock') - .removeClass((json.success) ? 'errorBlock' : 'infosBlock') - .html(json.message) - .slideDown('slow'); - }, - error: function(xhr) - { - $("#mailResultCheck") - .addClass('errorBlock') - .removeClass('infosBlock') - .html('An error occurred:

        '+xhr.responseText) - .slideDown('slow'); - } - }); - }); -}); \ No newline at end of file +$(document).ready(function() +{ + // Check database configuration + $('#btTestDB').click(function() + { + $("#dbResultCheck").slideUp('slow'); + $.ajax({ + url: 'index.php', + data: { + 'checkDb': 'true', + 'dbServer': $('#dbServer').val(), + 'dbName': $('#dbName').val(), + 'dbLogin': $('#dbLogin').val(), + 'dbPassword': $('#dbPassword').val(), + 'dbEngine': $('#dbEngine').val(), + 'db_prefix': $('#db_prefix').val(), + 'clear': $('#db_clear').prop('checked') ? '1' : '0' + }, + dataType: 'json', + cache: false, + success: function(json) + { + $("#dbResultCheck") + .addClass((json.success) ? 'okBlock' : 'errorBlock') + .removeClass((json.success) ? 'errorBlock' : 'okBlock') + .html(json.message) + .slideDown('slow'); + }, + error: function(xhr) + { + $("#dbResultCheck") + .addClass('errorBlock') + .removeClass('okBlock') + .html('An error occurred:

        ' + xhr.responseText) + .slideDown('slow'); + } + }); + }); +}); + +function bindCreateDB() +{ + // Attempt to create the database + $('#btCreateDB').click(function() + { + $("#dbResultCheck").slideUp('fast'); + $.ajax({ + url: 'index.php', + data: { + 'createDb': 'true', + 'dbServer': $('#dbServer').val(), + 'dbName': $('#dbName').val(), + 'dbLogin': $('#dbLogin').val(), + 'dbPassword': $('#dbPassword').val() + }, + dataType: 'json', + cache: false, + success: function(json) + { + $("#dbResultCheck") + .addClass((json.success) ? 'okBlock' : 'errorBlock') + .removeClass((json.success) ? 'errorBlock' : 'okBlock') + .html(json.message) + .slideDown('slow'); + }, + error: function(xhr) + { + $("#dbResultCheck") + .addClass('errorBlock') + .removeClass('okBlock') + .html('An error occurred:

        ' + xhr.responseText) + .slideDown('slow'); + } + }); + }); +} \ No newline at end of file diff --git a/install-dev/theme/js/index.php b/install-dev/theme/js/index.php index 8c890bb60..5e4749107 100644 --- a/install-dev/theme/js/index.php +++ b/install-dev/theme/js/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/theme/js/install.js b/install-dev/theme/js/install.js index a73c11c7d..e5d753eb2 100644 --- a/install-dev/theme/js/install.js +++ b/install-dev/theme/js/install.js @@ -19,4 +19,20 @@ $(document).ready(function() }); $('select.chosen').chosen(); + + // try to pre-compile the smarty templates + function compile_smarty_templates(bo) + { + $.ajax( + { + url: 'index.php', + data: { + 'compile_templates': 1, + 'bo':bo + }, + global: false + }); + } + compile_smarty_templates(1); + compile_smarty_templates(0); }); diff --git a/install-dev/theme/js/jquery.chosen/index.php b/install-dev/theme/js/jquery.chosen/index.php index 4a1165be5..10edbfe91 100644 --- a/install-dev/theme/js/jquery.chosen/index.php +++ b/install-dev/theme/js/jquery.chosen/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/theme/js/license.js b/install-dev/theme/js/license.js new file mode 100644 index 000000000..74371fa93 --- /dev/null +++ b/install-dev/theme/js/license.js @@ -0,0 +1,22 @@ +$(document).ready(function() +{ + // Desactivate next button if licence checkbox is not checked + if (!$('#set_license').prop('checked')) + { + $('#btNext').addClass('disabled').attr('disabled', true); + } + + // Activate / desactivate next button when licence checkbox is clicked + $('#set_license').click(function() + { + if ($(this).prop('checked')) + $('#btNext').removeClass('disabled').attr('disabled', false); + else + $('#btNext').addClass('disabled').attr('disabled', true); + }); + + if ($('#set_license').prop('checked')) + $('#btNext').removeClass('disabled').attr('disabled', false); + else + $('#btNext').addClass('disabled').attr('disabled', true); +}); \ No newline at end of file diff --git a/install-dev/theme/js/process.js b/install-dev/theme/js/process.js index d468b9a29..20246ebcf 100644 --- a/install-dev/theme/js/process.js +++ b/install-dev/theme/js/process.js @@ -19,7 +19,10 @@ function start_install() $('#progress_bar .installing').show(); $('.stepList li:last-child').removeClass('ok').removeClass('ko'); process_pixel = parseInt($('#progress_bar .total').css('width')) / process_steps.length; - + $('#tabs li a').each(function() { + this.rel = $(this).attr('href'); + this.href = '#'; + }); process_install(); } @@ -28,11 +31,11 @@ function process_install(step) if (!step) step = process_steps[0]; - $('.installing').hide().html(step.lang+' ...').fadeIn('slow'); + $('.installing').hide().html(step.lang + ' ...').fadeIn('slow'); $.ajax({ url: 'index.php', - data: step.key+'=true', + data: step.key + '=true', dataType: 'json', cache: false, success: function(json) @@ -48,10 +51,7 @@ function process_install(step) $('#progress_bar .total span').html('100%'); // Installation finished - setTimeout(function() - { - install_success(); - }, 700) + setTimeout(function(){install_success();}, 700); } else { @@ -156,11 +156,19 @@ function install_error(step, errors) var display = '
          '; $.each(list_errors, function(k, v) { + if (typeof psuser_assistance != 'undefined') + psuser_assistance.setStep('install_process_error', {'error':v}); display += '
        1. '+v+'
        2. '; }); display += '
        '; $('#process_step_'+step.key+' .error_log').html(display).show(); } + if (typeof psuser_assistance != 'undefined') + psuser_assistance.setStep('install_process_error'); + + $('#tabs li a').each(function() { + this.href=this.rel; + }); } function install_success() @@ -171,4 +179,10 @@ function install_success() $('#install_process_form').slideUp(); $('#install_process_success').slideDown(); $('.stepList li:last-child').addClass('ok'); + if (typeof psuser_assistance != 'undefined') + psuser_assistance.setStep('install_process_success'); + + $('#tabs li a').each(function() { + this.href=this.rel; + }); } \ No newline at end of file diff --git a/install-dev/theme/js/welcome.js b/install-dev/theme/js/welcome.js index fa2a9c467..b9a987c49 100644 --- a/install-dev/theme/js/welcome.js +++ b/install-dev/theme/js/welcome.js @@ -7,19 +7,4 @@ $(document).ready(function() form.attr('action', form.attr('action')+'#licenses-agreement'); form.submit(); }); - - // Desactivate next button if licence checkbox is not checked - if (!$('#set_license').prop('checked')) - { - $('#btNext').addClass('disabled').attr('disabled', true); - } - - // Activate / desactivate next button when licence checkbox is clicked - $('#set_license').click(function() - { - if ($(this).prop('checked')) - $('#btNext').removeClass('disabled').attr('disabled', false); - else - $('#btNext').addClass('disabled').attr('disabled', true); - }); }); \ No newline at end of file diff --git a/install-dev/theme/view.css b/install-dev/theme/view.css index 6d74c9725..e9c96d71f 100644 --- a/install-dev/theme/view.css +++ b/install-dev/theme/view.css @@ -43,12 +43,11 @@ a {cursor:pointer;} width:990px; background :#fff; } - #header { - padding:6px 16px 16px 16px; - height:68px;/* 90 */ - background:#394049; - } - +#header { + padding:6px 16px 16px 16px; + height:50px; + background:#394049; +} #loaderSpace{ display:none; z-index: 100; @@ -77,7 +76,7 @@ div#leftpannel{ div#sheets { float:left; margin-top:65px; - min-height:400px; + min-height:360px; width:700px; background-color:#fff; } @@ -93,7 +92,7 @@ div#leftpannel{ div#buttons{ clear:both; margin:0 0 0 295px; - height:70px; + height:60px; width:650px; } * html div#buttons { @@ -110,6 +109,8 @@ ul#footer{ color:#fff; } +div#phone_help{margin:auto;text-align:center;padding:10px 5px} + /* **************************************************************************** generics styles @@ -226,6 +227,7 @@ div.field { font-family:Georgia; font-style:italic; color:#999; + float: right; } #uploadedImage {border:1px solid #ccc;} @@ -240,6 +242,8 @@ div.field { padding:20px 20px 20px 38px; background:#ffebe8 url(img/pict_error.png) no-repeat 15px 21px; border:1px solid #cc0000; + clear: both; + display: block; } .errorTxt { @@ -252,12 +256,16 @@ div.field { } .infosBlock { - padding:14px 25px 14px 35px; + padding:14px 25px 14px 20px; font-weight:normal; font-size:13px; line-height:18px; - background:#f8f8f8 url(img/pict_h3_infos.png) no-repeat 10px 13px; - border:1px solid #ccc; + background:#f8f8f8; + border:1px solid #ccc +} + +.infosBlock img { + vertical-align:middle } .warnBlock { @@ -398,7 +406,7 @@ ul#footer a:link, ul#footer a:active, ul#footer a:visited { } .sheet .contentTitle { position:absolute; - top:90px; + top:72px; left:0; padding:15px 25px 10px 38px; height:28px;/* 53 */ @@ -472,7 +480,8 @@ ul#optional { } ul#required li.ok, ul#optional li.ok{ - background:#f8f8f8 url(img/pict_ok.png) no-repeat 99% 10px + display:none + /*background:#f8f8f8 url(img/pict_ok.png) no-repeat 99% 10px*/ } ul#required li.fail, ul#optional li.fail { @@ -571,11 +580,13 @@ ul#optional { #resultInstall tr.odd {background:#f8f8f8;} #resultInstall td.resultEnd {color:#666;} +.print{background:white;color:#78A542;cursor:pointer;font-weight:700} + .blockInfoEnd { float:left; margin:34px 20px 22px 0; padding:10px; - width:292px;/* 312 */ + width:292px; background:#fff url(img/bg_blockInfoEnd.png) repeat-x 0 0; border:1px solid #ccc; -moz-border-radius: 5px; @@ -619,8 +630,8 @@ ul#optional { #prestastore, #prestastore_update { - height:210px; - width:645px; + height:592px; + width:650px; border:none; /*-moz-border-radius: 5px; -webkit-border-radius:5px; diff --git a/install-dev/theme/views/configure.phtml b/install-dev/theme/views/configure.phtml index b1ea0f0a7..5b1c7b98a 100644 --- a/install-dev/theme/views/configure.phtml +++ b/install-dev/theme/views/configure.phtml @@ -8,7 +8,7 @@ var default_iso = 'session->shop_country ?>';
        -

        l('Shop settings and merchant account information') ?>

        +

        l('Information about your Store') ?>

        @@ -26,33 +26,37 @@ var default_iso = 'session->shop_country ?>';
        -

        l('This information is not required, it will only be used for statistical purposes. This information does not change anything in your store.') ?>

        +

        l('Help us learn more about your store so we can offer you optimal guidance and the best features for your business!') ?>

        +

        l('Demo products are a good way to learn how to use PrestaShop. You should install them if you are not familiar with it.') ?>

        + + +
        - +
        @@ -80,19 +84,22 @@ var default_iso = 'session->shop_country ?>'; displayError('shop_timezone') ?>
        - + + +

        l('Your Account') ?>

        @@ -121,6 +128,7 @@ var default_iso = 'session->shop_country ?>'; *
        +

        l('This email address will be your username to access your store\'s back office.') ?>

        displayError('admin_email') ?>
        @@ -134,7 +142,7 @@ var default_iso = 'session->shop_country ?>'; displayError('admin_password')): ?> displayError('admin_password') ?> -

        l('Must be alphanumeric string with at least 8 characters') ?>

        +

        l('Must be letters and numbers with at least 8 characters') ?>

        @@ -148,19 +156,19 @@ var default_iso = 'session->shop_country ?>'; displayError('admin_password_confirm') ?> - +
        - session->send_informations): ?>checked="checked" /> - + session->send_informations === null || $this->session->send_informations): ?>checked="checked" /> +
        -

        l('Warning: You will receive this information only if your e-mail configuration is correct.') ?>

        +

        l('PrestaShop can provide you with guidance on a regular basis by sending you tips on how to optimize the management of your store which will help you grow your business. If you do not wish to receive these tips, please uncheck this box.') ?>

        - + displayTemplate('footer') ?> diff --git a/install-dev/theme/views/database.phtml b/install-dev/theme/views/database.phtml index 67c6435e7..a24c92878 100644 --- a/install-dev/theme/views/database.phtml +++ b/install-dev/theme/views/database.phtml @@ -4,14 +4,16 @@

        l('Configure your database by filling out the following fields:') ?>

        - l('You have to create a database, help available in our online documentation.') ?> + l('To use PrestaShop, you must create a database to collect all of your store’s data-related activities.') ?> +
        + l('Please complete the fields below in order for PrestaShop to connect to your database. ') ?>

        - l('If you want to use a different port, add :XX after your server address where XX is your port number.') ?> + l('The default port is 3306. To use a different port, add the port number at the end of your server’s address i.e ":4242".') ?>

        @@ -25,13 +27,14 @@

        +

        @@ -43,7 +46,7 @@

        - +

        errors): ?> @@ -55,6 +58,7 @@
        + displayTemplate('footer') ?> \ No newline at end of file diff --git a/install-dev/theme/views/footer.phtml b/install-dev/theme/views/footer.phtml index 1ede4d068..95b11994d 100644 --- a/install-dev/theme/views/footer.phtml +++ b/install-dev/theme/views/footer.phtml @@ -15,7 +15,9 @@
        - +
        + l('If you need some assistance during the installation process, please call our team at %s and one of our experts will be happy to help.', $this->getPhone()) ?> +
        + \ No newline at end of file diff --git a/install-dev/theme/views/header.phtml b/install-dev/theme/views/header.phtml index 3d8aa5896..7246ab258 100644 --- a/install-dev/theme/views/header.phtml +++ b/install-dev/theme/views/header.phtml @@ -1,7 +1,7 @@ - <?php echo $this->l('PrestaShop Wizard Installer') ?> + <?php echo $this->l('PrestaShop Installation Assistant') ?> @@ -17,6 +17,7 @@ + step.'.js')): ?> @@ -38,11 +39,13 @@
      • l('Support') ?>
      • l('Documentation') ?>
      • l('Blog') ?>
      • + @@ -68,6 +71,12 @@ + + + @@ -75,12 +84,18 @@
        -

        l('menu_'.$this->step) ?>

        - +

        l('Installation Assistant') ?>

          getSteps() as $step): ?>
        • isStepFinished($step)): ?>class="ok">l('menu_'.$this->step) ?>
        - + \ No newline at end of file diff --git a/install-dev/theme/views/index.php b/install-dev/theme/views/index.php index 8c890bb60..5e4749107 100644 --- a/install-dev/theme/views/index.php +++ b/install-dev/theme/views/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/theme/views/license.phtml b/install-dev/theme/views/license.phtml new file mode 100644 index 000000000..e71c76635 --- /dev/null +++ b/install-dev/theme/views/license.phtml @@ -0,0 +1,20 @@ +displayTemplate('header') ?> + + +

        l('License Agreements') ?>

        +

        l('To enjoy the many features that are offered for free by PrestaShop, please read the license terms below. PrestaShop core is licensed under OSL 3.0, while the modules and themes are licensed under AFL 3.0.') ?>

        +
        +displayTemplate('license_content'); ?> +
        + +
        + session->licence_agrement): ?>checked="checked" /> +
        + +
        + +displayTemplate('footer') ?> \ No newline at end of file diff --git a/install-dev/theme/views/license_content.phtml b/install-dev/theme/views/license_content.phtml new file mode 100644 index 000000000..0ca4d805e --- /dev/null +++ b/install-dev/theme/views/license_content.phtml @@ -0,0 +1,53 @@ +

        Core: Open Software License ("OSL") v. 3.0

        +

        This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:

        +

        Licensed under the Open Software License version 3.0

        +

        1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:

        +
          +
        1. to reproduce the Original Work in copies, either alone or as part of a collective work
        2. +
        3. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work
        4. +
        5. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License
        6. +
        7. to perform the Original Work publicly
        8. +
        9. to display the Original Work publicly
        10. +
        +

        2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.

        +

        3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.

        +

        4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.

        +

        5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).

        +

        6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.

        +

        7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.

        +

        8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.

        +

        9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).

        +

        10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.

        +

        11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.

        +

        12. Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.

        +

        13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.

        +

        14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

        +

        15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.

        +

        16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under Open Software License ("OSL") v. 3.0" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.

        + +

        Modules and Themes: Academic Free License ("AFL") v. 3.0

        +

        This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:

        +

        Licensed under the Academic Free License version 3.0

        +

        1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:

        +
          +
        1. to reproduce the Original Work in copies, either alone or as part of a collective work;
        2. +
        3. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
        4. +
        5. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License;
        6. +
        7. to perform the Original Work publicly; and
        8. +
        9. to display the Original Work publicly.
        10. +
        +

        2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.

        +

        3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.

        +

        4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.

        +

        5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).

        +

        6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.

        +

        7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.

        +

        8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.

        +

        9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).

        +

        10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.

        +

        11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.

        +

        12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.

        +

        13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.

        +

        14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

        +

        15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.

        +

        16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.

        \ No newline at end of file diff --git a/install-dev/theme/views/process.phtml b/install-dev/theme/views/process.phtml index 0887f91be..0beac6c6a 100644 --- a/install-dev/theme/views/process.phtml +++ b/install-dev/theme/views/process.phtml @@ -41,19 +41,26 @@ var process_steps = process_steps) ?>;
        +
        {l s='No modules available in this section.'}
        '.$this->l('Module').' '.$module->name.' '.$this->l('Back').' '.$this->l('Manage hooks').''.$this->l('Manage translations:').' '; + '.$this->l('Manage translations').' '; foreach (Language::getLanguages(false) as $language) $toolbar .= ''.$language['iso_code'].''; $toolbar .= '
        '.$this->l('No specific prices').''.$this->l('No specific prices.').'
        '.($id_shop_sp ? $shops[$id_shop_sp]['name'] : $this->l('All shops')).''.($specific_price['id_currency'] ? $currencies[$specific_price['id_currency']]['name'] : $this->l('All currencies')).' '.($specific_price['id_country'] ? $countries[$specific_price['id_country']]['name'] : $this->l('All countries')).'
        l('E-mail:') ?> session->admin_email) ?> + + l('Print my login information') ?> +
        l('Password:') ?> session->admin_password) ?> - (l('Display') ?>) + (l('Display') ?>)
        -

        l('WARNING: For security purposes, you must delete the "install" folder.') ?>

        +

        + l('For security purposes, you must delete the "install" folder.') ?> + +

        @@ -71,9 +78,9 @@ var process_steps = process_steps) ?>;
        - -displayTemplate('footer') ?> \ No newline at end of file +displayTemplate('footer') ?> diff --git a/install-dev/theme/views/system.phtml b/install-dev/theme/views/system.phtml index 2c8679930..5135a2247 100644 --- a/install-dev/theme/views/system.phtml +++ b/install-dev/theme/views/system.phtml @@ -1,24 +1,19 @@ displayTemplate('header') ?> -

        l('Required set-up. Please verify the following checklist items are true.') ?>

        +

        l('We are currently checking PrestaShop compatibility with your system environment') ?>

        l('If you have any questions, please visit our documentation and community forum.', $this->getDocumentationLink(), $this->getForumLink()); ?>

        +tests['required']['success']): ?> +

        l('PrestaShop compatibility with your system environment has been verified!') ?>

        + +

        l('Oops! Please correct the item(s) below, and then click "Refresh information" to test the compatibility of your new system.') ?>

        + tests_render as $type => $categories): ?> - - tests['required']['success']): ?> -

        l('Your configuration is valid, click next to continue!') ?>

        - -

        l('Your configuration is invalid. Please fix the issues below:') ?>

        - - -

        l('Optional set-up') ?>

        - -
          -
        • +
        • $lang): ?>
        • diff --git a/install-dev/theme/views/welcome.phtml b/install-dev/theme/views/welcome.phtml index 47c560a5d..6742117cc 100644 --- a/install-dev/theme/views/welcome.phtml +++ b/install-dev/theme/views/welcome.phtml @@ -14,12 +14,12 @@

          l('Welcome to the PrestaShop %s Installer.', _PS_INSTALL_VERSION_) ?>

          -

          l('The installation process should take only few minutes!') ?>

          +

          l('The installation of PrestaShop is quick and easy. In just a few moments, you will become part of a community consisting of more than 130,000 merchants. You are on the way to creating your own unique online store that you can manage easily every day.') ?>

          l('If you need help, do not hesitate to check our documentation or to contact our support team: %2$s', $this->getDocumentationLink(), $this->getPhone()) ?>

          language->getIsoList()) > 1): ?> -

          l('Choose the installer language:') ?>

          +

          l('Continue the installation in:') ?>

            language->getIsoList() as $iso): ?>
          • @@ -37,79 +37,6 @@
          - -

          l('Did you know?'); ?>

          -

          l('PrestaShop and its community offers over 40 different languages for free, directly accessible from your Back Office on the Localization tab.'); ?>

          - - -

          l('Licenses Agreement') ?>

          -
          -

          l('PrestaShop core is released under the OSL 3.0 while PrestaShop modules and themes are released under the AFL 3.0.') ?>

          -

          Core: Open Software License ("OSL") v. 3.0

          -

          This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:

          -

          Licensed under the Open Software License version 3.0

          -

          1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:

          -
            -
          1. to reproduce the Original Work in copies, either alone or as part of a collective work
          2. -
          3. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work
          4. -
          5. to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License
          6. -
          7. to perform the Original Work publicly
          8. -
          9. to display the Original Work publicly
          10. -
          -

          2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.

          -

          3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.

          -

          4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.

          -

          5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).

          -

          6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.

          -

          7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.

          -

          8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.

          -

          9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including 'fair use' or 'fair dealing'). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).

          -

          10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.

          -

          11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.

          -

          12. Attorneys Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.

          -

          13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.

          -

          14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

          -

          15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.

          -

          16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under Open Software License ("OSL") v. 3.0" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.

          - -

          Modules and Themes: Academic Free License ("AFL") v. 3.0

          -

          This Academic Free License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work:

          -

          Licensed under the Academic Free License version 3.0

          -

          1. Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following:

          -
            -
          1. to reproduce the Original Work in copies, either alone or as part of a collective work;
          2. -
          3. to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work;
          4. -
          5. to distribute or communicate copies of the Original Work and Derivative Works to the public, under any license of your choice that does not contradict the terms and conditions, including Licensor's reserved rights and remedies, in this Academic Free License;
          6. -
          7. to perform the Original Work publicly; and
          8. -
          9. to display the Original Work publicly.
          10. -
          -

          2. Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works.

          -

          3. Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work.

          -

          4. Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license.

          -

          5. External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c).

          -

          6. Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work.

          -

          7. Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer.

          -

          8. Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation.

          -

          9. Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c).

          -

          10. Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware.

          -

          11. Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License.

          -

          12. Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License.

          -

          13. Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable.

          -

          14. Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

          -

          15. Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You.

          -

          16. Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Academic Free License" or "AFL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under <insert your license name here>" or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process.

          -
          - -

          - -
          - -

          +

          l('The language selection above only applies to the Installation Assistant. Once your store is installed, you can choose the language of your store from over %d translations, all for free!', 55); ?>

          displayTemplate('footer') ?> \ No newline at end of file diff --git a/install-dev/upgrade/classes/AbstractLogger.php b/install-dev/upgrade/classes/AbstractLogger.php index c040dfbd0..e3f8e6593 100644 --- a/install-dev/upgrade/classes/AbstractLogger.php +++ b/install-dev/upgrade/classes/AbstractLogger.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/classes/AddConfToFile.php b/install-dev/upgrade/classes/AddConfToFile.php index d8ace06ca..4b1459be8 100644 --- a/install-dev/upgrade/classes/AddConfToFile.php +++ b/install-dev/upgrade/classes/AddConfToFile.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/classes/FileLogger.php b/install-dev/upgrade/classes/FileLogger.php index af8e1d37c..a9dee40dd 100644 --- a/install-dev/upgrade/classes/FileLogger.php +++ b/install-dev/upgrade/classes/FileLogger.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ + class FileLoggerCore extends AbstractLogger { protected $filename = ''; diff --git a/install-dev/upgrade/classes/ToolsInstall.php b/install-dev/upgrade/classes/ToolsInstall.php index 32692589e..6f5a0b665 100644 --- a/install-dev/upgrade/classes/ToolsInstall.php +++ b/install-dev/upgrade/classes/ToolsInstall.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @copyright 2007-2013 PrestaShop SA * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) * International Registered Trademark & Property of PrestaShop SA */ - - class ToolsInstall { /** diff --git a/install-dev/upgrade/classes/index.php b/install-dev/upgrade/classes/index.php index 8c890bb60..5e4749107 100644 --- a/install-dev/upgrade/classes/index.php +++ b/install-dev/upgrade/classes/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/index.php b/install-dev/upgrade/index.php index cadb1ea6e..f736e1f3f 100644 --- a/install-dev/upgrade/index.php +++ b/install-dev/upgrade/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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: ../../'); + +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; \ No newline at end of file diff --git a/install-dev/upgrade/php/add_accounting_tab.php b/install-dev/upgrade/php/add_accounting_tab.php index 31ff6ef63..bd7bf0725 100644 --- a/install-dev/upgrade/php/add_accounting_tab.php +++ b/install-dev/upgrade/php/add_accounting_tab.php @@ -1,7 +1,32 @@ +* @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 +*/ function add_accounting_tab() { + include_once(_PS_INSTALL_PATH_.'upgrade/php/add_new_tab.php'); $id_parent = add_new_tab( 'AdminAccounting', 'en:Accounting|fr:Comptabilité|es:Accounting|de:Accounting|it:Accounting', diff --git a/install-dev/upgrade/php/add_attribute_position.php b/install-dev/upgrade/php/add_attribute_position.php index 7e55f595e..6b6d4d7a7 100755 --- a/install-dev/upgrade/php/add_attribute_position.php +++ b/install-dev/upgrade/php/add_attribute_position.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_carrier_position.php b/install-dev/upgrade/php/add_carrier_position.php index e8a738c80..e17f11a32 100755 --- a/install-dev/upgrade/php/add_carrier_position.php +++ b/install-dev/upgrade/php/add_carrier_position.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_column_order_state_deleted_if_not_exists.php b/install-dev/upgrade/php/add_column_order_state_deleted_if_not_exists.php index 61c05dbe3..d084e2737 100644 --- a/install-dev/upgrade/php/add_column_order_state_deleted_if_not_exists.php +++ b/install-dev/upgrade/php/add_column_order_state_deleted_if_not_exists.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_column_orders_reference_if_not_exists.php b/install-dev/upgrade/php/add_column_orders_reference_if_not_exists.php index db50eff8a..3a5676e63 100644 --- a/install-dev/upgrade/php/add_column_orders_reference_if_not_exists.php +++ b/install-dev/upgrade/php/add_column_orders_reference_if_not_exists.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -28,5 +28,5 @@ function add_column_orders_reference_if_not_exists() { $column = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'orders` LIKE "reference"'); if (empty($column)) - return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'orders` ADD COLUMN `reference` varchar(9) AFTER `id_order`'); + return Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'orders` ADD COLUMN `reference` varchar(10) AFTER `id_order`'); } diff --git a/install-dev/upgrade/php/add_default_restrictions_modules_groups.php b/install-dev/upgrade/php/add_default_restrictions_modules_groups.php index bcde7785a..dd009061c 100644 --- a/install-dev/upgrade/php/add_default_restrictions_modules_groups.php +++ b/install-dev/upgrade/php/add_default_restrictions_modules_groups.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -41,7 +41,7 @@ function add_default_restrictions_modules_groups() FROM `'._DB_PREFIX_.'shop`'); foreach ($groups as $group) { - if (!is_array($modules)) + if (!is_array($modules) || !is_array($shops)) return false; else { @@ -49,10 +49,10 @@ function add_default_restrictions_modules_groups() foreach ($modules as $mod) foreach ($shops as $s) $sql .= '("'.(int)$mod['id_module'].'", "'.(int)$s.'", "'.(int)$group['id_group'].'"),'; - // removing last comma to avoid SQL error - $sql = substr($sql, 0, strlen($sql) - 1); - $res &= Db::getInstance()->execute($sql); + // removing last comma to avoid SQL error + $sql = substr($sql, 0, strlen($sql) - 1); + $res &= Db::getInstance()->execute($sql); } } return $res; -} +} \ No newline at end of file diff --git a/install-dev/upgrade/php/add_feature_position.php b/install-dev/upgrade/php/add_feature_position.php index d85d547b8..8c558bcfc 100644 --- a/install-dev/upgrade/php/add_feature_position.php +++ b/install-dev/upgrade/php/add_feature_position.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_group_attribute_position.php b/install-dev/upgrade/php/add_group_attribute_position.php index fc36cf6b7..4df83d3a0 100644 --- a/install-dev/upgrade/php/add_group_attribute_position.php +++ b/install-dev/upgrade/php/add_group_attribute_position.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_id_shop_to_shipper_lang_index.php b/install-dev/upgrade/php/add_id_shop_to_shipper_lang_index.php index f513b6c15..ec2f44b19 100644 --- a/install-dev/upgrade/php/add_id_shop_to_shipper_lang_index.php +++ b/install-dev/upgrade/php/add_id_shop_to_shipper_lang_index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_missing_columns_customer.php b/install-dev/upgrade/php/add_missing_columns_customer.php index 16cef6049..6a78013c7 100644 --- a/install-dev/upgrade/php/add_missing_columns_customer.php +++ b/install-dev/upgrade/php/add_missing_columns_customer.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_missing_image_key.php b/install-dev/upgrade/php/add_missing_image_key.php index 94c88138a..dcf4c8041 100644 --- a/install-dev/upgrade/php/add_missing_image_key.php +++ b/install-dev/upgrade/php/add_missing_image_key.php @@ -1,4 +1,28 @@ +* @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 +*/ function add_missing_image_key() { diff --git a/install-dev/upgrade/php/add_missing_rewrite_value.php b/install-dev/upgrade/php/add_missing_rewrite_value.php index badf00be6..85993b2de 100644 --- a/install-dev/upgrade/php/add_missing_rewrite_value.php +++ b/install-dev/upgrade/php/add_missing_rewrite_value.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_missing_shop_column_pagenotfound.php b/install-dev/upgrade/php/add_missing_shop_column_pagenotfound.php index 20a00d376..36ceef67b 100644 --- a/install-dev/upgrade/php/add_missing_shop_column_pagenotfound.php +++ b/install-dev/upgrade/php/add_missing_shop_column_pagenotfound.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_module_to_hook.php b/install-dev/upgrade/php/add_module_to_hook.php index f6dda587f..c44e4eabd 100644 --- a/install-dev/upgrade/php/add_module_to_hook.php +++ b/install-dev/upgrade/php/add_module_to_hook.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_new_groups.php b/install-dev/upgrade/php/add_new_groups.php index 34ca6be7d..8d53c73a7 100644 --- a/install-dev/upgrade/php/add_new_groups.php +++ b/install-dev/upgrade/php/add_new_groups.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_new_tab.php b/install-dev/upgrade/php/add_new_tab.php index 9276e2eb1..602b2477a 100644 --- a/install-dev/upgrade/php/add_new_tab.php +++ b/install-dev/upgrade/php/add_new_tab.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ -function add_new_tab($className, $name, $id_parent, $returnId = false) +function add_new_tab($className, $name, $id_parent, $returnId = false, $parentTab = null) { + if (!is_null($parentTab) && !empty($parentTab)) + $id_parent = (int)Db::getInstance()->getValue('SELECT `id_tab` FROM `'._DB_PREFIX_.'tab` WHERE `class_name` = \''.pSQL($parentTab).'\''); + $array = array(); foreach (explode('|', $name) AS $item) { diff --git a/install-dev/upgrade/php/add_order_reference_in_order_payment.php b/install-dev/upgrade/php/add_order_reference_in_order_payment.php index 7319dc017..266de44d4 100644 --- a/install-dev/upgrade/php/add_order_reference_in_order_payment.php +++ b/install-dev/upgrade/php/add_order_reference_in_order_payment.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -27,47 +27,49 @@ function add_order_reference_in_order_payment() { $res = true; - $payments = Db::getInstance()->executeS(' + $payments = Db::getInstance()->query(' SELECT op.id_order_payment, o.reference FROM `'._DB_PREFIX_.'order_payment` op INNER JOIN `'._DB_PREFIX_.'orders` o ON o.id_order = op.id_order'); - if (!is_array($payments)) - return false; + if (!is_object($payments)) + return true; $errors = array(); - - // Populate "order_reference" - foreach ($payments as $payment) + while ($payment = Db::getInstance()->nextRow($payments)) { - $res = Db::getInstance()->execute(' - UPDATE `'._DB_PREFIX_.'order_payment` - SET order_reference = \''.$payment['reference'].'\' - WHERE id_order_payment = '.(int)$payment['id_order_payment']); - - if (!$res) - $errors[] = Db::getInstance()->getMsgError(); + if(isset($payment['id_order_payment'])) + { + $res = Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'order_payment` + SET order_reference = \''.$payment['reference'].'\' + WHERE id_order_payment = '.(int)$payment['id_order_payment']); + if (!$res) + $errors[] = Db::getInstance()->getMsgError(); + } } if (count($errors)) return array('error' => true, 'msg' => implode('
          ', $errors)); // Get lines to merge (with multishipping on, durring the payment one line was added by order, only one is necessary by cart) - $duplicate_lines = Db::getInstance()->executeS(' + $duplicate_lines = Db::getInstance()->query(' SELECT GROUP_CONCAT(id_order_payment) as id_order_payments FROM `'._DB_PREFIX_.'order_payment` GROUP BY order_reference, date_add HAVING COUNT(*) > 1'); - if (!is_array($duplicate_lines)) - return false; + if (!is_object($duplicate_lines)) + return true; $order_payments_to_remove = array(); - foreach ($duplicate_lines as $order_payments) + while ($order_payments = Db::getInstance()->nextRow($duplicate_lines)) { - $order_payments_array = explode(',', $order_payments['id_order_payments']); + $order_payments_array = array(); + if(isset($order_payments['id_order_payments'])) + $order_payments_array = explode(',', $order_payments['id_order_payments']); // Remove the first item (we want to keep one line) $id_order_payment_keep = array_shift($order_payments_array); @@ -84,6 +86,5 @@ function add_order_reference_in_order_payment() if (!$res) return array('errors' => true, 'msg' => Db::getInstance()->getMsgError()); - return true; } diff --git a/install-dev/upgrade/php/add_order_state.php b/install-dev/upgrade/php/add_order_state.php index ad5fb0a48..6841a2b9a 100644 --- a/install-dev/upgrade/php/add_order_state.php +++ b/install-dev/upgrade/php/add_order_state.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_required_customization_field_flag.php b/install-dev/upgrade/php/add_required_customization_field_flag.php index 30c957943..dd1d57834 100644 --- a/install-dev/upgrade/php/add_required_customization_field_flag.php +++ b/install-dev/upgrade/php/add_required_customization_field_flag.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_stock_tab.php b/install-dev/upgrade/php/add_stock_tab.php index 5cfd8f3f5..dd5d6c1e6 100644 --- a/install-dev/upgrade/php/add_stock_tab.php +++ b/install-dev/upgrade/php/add_stock_tab.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/add_unknown_gender.php b/install-dev/upgrade/php/add_unknown_gender.php index ffa672f4b..3a66f3a29 100644 --- a/install-dev/upgrade/php/add_unknown_gender.php +++ b/install-dev/upgrade/php/add_unknown_gender.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -40,16 +40,16 @@ function add_unknown_gender() // inserts lang values $languages = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'lang`'); $lang_names = array( - 1 => 'Unknown', - 2 => 'Unbekannte', - 3 => 'Desconocido', - 4 => 'Inconnu', - 5 => 'Sconosciuto', + 'en' => 'Unknown', + 'de' => 'Unbekannte', + 'es' => 'Desconocido', + 'fr' => 'Inconnu', + 'it' => 'Sconosciuto', ); foreach ($languages as $lang) { - $name = (isset($lang_names[$lang['id_lang']]) ? $lang_names[$lang['id_lang']] : 'Unknown'); + $name = (isset($lang_names[$lang['iso_code']]) ? $lang_names[$lang['iso_code']] : 'Unknown'); $res &= Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'gender_lang` (`id_gender`, `id_lang`, `name`) VALUES ('.(int)$id_gender.', '.(int)$lang['id_lang'].', \''.pSQL($name).'\')'); diff --git a/install-dev/upgrade/php/alter_blocklink.php b/install-dev/upgrade/php/alter_blocklink.php index ed746598c..c6ca6a296 100644 --- a/install-dev/upgrade/php/alter_blocklink.php +++ b/install-dev/upgrade/php/alter_blocklink.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/alter_cms_block.php b/install-dev/upgrade/php/alter_cms_block.php index 4814014e7..2a341f678 100644 --- a/install-dev/upgrade/php/alter_cms_block.php +++ b/install-dev/upgrade/php/alter_cms_block.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/alter_productcomments_guest_index.php b/install-dev/upgrade/php/alter_productcomments_guest_index.php index c02aa8bbb..8bcfb9581 100644 --- a/install-dev/upgrade/php/alter_productcomments_guest_index.php +++ b/install-dev/upgrade/php/alter_productcomments_guest_index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/attribute_group_clean_combinations.php b/install-dev/upgrade/php/attribute_group_clean_combinations.php index b5d2e7669..dd4cc14eb 100644 --- a/install-dev/upgrade/php/attribute_group_clean_combinations.php +++ b/install-dev/upgrade/php/attribute_group_clean_combinations.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/block_category_1521.php b/install-dev/upgrade/php/block_category_1521.php index 7c508023e..c6b1846f7 100644 --- a/install-dev/upgrade/php/block_category_1521.php +++ b/install-dev/upgrade/php/block_category_1521.php @@ -1,14 +1,36 @@ - +* @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 +*/ function block_category_1521() { - if (!Db::getInstance()->ExecuteS('SELECT `'._DB_PREFIX_.'configuration` WHERE `name`=\'BLOCK_CATEG_MAX_DEPTH\' ')) + if (!Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `name` LIKE \'BLOCK_CATEG_MAX_DEPTH\' ')) Db::getInstance()->Execute('INSERT INTO `'._DB_PREFIX_.'configuration` (`id_configuration` ,`id_shop_group` ,`id_shop` ,`name` ,`value` ,`date_add` ,`date_upd`) - VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 2, NOW(), NOW())'); - else if (Db::getInstance()->ExecuteS('SELECT `'._DB_PREFIX_.'configuration` WHERE and `value` IS NOT NULL AND `value` <> 0')) - Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = 2 WHERE `name`=\'BLOCK_CATEG_MAX_DEPTH\' '); + VALUES (NULL, NULL, NULL, \'BLOCK_CATEG_MAX_DEPTH\', 4, NOW(), NOW())'); + else if ($maxdepth = (int)Db::getInstance()->getValue('SELECT FROM `'._DB_PREFIX_.'configuration` WHERE `value` IS NOT NULL AND `value` <> 0')) + Db::getInstance()->Execute('UPDATE `'._DB_PREFIX_.'configuration` SET `value` = '.($maxdepth + 1).' WHERE `name` LIKE\'BLOCK_CATEG_MAX_DEPTH\''); } \ No newline at end of file diff --git a/install-dev/upgrade/php/blocknewsletter.php b/install-dev/upgrade/php/blocknewsletter.php index 74f5d6d12..082575304 100644 --- a/install-dev/upgrade/php/blocknewsletter.php +++ b/install-dev/upgrade/php/blocknewsletter.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/blocknewsletter1530.php b/install-dev/upgrade/php/blocknewsletter1530.php index 9289012f9..1bc637cc7 100644 --- a/install-dev/upgrade/php/blocknewsletter1530.php +++ b/install-dev/upgrade/php/blocknewsletter1530.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ - function blocknewsletter1530() { include_once(_PS_INSTALL_PATH_.'upgrade/php/generic_add_missing_column.php'); diff --git a/install-dev/upgrade/php/category_product_index_unique.php b/install-dev/upgrade/php/category_product_index_unique.php index fbde8cc25..9e8739f79 100644 --- a/install-dev/upgrade/php/category_product_index_unique.php +++ b/install-dev/upgrade/php/category_product_index_unique.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/check_webservice_account_table.php b/install-dev/upgrade/php/check_webservice_account_table.php index b5f37da95..1b562fd5f 100644 --- a/install-dev/upgrade/php/check_webservice_account_table.php +++ b/install-dev/upgrade/php/check_webservice_account_table.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/clean_category_product.php b/install-dev/upgrade/php/clean_category_product.php index 8fd27801d..8a1970faf 100644 --- a/install-dev/upgrade/php/clean_category_product.php +++ b/install-dev/upgrade/php/clean_category_product.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/clean_tabs_15.php b/install-dev/upgrade/php/clean_tabs_15.php index d159efc13..9c15db2d4 100644 --- a/install-dev/upgrade/php/clean_tabs_15.php +++ b/install-dev/upgrade/php/clean_tabs_15.php @@ -1,4 +1,28 @@ +* @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 +*/ function clean_tabs_15() { diff --git a/install-dev/upgrade/php/cms_block.php b/install-dev/upgrade/php/cms_block.php index ed1aa9666..588d7f35a 100644 --- a/install-dev/upgrade/php/cms_block.php +++ b/install-dev/upgrade/php/cms_block.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ + function cms_block() { if (!Db::getInstance()->execute('SELECT `display_store` FROM `'._DB_PREFIX_.'cms_block` LIMIT 1')) diff --git a/install-dev/upgrade/php/configuration_double_cleaner.php b/install-dev/upgrade/php/configuration_double_cleaner.php index 7f71fb48e..b311cdec9 100644 --- a/install-dev/upgrade/php/configuration_double_cleaner.php +++ b/install-dev/upgrade/php/configuration_double_cleaner.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/convert_product_price.php b/install-dev/upgrade/php/convert_product_price.php index 41ae109e6..00d940833 100644 --- a/install-dev/upgrade/php/convert_product_price.php +++ b/install-dev/upgrade/php/convert_product_price.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/country_to_timezone.php b/install-dev/upgrade/php/country_to_timezone.php index 8d43a8075..ab35b992b 100644 --- a/install-dev/upgrade/php/country_to_timezone.php +++ b/install-dev/upgrade/php/country_to_timezone.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/create_multistore.php b/install-dev/upgrade/php/create_multistore.php index c5a1687fe..c09b2916b 100755 --- a/install-dev/upgrade/php/create_multistore.php +++ b/install-dev/upgrade/php/create_multistore.php @@ -1,4 +1,28 @@ +* @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 +*/ require_once(_PS_INSTALLER_PHP_UPGRADE_DIR_.'add_new_tab.php'); @@ -37,10 +61,10 @@ function create_multistore() id_theme = (SELECT id_theme FROM '._DB_PREFIX_.'theme WHERE name="'.Db::getInstance()->escape(_THEME_NAME_).'") WHERE id_shop = 1'); $shop_domain = Db::getInstance()->getValue('SELECT `value` - FROM `'._DB_PREFIX_.'_configuration` + FROM `'._DB_PREFIX_.'configuration` WHERE `name`="PS_SHOP_DOMAIN"'); $shop_domain_ssl = Db::getInstance()->getValue('SELECT `value` - FROM `'._DB_PREFIX_.'_configuration` + FROM `'._DB_PREFIX_.'configuration` WHERE `name`="PS_SHOP_DOMAIN_SSL"'); if(empty($shop_domain)) { @@ -54,11 +78,11 @@ function create_multistore() VALUES(1, \''.pSQL($shop_domain).'\', \''.pSQL($shop_domain_ssl).'\', \''.pSQL($_PS_DIRECTORY_).'\', \'\', 1, 1)'); // Stock conversion - $sql = 'INSERT INTO `'._DB_PREFIX_.'.stock` (`id_product`, `id_product_attribute`, `id_group_shop`, `id_shop`, `quantity`) - VALUES (SELECT `p.id_product`, 0, 1, 1, `p.quantity` FROM `'._DB_PREFIX_.'.product` p);'; + $sql = 'INSERT INTO `'._DB_PREFIX_.'stock` (`id_product`, `id_product_attribute`, `id_group_shop`, `id_shop`, `quantity`) + VALUES (SELECT p.`id_product`, 0, 1, 1, p.`quantity` FROM `'._DB_PREFIX_.'product` p);'; $res &= Db::getInstance()->execute($sql); - $sql = 'INSERT INTO `'._DB_PREFIX_.'.stock` (`id_product`, `id_product_attribute`, `id_group_shop`, `id_shop`, `quantity`) + $sql = 'INSERT INTO `'._DB_PREFIX_.'stock` (`id_product`, `id_product_attribute`, `id_group_shop`, `id_shop`, `quantity`) VALUES (SELECT `id_product`, `id_product_attribute`, 1, 1, `quantity` FROM `'._DB_PREFIX_.'product_attribute` p);'; $res &= Db::getInstance()->execute($sql); diff --git a/install-dev/upgrade/php/deactivate_custom_modules.php b/install-dev/upgrade/php/deactivate_custom_modules.php index dd01eedfa..81467c137 100644 --- a/install-dev/upgrade/php/deactivate_custom_modules.php +++ b/install-dev/upgrade/php/deactivate_custom_modules.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -66,18 +66,21 @@ function deactivate_custom_modules() $uninstallMe = array("undefined-modules"); if (is_array($arrNonNative)) - foreach($arrNonNative as $aModule) - $uninstallMe[] = $aModule['name']; + foreach($arrNonNative as $k => $aModule) + $uninstallMe[(int)$aModule['id_module']] = $aModule['name']; if (!is_array($uninstallMe)) $uninstallMe = array($uninstallMe); - foreach ($uninstallMe as $k=>$v) + foreach ($uninstallMe as $k => $v) $uninstallMe[$k] = '"'.pSQL($v).'"'; - return Db::getInstance()->execute(' - UPDATE `'._DB_PREFIX_.'module` - SET `active`= 0 - WHERE `name` IN ('.implode(',',$uninstallMe).')'); -} + $return = Db::getInstance()->execute(' + UPDATE `'._DB_PREFIX_.'module` SET `active` = 0 WHERE `name` IN ('.implode(',', $uninstallMe).')'); + if (count(Db::getInstance()->executeS('SHOW TABLES LIKE \''._DB_PREFIX_.'module_shop\''))> 0) + foreach($uninstallMe as $k => $uninstall) + $return &= Db::getInstance()->execute('DELETE FROM `'._DB_PREFIX_.'module_shop` WHERE `id_module` = '.(int)$k); + + return $return; +} \ No newline at end of file diff --git a/install-dev/upgrade/php/delivery_number_set.php b/install-dev/upgrade/php/delivery_number_set.php index ff2caf82d..7529ceed4 100644 --- a/install-dev/upgrade/php/delivery_number_set.php +++ b/install-dev/upgrade/php/delivery_number_set.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/drop_image_type_non_unique_index.php b/install-dev/upgrade/php/drop_image_type_non_unique_index.php index 7094d8f5e..9a336c96f 100644 --- a/install-dev/upgrade/php/drop_image_type_non_unique_index.php +++ b/install-dev/upgrade/php/drop_image_type_non_unique_index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/ecotax_tax_application_fix.php b/install-dev/upgrade/php/ecotax_tax_application_fix.php index e242114dd..11d491940 100644 --- a/install-dev/upgrade/php/ecotax_tax_application_fix.php +++ b/install-dev/upgrade/php/ecotax_tax_application_fix.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/editorial_update.php b/install-dev/upgrade/php/editorial_update.php index a1bc2c967..ad98b6b44 100644 --- a/install-dev/upgrade/php/editorial_update.php +++ b/install-dev/upgrade/php/editorial_update.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -48,9 +48,9 @@ function editorial_update() PRIMARY KEY (`id_editorial`, `id_lang`)) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8'); - if (file_exists(dirname(__FILE__).'/../../modules/editorial/editorial.xml')) + if (file_exists(dirname(__FILE__).'/../../../modules/editorial/editorial.xml')) { - $xml = simplexml_load_file(dirname(__FILE__).'/../../modules/editorial/editorial.xml'); + $xml = simplexml_load_file(dirname(__FILE__).'/../../../modules/editorial/editorial.xml'); Db::getInstance()->execute(' INSERT INTO `'._DB_PREFIX_.'editorial`(`id_editorial`, `body_home_logo_link`) VALUES(1, "'.(isset($xml->body->home_logo_link) ? pSQL($xml->body->home_logo_link) : '').'")'); @@ -65,7 +65,7 @@ function editorial_update() "'.(isset($xml->body->{'paragraph_'.$language['id_lang']}) ? pSQL($xml->body->{'paragraph_'.$language['id_lang']}, true) : '').'", "'.(isset($xml->body->{'logo_subheading_'.$language['id_lang']}) ? pSQL($xml->body->{'logo_subheading_'.$language['id_lang']}) : '').'")'); - unlink(dirname(__FILE__).'/../../modules/editorial/editorial.xml'); + unlink(dirname(__FILE__).'/../../../modules/editorial/editorial.xml'); } } } diff --git a/install-dev/upgrade/php/editorial_update_multishop.php b/install-dev/upgrade/php/editorial_update_multishop.php index 3001cddaf..95f689de9 100644 --- a/install-dev/upgrade/php/editorial_update_multishop.php +++ b/install-dev/upgrade/php/editorial_update_multishop.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/fix_cms_shop_1520.php b/install-dev/upgrade/php/fix_cms_shop_1520.php index 89e8d4dd5..5ef16c8b9 100755 --- a/install-dev/upgrade/php/fix_cms_shop_1520.php +++ b/install-dev/upgrade/php/fix_cms_shop_1520.php @@ -1,7 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ + function fix_cms_shop_1520() { $res = true; diff --git a/mails/it/index.php b/install-dev/upgrade/php/fix_download_product_feature_active.php similarity index 72% rename from mails/it/index.php rename to install-dev/upgrade/php/fix_download_product_feature_active.php index 08550506c..354b3e5f5 100644 --- a/mails/it/index.php +++ b/install-dev/upgrade/php/fix_download_product_feature_active.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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; \ No newline at end of file +function fix_download_product_feature_active() +{ + if (Db::getInstance()->getValue('SELECT COUNT(id_product_download) FROM `'._DB_PREFIX_.'product_download` WHERE `active` = 1 ;') > 0) + Configuration::updateGlobaleValue('PS_VIRTUAL_PROD_FEATURE_ACTIVE'); +} \ No newline at end of file diff --git a/install-dev/upgrade/php/fix_unique_specific_price.php b/install-dev/upgrade/php/fix_unique_specific_price.php index 1dc87da12..a0fde6aa3 100644 --- a/install-dev/upgrade/php/fix_unique_specific_price.php +++ b/install-dev/upgrade/php/fix_unique_specific_price.php @@ -1,7 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/generate_ntree.php b/install-dev/upgrade/php/generate_ntree.php index a9fd19714..102d10e2c 100644 --- a/install-dev/upgrade/php/generate_ntree.php +++ b/install-dev/upgrade/php/generate_ntree.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/generate_root_category_for_multishop.php b/install-dev/upgrade/php/generate_root_category_for_multishop.php index aac342bbb..851572863 100644 --- a/install-dev/upgrade/php/generate_root_category_for_multishop.php +++ b/install-dev/upgrade/php/generate_root_category_for_multishop.php @@ -1,4 +1,28 @@ +* @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 +*/ require_once('generate_ntree.php'); @@ -30,29 +54,35 @@ function generate_root_category_for_multishop() '); $data = array(); - foreach ($langs as $lang) - foreach ($shops as $shop) - $data[] = array( - 'id_lang' => $lang['id_lang'], - 'id_shop' => $shop['id_shop'], - 'id_category' => $id, - 'name' => 'Root', - 'link_rewrite' => '', - ); - Db::getInstance()->insert('category_lang', $data); + if(is_array($shops) && is_array($langs)) + { + foreach ($langs as $lang) + foreach ($shops as $shop) + $data[] = array( + 'id_lang' => $lang['id_lang'], + 'id_shop' => $shop['id_shop'], + 'id_category' => $id, + 'name' => 'Root', + 'link_rewrite' => '', + ); + Db::getInstance()->insert('category_lang', $data); + } $categories = Db::getInstance()->executeS(' SELECT `id_category` FROM `'._DB_PREFIX_.'category` '); $data = array(); - foreach ($categories as $category) - foreach ($shops as $shop) - $data[] = array( - 'id_category' => $category['id_category'], - 'id_shop' => $shop['id_shop'] - ); - Db::getInstance()->insert('category_shop', $data); + if(is_array($shops) && is_array($categories)) + { + foreach ($categories as $category) + foreach ($shops as $shop) + $data[] = array( + 'id_category' => $category['id_category'], + 'id_shop' => $shop['id_shop'] + ); + Db::getInstance()->insert('category_shop', $data); + } Db::getInstance()->execute(' UPDATE `'._DB_PREFIX_.'category` @@ -66,4 +96,4 @@ function generate_root_category_for_multishop() '); generate_ntree(); -} +} \ No newline at end of file diff --git a/install-dev/upgrade/php/generate_tax_rules.php b/install-dev/upgrade/php/generate_tax_rules.php index 0884b1777..950e103d2 100644 --- a/install-dev/upgrade/php/generate_tax_rules.php +++ b/install-dev/upgrade/php/generate_tax_rules.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -63,8 +63,8 @@ function generate_tax_rules() } $states = Db::getInstance()->executeS(' - SELECT * FROM `'._DB_PREFIX_.'states s - LEFT JOIN `'._DB_PREFIX_.'tax_state ts ON (ts.`id_state` = s.`id_state`) + SELECT * FROM `'._DB_PREFIX_.'states` s + LEFT JOIN `'._DB_PREFIX_.'tax_state` ts ON (ts.`id_state` = s.`id_state`) WHERE `id_tax` = '.(int)$id_tax); if ($states) diff --git a/install-dev/upgrade/php/generic_add_missing_column.php b/install-dev/upgrade/php/generic_add_missing_column.php index 6d59c6c97..f63700ca9 100644 --- a/install-dev/upgrade/php/generic_add_missing_column.php +++ b/install-dev/upgrade/php/generic_add_missing_column.php @@ -1,15 +1,42 @@ +* @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 +*/ function generic_add_missing_column($table, $column_to_add) { $column_exist = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.$table.'`'); $column_formated = array(); - - foreach($column_exist as $c) - $column_formated[] = $c['Field'] ; $res = true; - foreach($column_to_add as $name => $details) - if (!in_array($name, $column_formated)) - $res &= Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.$table.'` ADD COLUMN `'.$name.'` '.$details); + if ($column_exist) + { + foreach($column_exist as $c) + $column_formated[] = $c['Field'] ; + + foreach($column_to_add as $name => $details) + if (!in_array($name, $column_formated)) + $res &= Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.$table.'` ADD COLUMN `'.$name.'` '.$details); + } return $res; } \ No newline at end of file diff --git a/install-dev/upgrade/php/gridextjs_deprecated.php b/install-dev/upgrade/php/gridextjs_deprecated.php index a96c5aff2..3697022cb 100644 --- a/install-dev/upgrade/php/gridextjs_deprecated.php +++ b/install-dev/upgrade/php/gridextjs_deprecated.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -36,7 +36,7 @@ function gridextjs_deprecated() if (defined('_PS_ROOT_DIR_')) $gridextjs_path = _PS_ROOT_DIR_ . '/modules/gridextjs'; else - $gridextjs_path = dirname(__FILE__).'/../../modules/gridextjs'; + $gridextjs_path = dirname(__FILE__).'/../../../modules/gridextjs'; if (file_exists($gridextjs_path)) return rename($gridextjs_path, str_replace('gridextjs', 'gridextjs.deprecated', $gridextjs_path)); diff --git a/install-dev/upgrade/php/group_reduction_column_fix.php b/install-dev/upgrade/php/group_reduction_column_fix.php index 4e3b0df8d..42d6a0929 100644 --- a/install-dev/upgrade/php/group_reduction_column_fix.php +++ b/install-dev/upgrade/php/group_reduction_column_fix.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/hook_blocksearch_on_header.php b/install-dev/upgrade/php/hook_blocksearch_on_header.php index 38e699fec..f64af050b 100644 --- a/install-dev/upgrade/php/hook_blocksearch_on_header.php +++ b/install-dev/upgrade/php/hook_blocksearch_on_header.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/id_currency_country_fix.php b/install-dev/upgrade/php/id_currency_country_fix.php index f7ec099c5..6bd03071a 100644 --- a/install-dev/upgrade/php/id_currency_country_fix.php +++ b/install-dev/upgrade/php/id_currency_country_fix.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/mails/es/index.php b/install-dev/upgrade/php/image_shop1510.php similarity index 72% rename from mails/es/index.php rename to install-dev/upgrade/php/image_shop1510.php index 08550506c..cf3e87240 100644 --- a/mails/es/index.php +++ b/install-dev/upgrade/php/image_shop1510.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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"); +function image_shop1510() +{ + include_once(_PS_INSTALL_PATH_.'upgrade/php/generic_add_missing_column.php'); + + $column_to_add = array( + 'cover' => 'TINYINT(1) UNSIGNED NOT NULL AFTER `id_shop`'); -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; \ No newline at end of file + return generic_add_missing_column('image_shop', $column_to_add); +} diff --git a/install-dev/upgrade/php/index.php b/install-dev/upgrade/php/index.php index ec45b2dfe..f42f03e4d 100644 --- a/install-dev/upgrade/php/index.php +++ b/install-dev/upgrade/php/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/invoice_number_set.php b/install-dev/upgrade/php/invoice_number_set.php index 8a2f66cdf..c576fe1cf 100644 --- a/install-dev/upgrade/php/invoice_number_set.php +++ b/install-dev/upgrade/php/invoice_number_set.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/latin1_database_to_utf8.php b/install-dev/upgrade/php/latin1_database_to_utf8.php index 4dc495fdc..cd1bb99d6 100644 --- a/install-dev/upgrade/php/latin1_database_to_utf8.php +++ b/install-dev/upgrade/php/latin1_database_to_utf8.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/migrate_block_info_to_cms_block.php b/install-dev/upgrade/php/migrate_block_info_to_cms_block.php index 6502c2d30..a9dbd11ee 100644 --- a/install-dev/upgrade/php/migrate_block_info_to_cms_block.php +++ b/install-dev/upgrade/php/migrate_block_info_to_cms_block.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/migrate_orders.php b/install-dev/upgrade/php/migrate_orders.php index 9e5e5bbb4..6929bd07d 100644 --- a/install-dev/upgrade/php/migrate_orders.php +++ b/install-dev/upgrade/php/migrate_orders.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/migrate_tabs_15.php b/install-dev/upgrade/php/migrate_tabs_15.php index 8ab534061..a9a0b671c 100644 --- a/install-dev/upgrade/php/migrate_tabs_15.php +++ b/install-dev/upgrade/php/migrate_tabs_15.php @@ -1,4 +1,28 @@ +* @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 +*/ /** * Migrate BO tabs for 1.5 (new reorganization of BO) diff --git a/install-dev/upgrade/php/migrate_tabs_multi_shop.php b/install-dev/upgrade/php/migrate_tabs_multi_shop.php index b5549535a..3cc8e195d 100755 --- a/install-dev/upgrade/php/migrate_tabs_multi_shop.php +++ b/install-dev/upgrade/php/migrate_tabs_multi_shop.php @@ -1,4 +1,28 @@ +* @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 +*/ /** * Migrate BO tabs for multi-shop new reorganization diff --git a/install-dev/upgrade/php/moduleReinstaller.php b/install-dev/upgrade/php/moduleReinstaller.php index bc9545181..bcffce8e5 100644 --- a/install-dev/upgrade/php/moduleReinstaller.php +++ b/install-dev/upgrade/php/moduleReinstaller.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/module_blockwishlist_multishop.php b/install-dev/upgrade/php/module_blockwishlist_multishop.php index 19e08ab59..f565bdba9 100644 --- a/install-dev/upgrade/php/module_blockwishlist_multishop.php +++ b/install-dev/upgrade/php/module_blockwishlist_multishop.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/module_reinstall_blockmyaccount.php b/install-dev/upgrade/php/module_reinstall_blockmyaccount.php index fbf8f8094..38bd8c948 100644 --- a/install-dev/upgrade/php/module_reinstall_blockmyaccount.php +++ b/install-dev/upgrade/php/module_reinstall_blockmyaccount.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/module_reinstall_blocksearch.php b/install-dev/upgrade/php/module_reinstall_blocksearch.php index 1bed2578e..ff572de12 100644 --- a/install-dev/upgrade/php/module_reinstall_blocksearch.php +++ b/install-dev/upgrade/php/module_reinstall_blocksearch.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/move_crossselling.php b/install-dev/upgrade/php/move_crossselling.php index 53d37601d..3f604b27a 100644 --- a/install-dev/upgrade/php/move_crossselling.php +++ b/install-dev/upgrade/php/move_crossselling.php @@ -1,4 +1,28 @@ +* @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 +*/ function move_crossselling() { diff --git a/install-dev/upgrade/php/move_translations_module_file.php b/install-dev/upgrade/php/move_translations_module_file.php index 18d62d628..0fcf7e49f 100644 --- a/install-dev/upgrade/php/move_translations_module_file.php +++ b/install-dev/upgrade/php/move_translations_module_file.php @@ -1,4 +1,28 @@ +* @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 +*/ /** * Move all translation modules files 1.4 for a good architecture in 1.5 diff --git a/install-dev/upgrade/php/outstanding_allow_amount1530.php b/install-dev/upgrade/php/outstanding_allow_amount1530.php new file mode 100644 index 000000000..b6e461bf3 --- /dev/null +++ b/install-dev/upgrade/php/outstanding_allow_amount1530.php @@ -0,0 +1,41 @@ + +* @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 +*/ + +function outstanding_allow_amount1530() +{ + $column_exist = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'address`'); + $column_formated = array(); + $res = true; + if ($column_exist) + { + foreach($column_exist as $c) + $column_formated[] = $c['Field'] ; + + if (in_array('outstanding_allow_amount' , $column_formated)) + Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'address` CHANGE `outstanding_allow_amount` `outstanding_allow_amount` DECIMAL(20, 6) NOT NULL DEFAULT 0.000000'); + } + return $res; +} \ No newline at end of file diff --git a/install-dev/upgrade/php/p15010_drop_column_id_address_if_exists.php b/install-dev/upgrade/php/p15010_drop_column_id_address_if_exists.php index b2b3a6a81..5a73742be 100644 --- a/install-dev/upgrade/php/p15010_drop_column_id_address_if_exists.php +++ b/install-dev/upgrade/php/p15010_drop_column_id_address_if_exists.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/p15012_add_missing_columns.php b/install-dev/upgrade/php/p15012_add_missing_columns.php old mode 100644 new mode 100755 index e0af2db53..21dce2f94 --- a/install-dev/upgrade/php/p15012_add_missing_columns.php +++ b/install-dev/upgrade/php/p15012_add_missing_columns.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -48,7 +48,7 @@ function p15012_add_missing_columns() $q_list['cart_product']['id_shop']['mod'] = 'ALTER TABLE `'._DB_PREFIX_.'cart_product` CHANGE `id_shop` `id_shop` int(10) unsigned NOT NULL DEFAULT "1" AFTER `id_address_delivery`'; $q_list['cart_product']['id_shop']['add'] = 'ALTER TABLE `'._DB_PREFIX_.'cart_product` - ADD `id_shop` `id_shop` int(10) unsigned NOT NULL DEFAULT "1" AFTER `id_address_delivery`'; + ADD `id_shop` int(10) unsigned NOT NULL DEFAULT "1" AFTER `id_address_delivery`'; $q_list['cart_product']['id_product_attribute']['mod'] = 'ALTER TABLE `'._DB_PREFIX_.'cart_product` CHANGE `id_product_attribute` `id_product_attribute` int(10) unsigned DEFAULT NULL AFTER `id_shop`'; $q_list['cart_product']['id_product_attribute']['add'] = 'ALTER TABLE `'._DB_PREFIX_.'cart_product` @@ -160,22 +160,24 @@ function p15012_add_missing_columns() if (empty($table)) continue; $list_fields = $db->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.$table.'`'); - foreach($list_fields as $k => $field) - $list_fields[$k] = $field['Field']; - foreach ($cols as $col => $q) - { - // do only if column exists - if (in_array($col, $list_fields)) - $do = 'mod'; - else - $do = 'add'; - - if (!empty($q[$do])) + if (is_array($list_fields)) + foreach($list_fields as $k => $field) + $list_fields[$k] = $field['Field']; + if (is_array($cols)) + foreach ($cols as $col => $q) { - if (!$db->execute($q[$do])) - $errors[] = ''.$q[$do].''.$db->getMsgError().''; + // do only if column exists + if (is_array($list_fields) && in_array($col, $list_fields)) + $do = 'mod'; + else + $do = 'add'; + + if (!empty($q[$do])) + { + if (!$db->execute($q[$do])) + $errors[] = ''.$q[$do].''.$db->getMsgError().''; + } } - } } if (sizeof($errors) > 0) @@ -186,4 +188,3 @@ function p15012_add_missing_columns() else return true; } - diff --git a/install-dev/upgrade/php/p15013_add_missing_columns.php b/install-dev/upgrade/php/p15013_add_missing_columns.php index 049824015..55322a56c 100644 --- a/install-dev/upgrade/php/p15013_add_missing_columns.php +++ b/install-dev/upgrade/php/p15013_add_missing_columns.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -32,13 +32,19 @@ function p15013_add_missing_columns() if ($id_module) { - if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'statssearch` - ADD `id_group_shop` INT(10) NOT NULL default "1" AFTER id_statssearch, - ADD `id_shop` INT(10) NOT NULL default "1" AFTER id_statssearch')) - { - $errors[] = $db->getMsgError(); - } + $list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'statssearch`'); + foreach ($list_fields as $k => $field) + $list_fields[$k] = $field['Field']; + + if (!in_array('id_group_shop', $list_fields)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'statssearch` + ADD `id_group_shop` INT(10) NOT NULL default "1" AFTER id_statssearch')) + $errors[] = $db->getMsgError(); + if (!in_array('id_shop', $list_fields)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'statssearch` + ADD `id_shop` INT(10) NOT NULL default "1" AFTER id_statssearch')) + $errors[] = $db->getMsgError(); } if (count($errors)) return array('error' => 1, 'msg' => implode(',', $errors)) ; -} +} \ No newline at end of file diff --git a/install-dev/upgrade/php/p15014_add_missing_columns.php b/install-dev/upgrade/php/p15014_add_missing_columns.php index b7013a76f..dbe316066 100644 --- a/install-dev/upgrade/php/p15014_add_missing_columns.php +++ b/install-dev/upgrade/php/p15014_add_missing_columns.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/p15014_copy_missing_images_tab_from_installer.php b/install-dev/upgrade/php/p15014_copy_missing_images_tab_from_installer.php index aab087824..0c7efd25e 100644 --- a/install-dev/upgrade/php/p15014_copy_missing_images_tab_from_installer.php +++ b/install-dev/upgrade/php/p15014_copy_missing_images_tab_from_installer.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/p15014_upgrade_sekeywords.php b/install-dev/upgrade/php/p15014_upgrade_sekeywords.php index 3fb5cb9e1..b529fc290 100644 --- a/install-dev/upgrade/php/p15014_upgrade_sekeywords.php +++ b/install-dev/upgrade/php/p15014_upgrade_sekeywords.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/p15015_blockadvertising_extension.php b/install-dev/upgrade/php/p15015_blockadvertising_extension.php index d859c0bc2..d7795f6b6 100644 --- a/install-dev/upgrade/php/p15015_blockadvertising_extension.php +++ b/install-dev/upgrade/php/p15015_blockadvertising_extension.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/p15016_add_missing_columns.php b/install-dev/upgrade/php/p15016_add_missing_columns.php index 6a786fb5d..4916c4f6c 100644 --- a/install-dev/upgrade/php/p15016_add_missing_columns.php +++ b/install-dev/upgrade/php/p15016_add_missing_columns.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,10 +34,31 @@ function p15016_add_missing_columns() $list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'reinsurance`'); foreach ($list_fields as $k => $field) $list_fields[$k] = $field['Field']; - + + if (in_array('id_contactinfos', $list_fields)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'reinsurance` CHANGE `id_contactinfos` `id_reinsurance` INT( 10 ) UNSIGNED NOT NULL AUTO_INCREMENT')) + $errors[] = Db::getInstance()->getMsgError(); if (!in_array('id_shop', $list_fields)) if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'reinsurance` ADD `id_shop` INT(10) NOT NULL default "1" AFTER id_reinsurance')) $errors[] = Db::getInstance()->getMsgError(); + if (in_array('filename', $list_fields)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'reinsurance` CHANGE `filename` `file_name` VARCHAR(100) NOT NULL')) + $errors[] = Db::getInstance()->getMsgError(); + + $list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'reinsurance_lang`'); + + if (!is_array($list_fields) || $list_fields == false) + { + $return = Db::getInstance()->execute(' + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'reinsurance_lang` ( + `id_reinsurance` INT UNSIGNED NOT NULL AUTO_INCREMENT, + `id_lang` int(10) unsigned NOT NULL , + `text` VARCHAR(300) NOT NULL, + PRIMARY KEY (`id_reinsurance`, `id_lang`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 ;'); + if (!$return) + $errors[] = Db::getInstance()->getMsgError(); + } } $id_module = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name="blocktopmenu"'); diff --git a/install-dev/upgrade/php/p15017_add_id_shop_to_primary_key.php b/install-dev/upgrade/php/p15017_add_id_shop_to_primary_key.php index 7d03e8d75..0fbec3a8e 100644 --- a/install-dev/upgrade/php/p15017_add_id_shop_to_primary_key.php +++ b/install-dev/upgrade/php/p15017_add_id_shop_to_primary_key.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/p15018_change_image_types.php b/install-dev/upgrade/php/p15018_change_image_types.php index 27cdc014a..37cc9c5d8 100644 --- a/install-dev/upgrade/php/p15018_change_image_types.php +++ b/install-dev/upgrade/php/p15018_change_image_types.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -72,7 +72,7 @@ function p15018_change_image_types() $option ); $folder = implode(DIRECTORY_SEPARATOR, str_split((string)$row['id_image'])).DIRECTORY_SEPARATOR; - if (file_exists(_PS_ROOT_DIR_.'img'.DIRECTORY_SEPARATOR.'p'.DIRECTORY_SEPARATOR.$folder.$row['id_image'].'.jpg')) + if (file_exists(_PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.'p'.DIRECTORY_SEPARATOR.$folder.$row['id_image'].'.jpg')) foreach ($replace_types['products'] as $old_type => $new_type) p15018_copy_or_rename( _PS_ROOT_DIR_.DIRECTORY_SEPARATOR.'img'.DIRECTORY_SEPARATOR.'p'.DIRECTORY_SEPARATOR.$folder.$row['id_image'].'-'.$old_type.'.jpg', diff --git a/install-dev/upgrade/php/p1531_redirect_type.php b/install-dev/upgrade/php/p1531_redirect_type.php new file mode 100644 index 000000000..25f542d65 --- /dev/null +++ b/install-dev/upgrade/php/p1531_redirect_type.php @@ -0,0 +1,35 @@ + +* @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 +*/ + +function p1531_redirect_type() +{ + include_once(_PS_INSTALL_PATH_.'upgrade/php/generic_add_missing_column.php'); + + $result = generic_add_missing_column('product', array('redirect_type' => 'ENUM(\'\', \'404\', \'301\', \'302\') NOT NULL DEFAULT \'404\' AFTER `active`')); + $result &= generic_add_missing_column('product_shop', array('redirect_type' => 'ENUM(\'\', \'404\', \'301\', \'302\') NOT NULL DEFAULT \'404\' AFTER `active`')); + + return $result; +} \ No newline at end of file diff --git a/install-dev/upgrade/php/p1540_add_missing_columns.php b/install-dev/upgrade/php/p1540_add_missing_columns.php new file mode 100644 index 000000000..95a3b6ab1 --- /dev/null +++ b/install-dev/upgrade/php/p1540_add_missing_columns.php @@ -0,0 +1,68 @@ + +* @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 +*/ + +function p1540_add_missing_columns() +{ + $errors = array(); + $id_module = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name LIKE "loyalty"'); + if ($id_module) + { + $list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'loyalty`'); + foreach ($list_fields as $k => $field) + $list_fields[$k] = $field['Field']; + + if (in_array('id_discount', $list_fields)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'loyalty` CHANGE `id_discount` `id_cart_rule` INT( 10 ) UNSIGNED NULL DEFAULT NULL')) + $errors[] = Db::getInstance()->getMsgError(); + } + + $id_module = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name LIKE "blocklayered"'); + if ($id_module) + { + $list_fields = Db::getInstance()->executeS('SHOW FIELDS FROM `'._DB_PREFIX_.'layered_product_attribute`'); + if(is_array($list_fields)) + { + foreach ($list_fields as $k => $field) + $list_fields[$k] = $field['Field']; + if (!in_array('id_shop', $list_fields)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'layered_product_attribute` ADD `id_shop` INT( 10 ) UNSIGNED NOT NULL DEFAULT "1" AFTER `id_attribute_group`')) + $errors[] = Db::getInstance()->getMsgError(); + } + } + + $key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');; + if (is_array($key_exists) && count($key_exists)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `product_sqlstock`')) + $errors[] = Db::getInstance()->getMsgError(); + + $key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "id_product_2"');; + if (is_array($key_exists) && count($key_exists)) + if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `id_product_2`')) + $errors[] = Db::getInstance()->getMsgError(); + + if (count($errors)) + return array('error' => 1, 'msg' => implode(',', $errors)) ; +} \ No newline at end of file diff --git a/install-dev/upgrade/php/regenerate_level_depth.php b/install-dev/upgrade/php/regenerate_level_depth.php index 2b39df5eb..3d3245ece 100644 --- a/install-dev/upgrade/php/regenerate_level_depth.php +++ b/install-dev/upgrade/php/regenerate_level_depth.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/remove_duplicate_category_groups.php b/install-dev/upgrade/php/remove_duplicate_category_groups.php index 3b07a8e8c..65b754e1c 100644 --- a/install-dev/upgrade/php/remove_duplicate_category_groups.php +++ b/install-dev/upgrade/php/remove_duplicate_category_groups.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/remove_module_from_hook.php b/install-dev/upgrade/php/remove_module_from_hook.php index 4e80cc7a2..c3c918930 100644 --- a/install-dev/upgrade/php/remove_module_from_hook.php +++ b/install-dev/upgrade/php/remove_module_from_hook.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/remove_tab.php b/install-dev/upgrade/php/remove_tab.php index aed55c88d..2a0c53902 100644 --- a/install-dev/upgrade/php/remove_tab.php +++ b/install-dev/upgrade/php/remove_tab.php @@ -1,5 +1,28 @@ +* @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 +*/ function remove_tab($tabname) { diff --git a/install-dev/upgrade/php/reorderpositions.php b/install-dev/upgrade/php/reorderpositions.php index 2383838cd..c922d2355 100644 --- a/install-dev/upgrade/php/reorderpositions.php +++ b/install-dev/upgrade/php/reorderpositions.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/set_discount_category.php b/install-dev/upgrade/php/set_discount_category.php index 782a5ccf1..c30285dba 100644 --- a/install-dev/upgrade/php/set_discount_category.php +++ b/install-dev/upgrade/php/set_discount_category.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/set_payment_module.php b/install-dev/upgrade/php/set_payment_module.php index 87050787c..187a14ecb 100644 --- a/install-dev/upgrade/php/set_payment_module.php +++ b/install-dev/upgrade/php/set_payment_module.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/set_payment_module_group.php b/install-dev/upgrade/php/set_payment_module_group.php index 77179eb24..941facca7 100644 --- a/install-dev/upgrade/php/set_payment_module_group.php +++ b/install-dev/upgrade/php/set_payment_module_group.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/set_product_suppliers.php b/install-dev/upgrade/php/set_product_suppliers.php index 7a4f60ac8..b18693aae 100644 --- a/install-dev/upgrade/php/set_product_suppliers.php +++ b/install-dev/upgrade/php/set_product_suppliers.php @@ -1,4 +1,29 @@ +* @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 +*/ + function set_product_suppliers() { $ps_currency_default = Db::getInstance()->getValue('SELECT value diff --git a/install-dev/upgrade/php/set_stock_available.php b/install-dev/upgrade/php/set_stock_available.php index baebca2c1..f0bb0a231 100644 --- a/install-dev/upgrade/php/set_stock_available.php +++ b/install-dev/upgrade/php/set_stock_available.php @@ -1,4 +1,29 @@ +* @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 +*/ + function set_stock_available() { $res = true; diff --git a/install-dev/upgrade/php/setAllGroupsOnHomeCategory.php b/install-dev/upgrade/php/setallgroupsonhomecategory.php old mode 100755 new mode 100644 similarity index 92% rename from install-dev/upgrade/php/setAllGroupsOnHomeCategory.php rename to install-dev/upgrade/php/setallgroupsonhomecategory.php index 409ffdb2f..ad437cd40 --- a/install-dev/upgrade/php/setAllGroupsOnHomeCategory.php +++ b/install-dev/upgrade/php/setallgroupsonhomecategory.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -27,7 +27,7 @@ function setAllGroupsOnHomeCategory() { $ps_lang_default = Db::getInstance()->getValue('SELECT value - FROM `'._DB_PREFIX_.'`configuration WHERE name="PS_LANG_DEFAULT"'); + FROM `'._DB_PREFIX_.'configuration` WHERE name="PS_LANG_DEFAULT"'); $results = Db::getInstance()->executeS('SELECT id_group FROM `'._DB_PREFIX_.'group`'); $groups = array(); diff --git a/install-dev/upgrade/php/shop_url.php b/install-dev/upgrade/php/shop_url.php index 9635e8564..1fc12972e 100644 --- a/install-dev/upgrade/php/shop_url.php +++ b/install-dev/upgrade/php/shop_url.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_carrier_url.php b/install-dev/upgrade/php/update_carrier_url.php index 28c4a4c41..b2ac23a24 100644 --- a/install-dev/upgrade/php/update_carrier_url.php +++ b/install-dev/upgrade/php/update_carrier_url.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_customer_default_group.php b/install-dev/upgrade/php/update_customer_default_group.php new file mode 100644 index 000000000..03bb77b6c --- /dev/null +++ b/install-dev/upgrade/php/update_customer_default_group.php @@ -0,0 +1,52 @@ + +* @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 +*/ + +function update_customer_default_group() +{ + $filename = _PS_ROOT_DIR_.'/config/defines.inc.php'; + $filename_old = str_replace('.inc.', '.old.', $filename); + copy($filename, $filename_old); + @chmod($filename_old, 0664); + $content = file_get_contents($filename); + $pattern = "/define\('_PS_DEFAULT_CUSTOMER_GROUP_', (\d)\);/"; + preg_match($pattern, $content, $matches); + if (!defined('_PS_DEFAULT_CUSTOMER_GROUP_')) + define('_PS_DEFAULT_CUSTOMER_GROUP_', ((isset($matches[1]) AND is_numeric($matches[1]))? (int)$matches[1] : 3)); + $ps_customer_group = DB::getInstance()->getValue('SELECT value FROM `'._DB_PREFIX_.'configuration` WHERE name LIKE "PS_CUSTOMER_GROUP"', false); + $str_old = 'define(\'_PS_DEFAULT_CUSTOMER_GROUP_\', '.(int)_PS_DEFAULT_CUSTOMER_GROUP_.');'; + $str_new = 'define(\'_PS_DEFAULT_CUSTOMER_GROUP_\', '.(int)$ps_customer_group.');'; + $content = str_replace($str_old, $str_new, $content); + $result = false; + if(file_exists($filename) && is_writable($filename)) + $result = (bool)@file_put_contents($filename, $content); + if($result === true && file_exists($filename) && file_exists($filename_old)) + { + @unlink($filename_old); + @chmod($filename, 0664); + return true; + } + return false; +} \ No newline at end of file diff --git a/install-dev/upgrade/php/update_feature_detachable_cache.php b/install-dev/upgrade/php/update_feature_detachable_cache.php index 96906a25e..45d433739 100644 --- a/install-dev/upgrade/php/update_feature_detachable_cache.php +++ b/install-dev/upgrade/php/update_feature_detachable_cache.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_for_13version.php b/install-dev/upgrade/php/update_for_13version.php index 585e5f718..982a8ff3b 100644 --- a/install-dev/upgrade/php/update_for_13version.php +++ b/install-dev/upgrade/php/update_for_13version.php @@ -1,4 +1,28 @@ +* @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 +*/ function update_for_13version() { diff --git a/install-dev/upgrade/php/update_genders_images.php b/install-dev/upgrade/php/update_genders_images.php new file mode 100644 index 000000000..20b060356 --- /dev/null +++ b/install-dev/upgrade/php/update_genders_images.php @@ -0,0 +1,37 @@ + +* @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 +*/ + +function update_genders_images() +{ + if (file_exists(_PS_ROOT_DIR_.'/img/genders/Mr.jpg')) + @rename(_PS_ROOT_DIR_.'/img/genders/Mr.jpg', _PS_ROOT_DIR_.'/img/genders/1.jpg'); + if (file_exists(_PS_ROOT_DIR_.'/img/genders/Ms.jpg')) + @rename(_PS_ROOT_DIR_.'/img/genders/Ms.jpg', _PS_ROOT_DIR_.'/img/genders/2.jpg'); + if (file_exists(_PS_ROOT_DIR_.'/img/genders/Miss.jpg')) + @rename(_PS_ROOT_DIR_.'/img/genders/Miss.jpg', _PS_ROOT_DIR_.'/img/genders/3.jpg'); + if (file_exists(_PS_ROOT_DIR_.'genders/unknown.jpg')) + @rename(_PS_ROOT_DIR_.'/img/genders/unknown.jpg', _PS_ROOT_DIR_.'/img/genders/Unknown.jpg'); +} \ No newline at end of file diff --git a/install-dev/upgrade/php/update_image_size_in_db.php b/install-dev/upgrade/php/update_image_size_in_db.php index 312b02993..2f0a25176 100644 --- a/install-dev/upgrade/php/update_image_size_in_db.php +++ b/install-dev/upgrade/php/update_image_size_in_db.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_mailalerts_add_column_idshop.php b/install-dev/upgrade/php/update_mailalerts_add_column_idshop.php index bfe479a40..c79407dec 100644 --- a/install-dev/upgrade/php/update_mailalerts_add_column_idshop.php +++ b/install-dev/upgrade/php/update_mailalerts_add_column_idshop.php @@ -1,12 +1,37 @@ +* @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 +*/ + /* * To change this template, choose Tools | Templates * and open the template in the editor. */ - function update_mailalerts_add_column_idshop() { $installed = Db::getInstance()->getValue('SELECT id_module FROM `'._DB_PREFIX_.'module` WHERE name = "mailalerts"'); + $installed &= Db::getInstance()->getValue('SHOW TABLES LIKE "'._DB_PREFIX_.'mailalert_customer_oos"'); if ($installed && !Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'mailalert_customer_oos` ADD COLUMN `id_shop` int(11) NOT NULL default "0" AFTER `id_customer`')) return array('error' => 1, 'msg' => sprintf('unable to create column id_shop (%s)', Db::getInstance ()->getMsgError())); return true; diff --git a/install-dev/upgrade/php/update_module_blocklayered.php b/install-dev/upgrade/php/update_module_blocklayered.php index e10af0bc6..8a96ba6b2 100644 --- a/install-dev/upgrade/php/update_module_blocklayered.php +++ b/install-dev/upgrade/php/update_module_blocklayered.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_module_followup.php b/install-dev/upgrade/php/update_module_followup.php index c26fc9687..08021addf 100644 --- a/install-dev/upgrade/php/update_module_followup.php +++ b/install-dev/upgrade/php/update_module_followup.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_module_loyalty.php b/install-dev/upgrade/php/update_module_loyalty.php index 5dbb6c1c7..573c0120a 100644 --- a/install-dev/upgrade/php/update_module_loyalty.php +++ b/install-dev/upgrade/php/update_module_loyalty.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ -// backward compatibility vouchers should be available in all categories +/** +* backward compatibility vouchers should be available in all categories +*/ function update_module_loyalty() { $ps_loyalty_point_value = Db::getInstance()->getValue('SELECT value diff --git a/install-dev/upgrade/php/update_module_pagesnotfound.php b/install-dev/upgrade/php/update_module_pagesnotfound.php index 5064bcb47..91f86dc18 100644 --- a/install-dev/upgrade/php/update_module_pagesnotfound.php +++ b/install-dev/upgrade/php/update_module_pagesnotfound.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_module_product_comments.php b/install-dev/upgrade/php/update_module_product_comments.php index 0b80530ff..8df0773f0 100644 --- a/install-dev/upgrade/php/update_module_product_comments.php +++ b/install-dev/upgrade/php/update_module_product_comments.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_modules_multishop.php b/install-dev/upgrade/php/update_modules_multishop.php index 5b5b61c81..536d06b72 100644 --- a/install-dev/upgrade/php/update_modules_multishop.php +++ b/install-dev/upgrade/php/update_modules_multishop.php @@ -1,4 +1,28 @@ +* @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 +*/ function update_modules_multishop() { diff --git a/install-dev/upgrade/php/update_modules_sql.php b/install-dev/upgrade/php/update_modules_sql.php index ebede3a3b..b35bb8859 100644 --- a/install-dev/upgrade/php/update_modules_sql.php +++ b/install-dev/upgrade/php/update_modules_sql.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_order_canada.php b/install-dev/upgrade/php/update_order_canada.php index 1b09820e7..79413b8fe 100644 --- a/install-dev/upgrade/php/update_order_canada.php +++ b/install-dev/upgrade/php/update_order_canada.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -55,7 +55,7 @@ function update_order_canada() $id_order_list = Db::getInstance()->executeS($sql); $default_price_display_method = Db::getInstance()->getValue('SELECT price_display_method - FROM `'._DB_PREFIX_.'group WHERE id_group=1`'); + FROM `'._DB_PREFIX_.'group` WHERE id_group=1'); $values = ''; foreach ($id_order_list as $order) { diff --git a/install-dev/upgrade/php/update_order_detail_taxes.php b/install-dev/upgrade/php/update_order_detail_taxes.php index 7d701717d..1fe91a2fe 100644 --- a/install-dev/upgrade/php/update_order_detail_taxes.php +++ b/install-dev/upgrade/php/update_order_detail_taxes.php @@ -1,4 +1,28 @@ +* @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 +*/ function update_order_detail_taxes() { diff --git a/install-dev/upgrade/php/update_order_details.php b/install-dev/upgrade/php/update_order_details.php index 2e8c93007..de0e9fbe8 100644 --- a/install-dev/upgrade/php/update_order_details.php +++ b/install-dev/upgrade/php/update_order_details.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/update_order_messages.php b/install-dev/upgrade/php/update_order_messages.php new file mode 100644 index 000000000..369b753d5 --- /dev/null +++ b/install-dev/upgrade/php/update_order_messages.php @@ -0,0 +1,70 @@ + +* @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 +*/ + +function update_order_messages() +{ + $step = 3000; + $count_messages = Db::getInstance()->getValue('SELECT count(id_message) FROM '._DB_PREFIX_.'message'); + $nb_loop = $start = 0; + if($count_messages > 0) + $nb_loop = ceil($count_messages / $step); + for($i = 0; $i < $nb_loop; $i++) + { + $sql = 'SELECT id_message, message FROM `'._DB_PREFIX_.'message` WHERE message REGEXP \'query($sql)) + while ($message = Db::getInstance()->nextRow($messages)) + { + if(is_array($message)) + { + $sql = 'UPDATE `'._DB_PREFIX_.'message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(br2nl($message['message']))).'\' + WHERE id_message = '.(int)$message['id_message']; + $result = Db::getInstance()->execute($sql); + } + } + } + $nb_loop = $start = 0; + if($count_messages > 0) + $nb_loop = ceil($count_messages / $step); + for($i = 0; $i < $nb_loop; $i++) + { + $sql = 'SELECT id_customer_message, message FROM `'._DB_PREFIX_.'customer_message` WHERE message REGEXP \'query($sql)) + while ($message = Db::getInstance()->nextRow($messages)) + { + if(is_array($message)) + { + $sql = 'UPDATE `'._DB_PREFIX_.'customer_message` SET message = \''.pSQL(Tools::htmlentitiesDecodeUTF8(str_replace('&', '&', $message['message']))).'\' + WHERE id_customer_message = '.(int)$message['id_customer_message']; + Db::getInstance()->execute($sql); + } + } + } +} + +function br2nl($str) +{ + return str_replace(array('
          ', '
          ', '
          '), "\n", $str); +} \ No newline at end of file diff --git a/install-dev/upgrade/php/update_products_ecotax_v133.php b/install-dev/upgrade/php/update_products_ecotax_v133.php index 37999e095..071d9fb88 100644 --- a/install-dev/upgrade/php/update_products_ecotax_v133.php +++ b/install-dev/upgrade/php/update_products_ecotax_v133.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/updateproductcomments.php b/install-dev/upgrade/php/updateproductcomments.php index a3f4dbe6d..d2f25327f 100644 --- a/install-dev/upgrade/php/updateproductcomments.php +++ b/install-dev/upgrade/php/updateproductcomments.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/php/updatetabicon_from_11version.php b/install-dev/upgrade/php/updatetabicon_from_11version.php index c948b46d7..413cf8639 100644 --- a/install-dev/upgrade/php/updatetabicon_from_11version.php +++ b/install-dev/upgrade/php/updatetabicon_from_11version.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ + function updatetabicon_from_11version() { global $oldversion; diff --git a/install-dev/upgrade/php/upgrade_cms_15.php b/install-dev/upgrade/php/upgrade_cms_15.php index 8cdd068da..475ffe994 100644 --- a/install-dev/upgrade/php/upgrade_cms_15.php +++ b/install-dev/upgrade/php/upgrade_cms_15.php @@ -1,7 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ + function upgrade_cms_15() { $res = true; diff --git a/install-dev/upgrade/php/upgrade_cms_15_rename.php b/install-dev/upgrade/php/upgrade_cms_15_rename.php index 414a9258c..3455d9744 100644 --- a/install-dev/upgrade/php/upgrade_cms_15_rename.php +++ b/install-dev/upgrade/php/upgrade_cms_15_rename.php @@ -1,7 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ + function upgrade_cms_15_rename() { $res = true; diff --git a/install-dev/upgrade/sql/1.4.7.0.sql b/install-dev/upgrade/sql/1.4.7.0.sql index f38a89385..3cef2a5c3 100644 --- a/install-dev/upgrade/sql/1.4.7.0.sql +++ b/install-dev/upgrade/sql/1.4.7.0.sql @@ -3,7 +3,7 @@ SET NAMES 'utf8'; /* PHP:category_product_index_unique(); */; CREATE TABLE IF NOT EXISTS `PREFIX_order_tax` ( - `id_order` int(11) NOT NULL, + `id_order` int(10) NOT NULL, `tax_name` varchar(40) NOT NULL, `tax_rate` decimal(6,3) NOT NULL, `amount` decimal(20,6) NOT NULL @@ -12,10 +12,6 @@ CREATE TABLE IF NOT EXISTS `PREFIX_order_tax` ( INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`, `live_edit`) VALUES ('frontCanonicalRedirect', 'Front Canonical Redirect', 'Check for 404 errors before canonical redirects', 0, 0); -SET @id_hook = (SELECT `id_hook` FROM `PREFIX_hook` WHERE `name` = 'frontCanonicalRedirect'); -SET @position = (SELECT IFNULL(MAX(`position`),0)+1 FROM `PREFIX_hook_module` WHERE `id_hook` = @id_hook); -SET @id_module = (SELECT `id_module` FROM `PREFIX_module` WHERE `name` = 'pagesnotfound'); +/* PHP:update_module_pagesnotfound(); */; -INSERT INTO `PREFIX_hook_module` (`id_hook`, `id_module`, `position`) VALUES (@id_hook, @id_module, @position); - -ALTER TABLE `PREFIX_order_state` ADD COLUMN `deleted` tinyint(1) UNSIGNED NOT NULL default '0' AFTER `delivery`; +ALTER TABLE `PREFIX_order_state` ADD COLUMN `deleted` tinyint(1) UNSIGNED NOT NULL default '0' AFTER `delivery`; \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.4.9.1.sql b/install-dev/upgrade/sql/1.4.9.1.sql deleted file mode 100644 index 22c382dd4..000000000 --- a/install-dev/upgrade/sql/1.4.9.1.sql +++ /dev/null @@ -1 +0,0 @@ -SET NAMES 'utf8'; \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.5.0.0.sql b/install-dev/upgrade/sql/1.5.0.0.sql index 9222b64bc..94a1e36d6 100755 --- a/install-dev/upgrade/sql/1.5.0.0.sql +++ b/install-dev/upgrade/sql/1.5.0.0.sql @@ -92,7 +92,6 @@ UPDATE PREFIX_stock_mvt sm SET sm.id_stock = IFNULL(( WHERE s.id_product = sm.id_product AND s.id_product_attribute = sm.id_product_attribute ORDER BY s.id_shop - LIMIT 1 ), 0); DELETE FROM PREFIX_stock_mvt WHERE id_stock = 0; ALTER TABLE PREFIX_stock_mvt DROP id_product, DROP id_product_attribute; @@ -264,7 +263,7 @@ CREATE TABLE `PREFIX_module_shop` ( PRIMARY KEY (`id_module` , `id_shop`), KEY `id_shop` (`id_shop`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; -INSERT INTO `PREFIX_module_shop` (`id_module`, `id_shop`) (SELECT `id_module`, 1 FROM `PREFIX_module`); +INSERT INTO `PREFIX_module_shop` (`id_module`, `id_shop`) (SELECT `id_module`, 1 FROM `PREFIX_module` WHERE active = 1); ALTER TABLE `PREFIX_module_currency` ADD `id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1' AFTER `id_module`; ALTER TABLE `PREFIX_module_currency` DROP PRIMARY KEY; @@ -313,6 +312,6 @@ PRIMARY KEY (`id_scene`, `id_shop`), ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; INSERT INTO `PREFIX_scene_shop` (id_shop, id_scene) (SELECT 1, id_scene FROM PREFIX_scene); -ALTER TABLE `PREFIX_delivery` ADD `id_shop` INT UNSIGNED NULL DEFAULT NULL AFTER `id_delivery`, ADD `id_group_shop` INT UNSIGNED NULL DEFAULT NULL AFTER `id_shop`; - /* PHP:create_multistore(); */; + +UPDATE `PREFIX_customization` INNER JOIN `PREFIX_orders` USING(id_cart) SET in_cart = 1; diff --git a/install-dev/upgrade/sql/1.5.0.1.sql b/install-dev/upgrade/sql/1.5.0.1.sql index 883ce36bd..b5cada9a2 100644 --- a/install-dev/upgrade/sql/1.5.0.1.sql +++ b/install-dev/upgrade/sql/1.5.0.1.sql @@ -1,5 +1,8 @@ SET NAMES 'utf8'; +ALTER TABLE `PREFIX_delivery` ADD `id_shop` INT UNSIGNED NULL DEFAULT NULL AFTER `id_delivery`; +ALTER TABLE `PREFIX_delivery` ADD `id_group_shop` INT UNSIGNED NULL DEFAULT NULL AFTER `id_shop`; + CREATE TABLE IF NOT EXISTS `PREFIX_module_access` ( `id_profile` int(10) unsigned NOT NULL, `id_module` int(10) unsigned NOT NULL, @@ -146,7 +149,7 @@ INSERT INTO `PREFIX_gender_lang` (`id_gender`, `id_lang`, `name`) VALUES (2, 4, 'Frau'), (2, 5, 'Sig.ra'), (3, 1, 'Miss'), -(3, 2, 'Melle'), +(3, 2, 'Mlle'), (3, 3, 'Miss'), (3, 4, 'Miss'), (3, 5, 'Miss'); diff --git a/install-dev/upgrade/sql/1.5.0.13.sql b/install-dev/upgrade/sql/1.5.0.13.sql index 65121283c..c89ae965e 100644 --- a/install-dev/upgrade/sql/1.5.0.13.sql +++ b/install-dev/upgrade/sql/1.5.0.13.sql @@ -23,7 +23,7 @@ INSERT INTO `PREFIX_order_invoice_payment` -- Step 2: Add the collumn id_order_reference ALTER TABLE `PREFIX_order_payment` - ADD COLUMN `order_reference` VARCHAR(9) AFTER `id_order`, + ADD COLUMN `order_reference` VARCHAR(10) AFTER `id_order`, ADD INDEX `order_reference`(`order_reference`); diff --git a/install-dev/upgrade/sql/1.5.0.2.sql b/install-dev/upgrade/sql/1.5.0.2.sql old mode 100644 new mode 100755 index 9c7c239f7..e42871126 --- a/install-dev/upgrade/sql/1.5.0.2.sql +++ b/install-dev/upgrade/sql/1.5.0.2.sql @@ -411,7 +411,7 @@ ALTER TABLE `PREFIX_image_type` ADD `id_theme` INT(11) NOT NULL AFTER `id_image_ ALTER TABLE `PREFIX_image_type` ADD UNIQUE (`id_theme` ,`name`); UPDATE `PREFIX_image_type` SET `id_theme`=1; -CREATE TABLE `PREFIX_webservice_account_shop` ( +CREATE TABLE IF NOT EXISTS `PREFIX_webservice_account_shop` ( `id_webservice_account` INT( 11 ) UNSIGNED NOT NULL, `id_shop` INT( 11 ) UNSIGNED NOT NULL, PRIMARY KEY (`id_webservice_account` , `id_shop`), diff --git a/install-dev/upgrade/sql/1.5.1.0.sql b/install-dev/upgrade/sql/1.5.1.0.sql index 0a8a3abc6..b365cf584 100644 --- a/install-dev/upgrade/sql/1.5.1.0.sql +++ b/install-dev/upgrade/sql/1.5.1.0.sql @@ -1,6 +1,6 @@ SET NAMES 'utf8'; -ALTER TABLE `PREFIX_image_shop` ADD `cover` TINYINT(1) UNSIGNED NOT NULL AFTER `id_shop`; +/* PHP:image_shop1510(); */; ALTER TABLE `PREFIX_image_shop` DROP PRIMARY KEY; ALTER TABLE `PREFIX_image_shop` ADD INDEX (`id_image`, `id_shop`, `cover`); UPDATE `PREFIX_image_shop` image_shop SET image_shop.`cover`=1 WHERE `id_image` IN (SELECT `id_image` FROM `PREFIX_image` i WHERE i.`cover`=1); @@ -16,5 +16,5 @@ ALTER TABLE `PREFIX_order_carrier` CHANGE `weight` `weight` DECIMAL(20, 6) NOT N ALTER TABLE `PREFIX_attribute_impact` CHANGE `weight` `weight` DECIMAL(20, 6) NOT NULL DEFAULT '0'; ALTER TABLE `PREFIX_order_detail` CHANGE `product_weight` `product_weight` DECIMAL(20, 6) NOT NULL DEFAULT '0'; ALTER TABLE `PREFIX_stock_available` DROP INDEX `product_sqlstock`; -ALTER TABLE `PREFIX_stock_available` ADD UNIQUE (`id_product`, `id_product_attribute`, `id_shop`); +ALTER TABLE `PREFIX_stock_available` ADD UNIQUE `product_sqlstock` (`id_product`, `id_product_attribute`, `id_shop`); ALTER TABLE `PREFIX_cms` ADD INDEX (`id_cms_category`); diff --git a/install-dev/upgrade/sql/1.5.2.1.sql b/install-dev/upgrade/sql/1.5.2.1.sql deleted file mode 100644 index 83d45dc16..000000000 --- a/install-dev/upgrade/sql/1.5.2.1.sql +++ /dev/null @@ -1,7 +0,0 @@ -SET NAMES 'utf8'; - -ALTER TABLE `PREFIX_address` CHANGE `outstanding_allow_amount` `outstanding_allow_amount` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000'; - -/* PHP:blocknewsletter1530(); */; - -/* PHP:block_category_1521(); */; \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.5.3.0.sql b/install-dev/upgrade/sql/1.5.3.0.sql new file mode 100644 index 000000000..abc00ff4a --- /dev/null +++ b/install-dev/upgrade/sql/1.5.3.0.sql @@ -0,0 +1,42 @@ +SET NAMES 'utf8'; + +/* PHP:outstanding_allow_amount1530(); */; + +/* PHP:blocknewsletter1530(); */; + +/* PHP:block_category_1521(); */; + +/* PHP:update_order_messages(); */; + +UPDATE `PREFIX_order_state` SET `delivery` = 0 WHERE `id_order_state` = 3; + +ALTER TABLE `PREFIX_product_shop` ADD `id_product_redirected` int(10) unsigned NOT NULL default '0' AFTER `active` ; + +ALTER TABLE `PREFIX_product` ADD `id_product_redirected` int(10) unsigned NOT NULL default '0' AFTER `active` ; + +UPDATE `PREFIX_order_state` SET `send_email` = 1 WHERE `id_order_state` = (SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'PS_OS_WS_PAYMENT' LIMIT 1); + +UPDATE `PREFIX_order_state_lang` SET `template` = 'payment' WHERE `id_order_state` = (SELECT `value` FROM `PREFIX_configuration` WHERE `name` = 'PS_OS_WS_PAYMENT' LIMIT 1); + +DELETE FROM `PREFIX_configuration` WHERE `name`= 'PS_HIGH_HTML_THEME_COMPRESSION'; + +INSERT INTO `PREFIX_configuration`(`name`, `value`, `date_add`, `date_upd`) VALUES ('PS_MAIL_COLOR', '#db3484', NOW(), NOW()); + +ALTER TABLE `PREFIX_order_cart_rule` CHANGE `name` `name` VARCHAR(254); + +ALTER TABLE `PREFIX_cart` CHANGE `delivery_option` `delivery_option` TEXT CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; + +ALTER TABLE `PREFIX_currency_shop` ADD `conversion_rate` DECIMAL( 13, 6 ) NOT NULL; +UPDATE `PREFIX_currency_shop` a SET `conversion_rate` = (SELECT `conversion_rate` FROM `PREFIX_currency` b WHERE a.id_currency = b.id_currency); + +INSERT INTO `PREFIX_configuration`(`name`, `value`, `id_shop`, `id_shop_group`, `date_add`, `date_upd`) + (SELECT 'PS_GIFT_WRAPPING_TAX_RULES_GROUP', b.`id_tax_rules_group`, a.`id_shop`, a.`id_shop_group`, NOW(), NOW() + FROM `PREFIX_configuration` a + JOIN `PREFIX_tax_rule` b ON (a.value = b.id_tax) + WHERE a.name='PS_GIFT_WRAPPING_TAX' + GROUP BY a.`id_shop`, a.`id_shop_group` + ); + +DELETE FROM `PREFIX_configuration` WHERE name='PS_GIFT_WRAPPING_TAX'; + +ALTER TABLE `PREFIX_cart_rule` ADD `highlight` tinyint(1) unsigned NOT NULL default 0 AFTER `gift_product_attribute`; \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.5.3.1.sql b/install-dev/upgrade/sql/1.5.3.1.sql new file mode 100644 index 000000000..381567a73 --- /dev/null +++ b/install-dev/upgrade/sql/1.5.3.1.sql @@ -0,0 +1,5 @@ +SET NAMES 'utf8'; + +/* PHP:p1531_redirect_type(); */; + +ALTER TABLE `PREFIX_cart` CHANGE `delivery_option` `delivery_option` TEXT NOT NULL; diff --git a/install-dev/upgrade/sql/1.5.4.0.sql b/install-dev/upgrade/sql/1.5.4.0.sql new file mode 100644 index 000000000..9f486c66c --- /dev/null +++ b/install-dev/upgrade/sql/1.5.4.0.sql @@ -0,0 +1,55 @@ +SET NAMES 'utf8'; + +/* PHP:update_customer_default_group(); */; + +UPDATE `PREFIX_meta` SET `page` = 'supplier' WHERE `page` = 'supply'; + +ALTER TABLE `PREFIX_image_type` CHANGE `name` `name` VARCHAR( 64 ) NOT NULL; + +ALTER TABLE `PREFIX_customer` ADD `id_lang` INT UNSIGNED NULL AFTER `id_default_group`; +UPDATE `PREFIX_customer` SET id_lang = (SELECT `value` FROM `PREFIX_configuration` WHERE name = 'PS_LANG_DEFAULT' LIMIT 1); +UPDATE `PREFIX_customer` c, `PREFIX_orders` o SET c.id_lang = o.id_lang WHERE c.id_customer = o.id_customer; + +UPDATE `PREFIX_quick_access` SET `link` = 'index.php?controller=AdminCartRules&addcart_rule' WHERE `link` = 'index.php?tab=AdminDiscounts&adddiscount'; + +ALTER TABLE `PREFIX_order_cart_rule` ADD `free_shipping` tinyint(1) NOT NULL DEFAULT 0 AFTER `value_tax_excl`; + +UPDATE `PREFIX_order_cart_rule` ocr, `PREFIX_cart_rule` cr SET ocr.free_shipping = 1 WHERE ocr.id_cart_rule = cr.id_cart_rule AND cr.free_shipping = 1; + +UPDATE `PREFIX_orders` o, `PREFIX_order_cart_rule` ocr SET + o.`total_discounts` = o.total_discounts + o.`total_shipping_tax_incl`, + o.`total_discounts_tax_incl` = o.`total_discounts_tax_incl` + o.`total_shipping_tax_incl`, + o.`total_discounts_tax_excl` = o.`total_discounts_tax_excl` + o.`total_shipping_tax_excl` +WHERE o.id_order = ocr.id_order AND ocr.free_shipping = 1; + +CREATE TABLE `PREFIX_tab_module_preference` ( + `id_tab_module_preference` int(11) NOT NULL auto_increment, + `id_employee` int(11) NOT NULL, + `id_tab` int(11) NOT NULL, + `module` varchar(255) NOT NULL, + PRIMARY KEY (`id_tab_module_preference`), + UNIQUE KEY `employee_module` (`id_employee`, `id_tab`, `module`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8; + +/* PHP:add_new_tab(AdminMarketing, es:Marketing|it:Marketing|en:Marketing|de:Marketing|fr:Marketing, 0, false, AdminPriceRule); */; + +/* PHP:p1540_add_missing_columns(); */; + +ALTER TABLE `PREFIX_stock_available` ADD UNIQUE `product_sqlstock` (`id_product`, `id_product_attribute`, `id_shop`, `id_shop_group`); + +UPDATE PREFIX_configuration SET `value` = '8388608' WHERE `name` = 'PS_PRODUCT_PICTURE_MAX_SIZE' AND `value` <= '524288'; + +ALTER TABLE `PREFIX_guest` ADD `mobile_theme` tinyint(1) NOT NULL DEFAULT 0; +ALTER TABLE `PREFIX_orders` ADD `mobile_theme` tinyint(1) NOT NULL DEFAULT 0 AFTER `gift_message`; +ALTER TABLE `PREFIX_cart` ADD `mobile_theme` tinyint(1) NOT NULL DEFAULT 0 AFTER `gift_message`; + +ALTER TABLE `PREFIX_address` CHANGE `phone` `phone` varchar(32) default NULL; +ALTER TABLE `PREFIX_address` CHANGE `phone_mobile` `phone_mobile` varchar(32) default NULL; + +/* PHP:update_genders_images(); */; + +UPDATE `PREFIX_customer` SET `id_gender` = 1 WHERE `email` LIKE 'pub@prestashop.com' AND `id_customer` = 1 AND `id_gender` = 4; + +UPDATE `PREFIX_cart_rule_carrier` crc INNER JOIN `PREFIX_carrier` c ON crc.`id_carrier` = c.`id_carrier` SET crc.`id_carrier` = c.`id_reference`; + +UPDATE `PREFIX_order_payment` SET `order_reference` = LPAD(order_reference, 9 , '0'); \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.5.4.1.sql b/install-dev/upgrade/sql/1.5.4.1.sql new file mode 100644 index 000000000..4d6f37c0e --- /dev/null +++ b/install-dev/upgrade/sql/1.5.4.1.sql @@ -0,0 +1,11 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_carrier` CHANGE `max_weight` `max_weight` DECIMAL( 20, 6 ) NULL DEFAULT '0'; + +DELETE ms.*, hm.* FROM `PREFIX_module_shop` ms INNER JOIN `PREFIX_hook_module` hm USING (`id_module`) INNER JOIN `PREFIX_module` m USING (`id_module`) WHERE m.`name` LIKE 'backwardcompatibility'; + +UPDATE `PREFIX_module` SET `active` = 0 WHERE `name` LIKE 'backwardcompatibility'; + +ALTER TABLE `PREFIX_orders` CHANGE `reference` `reference` VARCHAR( 10 ) NULL DEFAULT NULL; + +ALTER TABLE `PREFIX_order_payment` CHANGE `order_reference` `order_reference` VARCHAR( 10 ) NULL DEFAULT NULL; \ No newline at end of file diff --git a/install-dev/upgrade/sql/1.5.5.0.sql b/install-dev/upgrade/sql/1.5.5.0.sql new file mode 100644 index 000000000..ab0863e69 --- /dev/null +++ b/install-dev/upgrade/sql/1.5.5.0.sql @@ -0,0 +1,34 @@ +SET NAMES 'utf8'; + +ALTER TABLE `PREFIX_store` CHANGE `latitude` `latitude` DECIMAL( 13, 8 ) NULL DEFAULT NULL , CHANGE `longitude` `longitude` DECIMAL( 13, 8 ) NULL DEFAULT NULL ; + +INSERT INTO `PREFIX_configuration` (`name`, `value`, `date_add`, `date_upd`) VALUES('PS_CUSTOMER_CREATION_EMAIL', 1, NOW(), NOW()); + +ALTER TABLE `PREFIX_webservice_account` CHANGE `class_name` `class_name` VARCHAR(64) NOT NULL DEFAULT 'WebserviceRequest', +CHANGE `module_name` `module_name` VARCHAR(64) NULL DEFAULT NULL; + +/* PHP:add_module_to_hook(blockcart, actionCartListOverride); */; +/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerDeleteAfter); */; +/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerAddAfter); */; +/* PHP:add_module_to_hook(blockmanufacturer, actionObjectManufacturerUpdateAfter); */; +/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierDeleteAfter); */; +/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierAddAfter); */; +/* PHP:add_module_to_hook(blocksupplier, actionObjectSupplierUpdateAfter); */; +/* PHP:fix_download_product_feature_active(); */; +/* PHP:add_module_to_hook(blockmyaccount, actionModuleRegisterHookAfter); */; +/* PHP:add_module_to_hook(blockmyaccountfooter, actionModuleRegisterHookAfter); */; +/* PHP:add_module_to_hook(blockmyaccount, actionModuleUnRegisterHookAfter); */; +/* PHP:add_module_to_hook(blockmyaccountfooter, actionModuleUnRegisterHookAfter); */; +/* PHP:remove_tab(AdminRangePrice); */; +/* PHP:remove_tab(AdminRangeWeight); */; + +ALTER TABLE `PREFIX_log` ADD `id_employee` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `object_id`; + +SET @id_parent = (SELECT IFNULL(id_tab, 1) FROM `PREFIX_tab` WHERE `class_name` = 'AdminPriceRule' LIMIT 1); +UPDATE `PREFIX_tab` SET id_parent = @id_parent WHERE `id_parent` = 1 AND `class_name` = 'AdminMarketing' LIMIT 1; + +UPDATE `PREFIX_hook` SET `description` = 'This hook is called when a new credit slip is added regarding client order' WHERE `name` = 'actionOrderSlipAdd'; + +ALTER TABLE `PREFIX_product_shop` DROP INDEX `date_add`, ADD INDEX `date_add` (`date_add` , `active` , `visibility`); + +UPDATE `PREFIX_hook` SET `live_edit` = '1' WHERE `name` LIKE 'leftcolumn'; diff --git a/install-dev/upgrade/sql/index.php b/install-dev/upgrade/sql/index.php index ec45b2dfe..f42f03e4d 100644 --- a/install-dev/upgrade/sql/index.php +++ b/install-dev/upgrade/sql/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/install-dev/upgrade/upgrade.php b/install-dev/upgrade/upgrade.php index 0e21b769e..b51c04d4e 100644 --- a/install-dev/upgrade/upgrade.php +++ b/install-dev/upgrade/upgrade.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,8 +34,8 @@ $engineType = 'ENGINE_TYPE'; // setting the memory limit to 128M only if current is lower $memory_limit = ini_get('memory_limit'); if (substr($memory_limit,-1) != 'G' - AND ((substr($memory_limit,-1) == 'M' AND substr($memory_limit,0,-1) < 128) - OR is_numeric($memory_limit) AND (intval($memory_limit) < 131072)) + AND ((substr($memory_limit,-1) == 'M' AND substr($memory_limit,0, -1) < 128) + OR is_numeric($memory_limit) AND (intval($memory_limit) < 131072) AND $memory_limit > 0) ) @ini_set('memory_limit','128M'); @@ -66,7 +66,7 @@ else // need for upgrade before 1.5 if (!defined('__PS_BASE_URI__')) - define('__PS_BASE_URI__', str_replace('//', '/', '/'.trim(preg_replace('#/(install(-dev)?)$#', '/', str_replace('\\', '/', dirname($_SERVER['REQUEST_URI']))), '/').'/')); + define('__PS_BASE_URI__', str_replace('//', '/', '/'.trim(preg_replace('#/(install(-dev)?/upgrade)$#', '/', str_replace('\\', '/', dirname($_SERVER['REQUEST_URI']))), '/').'/')); // need for upgrade before 1.5 if (!defined('_THEME_NAME_')) @@ -246,6 +246,28 @@ if(!defined('_PS_CACHE_ENABLED_')) define('_PS_CACHE_ENABLED_', '0'); if(!defined('_MYSQL_ENGINE_')) define('_MYSQL_ENGINE_', 'MyISAM'); + +global $smarty; +// Clean all cache values +Cache::clean('*'); + +Context::getContext()->shop = new Shop(1); +Shop::setContext(Shop::CONTEXT_SHOP, 1); +Configuration::loadConfiguration(); +if (!isset(Context::getContext()->language) || !Validate::isLoadedObject(Context::getContext()->language)) + if ($id_lang = (int)Configuration::get('PS_LANG_DEFAULT')) + Context::getContext()->language = new Language($id_lang); +if (!isset(Context::getContext()->country) || !Validate::isLoadedObject(Context::getContext()->country)) + if ($id_country = (int)Configuration::get('PS_COUNTRY_DEFAULT')) + Context::getContext()->country = new Country((int)$id_country); + +Context::getContext()->cart = new Cart(); +Context::getContext()->employee = new Employee(1); +if (!defined('_PS_SMARTY_FAST_LOAD_')) + define('_PS_SMARTY_FAST_LOAD_', true); +require_once _PS_ROOT_DIR_.'/config/smarty.config.inc.php'; + +Context::getContext()->smarty = $smarty; if(isset($_GET['customModule']) AND $_GET['customModule'] == 'desactivate') { diff --git a/js/admin-categories-tree.js b/js/admin-categories-tree.js index 32c17801b..f70f36c3a 100755 --- a/js/admin-categories-tree.js +++ b/js/admin-categories-tree.js @@ -1,5 +1,5 @@ /* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/admin-dnd.js b/js/admin-dnd.js index 18c15e000..1c26e4414 100644 --- a/js/admin-dnd.js +++ b/js/admin-dnd.js @@ -1,5 +1,5 @@ /* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -27,6 +27,16 @@ $(document).ready(function() { initTableDnD(); }); +function objToString(obj) { + var str = ''; + for (var p in obj) { + if (obj.hasOwnProperty(p)) { + str += p + '=' + obj[p] + '&'; + } + } + return str; +} + function initTableDnD(table) { if (typeof(table) == 'undefined') @@ -119,9 +129,10 @@ function initTableDnD(table) $.ajax({ type: 'POST', + headers: { "cache-control": "no-cache" }, async: false, - url: currentIndex + '&token=' + token + '&' + $.tableDnD.serialize(), - data: params, + url: currentIndex + '&token=' + token + '&' + 'rand=' + new Date().getTime(), + data: $.tableDnD.serialize() + '&' + objToString(params) , success: function(data) { var nodrag_lines = $(tableDrag).find('tr:not(".nodrag")'); diff --git a/js/admin-products.js b/js/admin-products.js index 5701cc586..58293a1d9 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -17,7 +17,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -63,9 +63,9 @@ product_tabs['Combinations'] = new function(){ self.removeButtonCombination('update'); $.scrollTo('#add_new_combination', 1200, { offset: -100 }); var wholesale_price = Math.abs(data[0]['wholesale_price']); - var price = Math.abs(data[0]['price']); - var weight = Math.abs(data[0]['weight']); - var unit_impact = Math.abs(data[0]['unit_price_impact']); + var price = data[0]['price']; + var weight = data[0]['weight']; + var unit_impact = data[0]['unit_price_impact']; var reference = data[0]['reference']; var ean = data[0]['ean13']; var quantity = data[0]['quantity']; @@ -763,9 +763,8 @@ product_tabs['Attachments'] = new function(){ product_tabs['Informations'] = new function(){ var self = this; this.bindAvailableForOrder = function (){ - $("#available_for_order").click(function(){ - - + $("#available_for_order").click(function() + { if ($(this).is(':checked') || ($('input[name=\'multishop_check[show_price]\']').lenght && !$('input[name=\'multishop_check[show_price]\']').prop('checked'))) { $('#show_price').attr('checked', true); @@ -776,6 +775,37 @@ product_tabs['Informations'] = new function(){ $('#show_price').attr('disabled', false); } }); + + if ($('#active_on').prop('checked')) + { + showRedirectProductOptions(false); + showRedirectProductSelectOptions(false); + } + else + showRedirectProductOptions(true); + + $('#redirect_type').change(function () { + redirectSelectChange(); + }); + + $('#related_product_autocomplete_input') + .autocomplete('ajax_products_list.php?excludeIds='+id_product, { + minChars: 1, + autoFill: true, + max:20, + matchContains: true, + mustMatch:true, + scroll:false, + cacheLength:0, + formatItem: function(item) { + return item[0]+' - '+item[1]; + } + }).result(function(e, i){ + if(i != undefined) + addRelatedProduct(i[1], i[0]); + $(this).val(''); + }); + addRelatedProduct(id_product_redirected, product_name_redirected); }; this.bindTagImage = function (){ @@ -961,7 +991,8 @@ product_tabs['Pack'] = new function(){ }, extraParams: { excludeIds : getSelectedIds(), - excludeVirtuals : 1 + excludeVirtuals : 1, + exclude_packs: 1 } }).result(function(event, item){ $('#curPackItemId').val(item[1]); @@ -1196,6 +1227,8 @@ product_tabs['Quantities'] = new function(){ self.refreshQtyAvailabilityForm(); self.ajaxCall({actionQty: 'out_of_stock', value: $(this).val()}); }); + if (display_multishop_checkboxes) + ProductMultishop.checkAllQuantities(); self.refreshQtyAvailabilityForm(); }; @@ -1205,7 +1238,7 @@ product_tabs['Suppliers'] = new function(){ var self = this; this.manageDefaultSupplier = function() { - var default_is_ok = false; + var default_is_set = false; var availables_radio_buttons = []; var radio_buttons = $('input[name="default_supplier"]'); @@ -1218,27 +1251,25 @@ product_tabs['Suppliers'] = new function(){ if (item.is(':checked')) { item.removeAttr("checked"); - default_is_ok = false; } } - else + + if (item.is(':checked')) { - availables_radio_buttons.push(item); + default_is_set = true; } } - if (default_is_ok == false) + if (!default_is_set) { - for (i=0; i -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/admin-translations.js b/js/admin-translations.js index eeea52702..fd2a4a574 100644 --- a/js/admin-translations.js +++ b/js/admin-translations.js @@ -17,7 +17,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/admin.js b/js/admin.js index e6f85de01..eeb866364 100644 --- a/js/admin.js +++ b/js/admin.js @@ -17,7 +17,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -27,16 +27,67 @@ var ajax_running_timeout = null; if (!id_language) var id_language = Number(1); -function str2url(str,encoding,ucfirst) +function str2url(str, encoding, ucfirst) { str = str.toUpperCase(); str = str.toLowerCase(); if (PS_ALLOW_ACCENTED_CHARS_URL) str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]\\u00A1-\\uFFFF/g,''); - else + else + { + /* Lowercase */ + str = str.replace(/[\u00E0\u00E1\u00E2\u00E3\u00E4\u00E5\u0101\u0103\u0105]/g, 'a'); + str = str.replace(/[\u00E7\u0107\u0109\u010D]/g, 'c'); + str = str.replace(/[\u010F\u0111]/g, 'd'); + str = str.replace(/[\u00E8\u00E9\u00EA\u00EB\u0113\u0115\u0117\u0119\u011B]/g, 'e'); + str = str.replace(/[\u011F\u0121\u0123]/g, 'g'); + str = str.replace(/[\u0125\u0127]/g, 'h'); + str = str.replace(/[\u00EC\u00ED\u00EE\u00EF\u0129\u012B\u012D\u012F\u0131]/g, 'i'); + str = str.replace(/[\u0135]/g, 'j'); + str = str.replace(/[\u0137\u0138]/g, 'k'); + str = str.replace(/[\u013A\u013C\u013E\u0140\u0142]/g, 'l'); + str = str.replace(/[\u00F1\u0144\u0146\u0148\u0149\u014B]/g, 'n'); + str = str.replace(/[\u00F2\u00F3\u00F4\u00F5\u00F6\u00F8\u014D\u014F\u0151]/g, 'o'); + str = str.replace(/[\u0155\u0157\u0159]/g, 'r'); + str = str.replace(/[\u015B\u015D\u015F\u0161]/g, 's'); + str = str.replace(/[\u00DF]/g, 'ss'); + str = str.replace(/[\u0163\u0165\u0167]/g, 't'); + str = str.replace(/[\u00F9\u00FA\u00FB\u00FC\u0169\u016B\u016D\u016F\u0171\u0173]/g, 'u'); + str = str.replace(/[\u0175]/g, 'w'); + str = str.replace(/[\u00FF\u0177\u00FD]/g, 'y'); + str = str.replace(/[\u017A\u017C\u017E]/g, 'z'); + str = str.replace(/[\u00E6]/g, 'ae'); + str = str.replace(/[\u0153]/g, 'oe'); + + /* Uppercase */ + str = str.replace(/[\u0100\u0102\u0104\u00C0\u00C1\u00C2\u00C3\u00C4\u00C5]/g, 'A'); + str = str.replace(/[\u00C7\u0106\u0108\u010A\u010C]/g, 'C'); + str = str.replace(/[\u010E\u0110]/g, 'D'); + str = str.replace(/[\u00C8\u00C9\u00CA\u00CB\u0112\u0114\u0116\u0118\u011A]/g, 'E'); + str = str.replace(/[\u011C\u011E\u0120\u0122]/g, 'G'); + str = str.replace(/[\u0124\u0126]/g, 'H'); + str = str.replace(/[\u0128\u012A\u012C\u012E\u0130]/g, 'I'); + str = str.replace(/[\u0134]/g, 'J'); + str = str.replace(/[\u0136]/g, 'K'); + str = str.replace(/[\u0139\u013B\u013D\u0139\u0141]/g, 'L'); + str = str.replace(/[\u00D1\u0143\u0145\u0147\u014A]/g, 'N'); + str = str.replace(/[\u00D3\u014C\u014E\u0150]/g, 'O'); + str = str.replace(/[\u0154\u0156\u0158]/g, 'R'); + str = str.replace(/[\u015A\u015C\u015E\u0160]/g, 'S'); + str = str.replace(/[\u0162\u0164\u0166]/g, 'T'); + str = str.replace(/[\u00D9\u00DA\u00DB\u00DC\u0168\u016A\u016C\u016E\u0170\u0172]/g, 'U'); + str = str.replace(/[\u0174]/g, 'W'); + str = str.replace(/[\u0176]/g, 'Y'); + str = str.replace(/[\u0179\u017B\u017D]/g, 'Z'); + str = str.replace(/[\u00C6]/g, 'AE'); + str = str.replace(/[\u0152]/g, 'OE'); + + str = str.toLowerCase(); + str = str.replace(/[^a-z0-9\s\'\:\/\[\]-]/g,''); - str = str.replace(/[\u0028\u0029\u0021\u003F\u002E\u0026\u005E\u007E\u002B\u002A\u002F\u003A\u003B\u003C\u003D\u003E]/g,''); - str = str.replace(/[\s\'\:\/\[\]-]+/g,' '); + } + str = str.replace(/[\u0028\u0029\u0021\u003F\u002E\u0026\u005E\u007E\u002B\u002A\u002F\u003A\u003B\u003C\u003D\u003E]/g, ''); + str = str.replace(/[\s\'\:\/\[\]-]+/g, ' '); // Add special char not used for url rewrite str = str.replace(/[ ]/g, '-'); @@ -52,7 +103,10 @@ function str2url(str,encoding,ucfirst) function copy2friendlyURL() { - if (!$('#link_rewrite_' + id_language).val().length)//check if user didn't type anything in rewrite field, to prevent overwriting + if (typeof(id_product) == 'undefined') + id_product = false; + + if (!$('#link_rewrite_' + id_language).val().length || !id_product)//check if user didn't type anything in rewrite field, to prevent overwriting { $('#link_rewrite_' + id_language).val(str2url($('#name_' + id_language).val().replace(/^[0-9]+\./, ''), 'UTF-8').replace('%', '')); if ($('#friendly-url')) @@ -153,11 +207,11 @@ function displayFlags(languages, defaultLanguageID, employee_cookie) ); var languagesFlags = $('
          ') .addClass('language_flags') - .html('Choose language:

          '); + .html(choose_language_translate+':

          '); $.each(languages, function(key, language) { var img = $('') .addClass('pointer') - .css('margin', '0 2px') + .css('margin', '2px 2px') .attr('src', '../img/l/' + language['id_lang'] + '.jpg') .attr('alt', language['name']) .click(function() { @@ -552,6 +606,14 @@ function disableZipFormat() $('.zip_code_format').show(); } +function disableTAASC() +{ + if ($('#iso_code').val() == 'US') + $('#TAASC').show(); + else + $('#TAASC').hide(); +} + function spreadFees(id_range) { newVal = $('#fees_all_'+id_range).val().replace(/,/g, '.'); @@ -571,6 +633,56 @@ function toggleDraftWarning(show) $('.draft').show(); } +function showRedirectProductOptions(show) +{ + if (show) + $('.redirect_product_options').fadeIn(); + else + $('.redirect_product_options').fadeOut(); + + redirectSelectChange(); +} + +function redirectSelectChange() +{ + if ($('#redirect_type :selected').val() == '404') + showRedirectProductSelectOptions(false); + else + showRedirectProductSelectOptions(true); +} + +function addRelatedProduct(id_product_to_add, product_name) +{ + if (!id_product_to_add || id_product == id_product_to_add) + return; + $('#related_product_name').html(product_name); + $('#related_product_name').parent('p').css('margin-top', 0); + $('input[name=id_product_redirected]').val(id_product_to_add); + $('#related_product_autocomplete_input').hide(); + $('#related_product_remove').show(); +} + +function removeRelatedProduct() +{ + $('#related_product_name').html(no_related_product); + $('#related_product_name').parent('p').css('margin-top', '0.5em'); + $('input[name=id_product_redirected]').val(0); + $('#related_product_remove').hide(); + $('#related_product_autocomplete_input').fadeIn(); +} + +function showRedirectProductSelectOptions(show) +{ + if (show) + $('.redirect_product_options_product_choise').show(); + else + { + $('.redirect_product_options_product_choise').hide(); + removeRelatedProduct(); + } + +} + function showOptions(show) { if (show) @@ -666,6 +778,7 @@ function showErrorMessage(msg, delay) $(document).ready(function() { $('select.chosen').each(function(k, item){ + $(item).val($(this).find('option[selected=selected]').val()); $(item).chosen(); if ($(item).hasClass('no-search')) $(item).next().find('.chzn-search').hide(); @@ -734,8 +847,31 @@ $(document).ready(function() $(this).slideUp('fast'); clearTimeout(ajax_running_timeout); }); + + bindTabModuleListAction(); + }); + +function bindTabModuleListAction() +{ + $('.action_tab_module').each( function (){ + $(this).click(function () { + option = $('#'+$(this).data('option')+' :selected'); + if ($(option).data('onclick') != '') + { + + var f = eval("(function(){ "+$(option).data('onclick')+"})"); + if (f.call()) + window.location.href = $(option).data('href'); + } + else + window.location.href = $(option).data('href'); + return false; + }); + }); +} + // Delete all tags HTML function stripHTML(oldString) { @@ -771,7 +907,8 @@ function showAjaxOverlay() clearTimeout(ajax_running_timeout); } -function display_action_details(row_id, controller, token, action, params) { +function display_action_details(row_id, controller, token, action, params) +{ var id = action+'_'+row_id; var current_element = $('#details_'+id); if (!current_element.data('dataMaped')) { @@ -879,3 +1016,14 @@ function display_action_details(row_id, controller, token, action, params) { current_element.data('opened', true); } } + +function quickSelect(elt) +{ + var eltVal = $(elt).val(); + if (eltVal == "0") + return false; + else if (eltVal.substr(eltVal.length - 6) == '_blank') + window.open(eltVal.substr(0, eltVal.length - 6), '_blank'); + else + location.href = eltVal; +} diff --git a/js/adminImport.js b/js/adminImport.js index 1dc39e913..3fcf221d5 100644 --- a/js/adminImport.js +++ b/js/adminImport.js @@ -1,5 +1,5 @@ /* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/js/admin_carrier_wizard.js b/js/admin_carrier_wizard.js new file mode 100644 index 000000000..fc3776626 --- /dev/null +++ b/js/admin_carrier_wizard.js @@ -0,0 +1,416 @@ +/* +* 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 +* @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 +*/ + + +$(document).ready(function() { + bind_inputs(); + initCarrierWizard(); +}); + +function initCarrierWizard() +{ + $("#carrier_wizard").smartWizard({ + 'labelNext' : labelNext, + 'labelPrevious' : labelPrevious, + 'labelFinish' : labelFinish, + 'fixHeight' : 1, + 'onShowStep' : onShowStepCallback, + 'onLeaveStep' : onLeaveStepCallback, + 'onFinish' : onFinishCallback, + 'transitionEffect' : 'slideleft', + 'enableAllSteps' : enableAllSteps + }); + displayRangeType(); +} + +function displayRangeType() +{ + if ($('input[name="shipping_method"]:checked').val() == 1) + string = string_weight; + else + string = string_price; + + $('.range_type').html(string); +} + +function onShowStepCallback() +{ + $('.anchor li a').each( function () { + $(this).parent('li').addClass($(this).attr('class')); + }); + $('#carrier_logo_block').prependTo($('div.content').filter(function() { return $(this).css('display') != 'none' }).children('.defaultForm').children('fieldset')); + resizeWizard(); +} + +function onFinishCallback(obj, context) +{ + $('.wizard_error').remove(); + $.ajax({ + type:"POST", + url : validate_url, + async: false, + dataType: 'json', + data : $('#carrier_wizard .stepContainer .content form').serialize() + '&action=finish_step&ajax=1', + success : function(data) { + if (data.has_error) + { + displayError(data.errors, context.fromStep); + resizeWizard(); + } + else + window.location.href = carrierlist_url; + } + }); +} + +function onLeaveStepCallback(obj, context) +{ + if (context.toStep == nbr_steps) + displaySummary(); + + return validateSteps(context.fromStep); // return false to stay on step and true to continue navigation +} + +function displaySummary() +{ + // used as buffer - you must not replace directly in the translation vars + var tmp; + + // Carrier name + $('#summary_name').html($('#name').val()); + + // Delay and pricing + tmp = summary_translation_meta_informations.replace('@s2', '' + $('#delay_1').val() + ''); + if ($('#is_free_on').attr('checked')) + tmp = tmp.replace('@s1', summary_translation_free); + else + tmp = tmp.replace('@s1', summary_translation_paid); + $('#summary_meta_informations').html(tmp); + + // Tax and calculation mode for the shipping cost + tmp = summary_translation_shipping_cost.replace('@s2', '' + $('#id_tax_rules_group option:selected').text() + ''); + if ($('#billing_price').attr('checked')) + tmp = tmp.replace('@s1', summary_translation_price); + else if ($('#billing_weight').attr('checked')) + tmp = tmp.replace('@s1', summary_translation_weight); + else + tmp = tmp.replace('@s1', '' + summary_translation_undefined + ''); + $('#summary_shipping_cost').html(tmp); + + // Weight or price ranges + $('#summary_range').html(summary_translation_range); + var range_inf = summary_translation_undefined; + var range_sup = summary_translation_undefined; + $('input[name$="range_inf[]"]').each(function(){ + if (!isNaN(parseFloat($(this).val())) && (range_inf == summary_translation_undefined || range_inf < $(this).val())) + range_inf = $(this).val(); + }); + $('input[name$="range_sup[]"]').each(function(){ + if (!isNaN(parseFloat($(this).val())) && (range_sup == summary_translation_undefined || range_sup > $(this).val())) + range_sup = $(this).val(); + }); + $('#summary_range').html( + $('#summary_range').html() + .replace('@s1', '' + range_inf + '') + .replace('@s2', '' + range_sup + '') + .replace('@s3', '' + $('#range_behavior option:selected').text().toLowerCase() + '') + ); + + // Delivery zones + $('#summary_zones').html(''); + $('.input_zone').each(function(){ + if ($(this).attr('checked')) + $('#summary_zones').html($('#summary_zones').html() + '
        • ' + $(this).parent().prev().text() + '
        • '); + }); + + // Group restrictions + $('#summary_groups').html(''); + $('input[name$="groupBox[]"]').each(function(){ + if ($(this).attr('checked')) + $('#summary_groups').html($('#summary_groups').html() + '
        • ' + $(this).parent().next().next().text() + '
        • '); + }); + + // shop restrictions + $('#summary_shops').html(''); + $('.input_shop').each(function(){ + if ($(this).attr('checked')) + $('#summary_shops').html($('#summary_shops').html() + '
        • ' + $(this).parent().text() + '
        • '); + }); +} + +function validateSteps(step_number) +{ + $('.wizard_error').remove(); + var is_ok = true; + form = $('#carrier_wizard #step-'+step_number+' form'); + $.ajax({ + type:"POST", + url : validate_url, + async: false, + dataType: 'json', + data : form.serialize()+'&step_number='+step_number+'&action=validate_step&ajax=1', + success : function(datas) + { + if (datas.has_error) + { + is_ok = false; + + $('input').focus( function () { + $(this).removeClass('field_error'); + }); + displayError(datas.errors, step_number); + resizeWizard(); + } + } + }); + return is_ok; +} + +function displayError(errors, step_number) +{ + $('.wizard_error').remove(); + str_error = '
          X
            '; + for (var error in errors) + { + $('#carrier_wizard').smartWizard('setError',{stepnum:step_number,iserror:true}); + $('input[name="'+error+'"]').addClass('field_error'); + str_error += '
          • '+errors[error]+'
          • '; + } + $('#step-'+step_number).prepend(str_error+'
          '); +} + +function resizeWizard() +{ + resizeInterval = setInterval(function (){$("#carrier_wizard").smartWizard('fixHeight'); clearInterval(resizeInterval)}, 100); +} + +function bind_inputs() +{ + $('tr.delete_range td button').off('click').on('click', function () { + index = $(this).parent('td').index(); + $('tr.range_sup td:eq('+index+'), tr.range_inf td:eq('+index+'), tr.fees_all td:eq('+index+'), tr.delete_range td:eq('+index+')').remove(); + $('tr.fees').each( function () { + $(this).children('td:eq('+index+')').remove(); + }); + return false; + }); + + $('tr.fees_all td button').off('click').on('click', function () { + index = $(this).parent('td').index(); + if (validateRange(index)) + enableRange(index); + else + disableRange(index); + return false; + }); + + $('tr.fees td input:checkbox').off('change').on('change', function () { + + if($(this).is(':checked')) + { + $(this).closest('tr').children('td').each( function (){ + index = $(this).index(); + if ($('tr.fees_all td:eq('+index+')').hasClass('validated')) + $(this).children('input:text').removeAttr('disabled'); + }); + } + else + $(this).closest('tr').children('td').children('input:text').attr('disabled', 'disabled'); + return false; + }); + + $('tr.range_sup td input:text, tr.range_inf td input:text').focus( function () { + $(this).removeClass('field_error'); + }); + + $('tr.range_sup td input:text, tr.range_inf td input:text').off('change').on('change', function () { + index = $(this).parent('td').index(); + + if ($('tr.fees_all td:eq('+index+')').hasClass('validated') || $('tr.fees_all td:eq('+index+')').hasClass('not_validated')) + { + if (validateRange(index)) + enableRange(index); + else + disableRange(index); + } + }); + + $('tr.fees_all td input').off('change').on('change', function () { + index = $(this).parent('td').index(); + val = $(this).val(); + $('tr.fees td input:text').not('disabled').val(val); + + return false; + }); + + $('input[name="is_free"]').on('click', function() { + var is_free = $(this); + $("#step_carrier_ranges .margin-form").each(function() { + var field = $(this).children().attr('name'); + if (typeof(field) != 'undefined' && field != 'is_free') + { + if (parseInt(is_free.val())) + { + $(this).hide(); + $(this).prev().hide(); + } + else + { + $(this).show(); + $(this).prev().show(); + } + } + }); + if (parseInt(is_free.val())) + { + $('#zones_table').hide(); + $('.new_range').hide(); + } + else + { + $('#zones_table').show(); + $('.new_range').show(); + } + }); + $('input[name="is_free"]:checked').click(); + + $('input[name="shipping_method"]').on('click', function() { + $.ajax({ + type:"POST", + url : validate_url, + async: false, + dataType: 'html', + data : 'id_carrier='+parseInt($('#id_carrier').val())+'&shipping_method='+parseInt($(this).val())+'&action=changeRanges&ajax=1', + success : function(data) { + $('#zone_ranges').replaceWith(data); + displayRangeType(); + } + }); + }); +} + +function validateRange(index) +{ + //reset error css + $('tr.range_sup td input:text').removeClass('field_error'); + $('tr.range_inf td input:text').removeClass('field_error'); + + is_ok = true; + range_sup = parseInt($('tr.range_sup td:eq('+index+')').children('input:text').val().trim()); + range_inf = parseInt($('tr.range_inf td:eq('+index+')').children('input:text').val().trim()); + + if (isNaN(range_sup) || range_sup.length === 0) + { + $('tr.range_sup td:eq('+index+')').children('input:text').addClass('field_error'); + is_ok = false; + } + + if (isNaN(range_inf) || range_inf.length === 0) + { + $('tr.range_inf td:eq('+index+')').children('input:text').addClass('field_error'); + is_ok = false; + } + + if (is_ok) + { + if (range_inf >= range_sup) + { + $('tr.range_sup td:eq('+index+')').children('input:text').addClass('field_error'); + $('tr.range_inf td:eq('+index+')').children('input:text').addClass('field_error'); + is_ok = false; + } + //check if previous range is inf only if it's not the first range + if (index > 2) + { + previous_range_sup = parseInt($('tr.range_sup td:eq('+(index -1)+')').children('input:text').val().trim()); + if (range_inf < previous_range_sup) + { + $('tr.range_inf td:eq('+index+')').children('input:text').addClass('field_error'); + } + } + //check if next range is sup only if it's not the last range + if ($('tr.range_inf td:eq('+(index + 1)+')').length) + { + next_range_inf = parseInt($('tr.range_inf td:eq('+(index +1)+')').children('input:text').val().trim()); + + if ((isNaN(range_sup) || range_sup.length === 0) && range_sup > next_range_inf) + { + $('tr.range_sup td:eq('+index+')').children('input:text').addClass('field_error'); + } + } + + } + return is_ok; +} + +function enableRange(index) +{ + $('tr.fees').each( function () { + //only enable fees for enabled zones + if ($(this).children('td').children('input:checkbox').attr('checked') == 'checked') + $(this).children('td:eq('+index+')').children('input').removeAttr('disabled'); + }); + $('span.fees_all').show(); + $('tr.fees_all td:eq('+index+')').children('input').show().removeAttr('disabled'); + $('tr.fees_all td:eq('+index+')').addClass('validated').removeClass('not_validated'); + $('tr.fees_all td:eq('+index+')').children('button').remove(); +} + +function disableRange(index) +{ + $('tr.fees').each( function () { + //only enable fees for enabled zones + if ($(this).children('td').children('input:checkbox').attr('checked') == 'checked') + $(this).children('td:eq('+index+')').children('input').attr('disabled', 'disabled'); + }); + $('tr.fees_all td:eq('+index+')').children('input').attr('disabled', 'disabled'); + $('tr.fees_all td:eq('+index+')').removeClass('validated').addClass('not_validated'); +} + +function add_new_range() +{ + //add new rand sup input + $('tr.range_sup td:last').after('
        ').addClass(this._triggerClass).html(f==""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker(): -d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a,c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a, -b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b),true);this._updateDatepicker(b);this._updateAlternate(b);b.settings.disabled&&this._disableDatepicker(a);b.dpDiv.css("display","block")}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+= -1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}H(a.settings,e||{});b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/ -2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b= -d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e= -a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().removeClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a, -"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span"){b=b.children("."+this._inlineClass);b.children().addClass("ui-state-disabled");b.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=d.map(this._disabledInputs,function(f){return f== -a?null:f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true},_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input", -a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);if(d.datepicker._curInst&&d.datepicker._curInst!=b){d.datepicker._datepickerShowing&&d.datepicker._triggerOnClose(d.datepicker._curInst);d.datepicker._curInst.dpDiv.stop(true,true)}var c=d.datepicker._get(b,"beforeShow");c=c?c.apply(a,[a,b]):{};if(c!==false){H(b.settings,c);b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value= -"";if(!d.datepicker._pos){d.datepicker._pos=d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b); -c=d.datepicker._checkOffset(b,c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.datepicker._datepickerShowing= -true;d.effects&&d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}}},_updateDatepicker:function(a){this.maxRows=4;var b=d.datepicker._getBorders(a.dpDiv);J=a;a.dpDiv.empty().append(this._generateHTML(a));var c=a.dpDiv.find("iframe.ui-datepicker-cover");c.length&&c.css({left:-b[0],top:-b[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()}); -a.dpDiv.find("."+this._dayOverClass+" a").mouseover();b=this._getNumberOfMonths(a);c=b[1];a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");c>1&&a.dpDiv.addClass("ui-datepicker-multi-"+c).css("width",17*c+"em");a.dpDiv[(b[0]!=1||b[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&& -!a.input.is(":disabled")&&a.input[0]!=document.activeElement&&a.input.focus();if(a.yearshtml){var e=a.yearshtml;setTimeout(function(){e===a.yearshtml&&a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);e=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]},_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(), -h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e-g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b= -this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1||d.expr.filters.hidden(a));)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_triggerOnClose:function(a){var b=this._get(a,"onClose");if(b)b.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a])},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b); -this._curInst=null};d.effects&&d.effects[a]?b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();d.datepicker._triggerOnClose(b);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, -_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): -0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e["selected"+(c=="M"? -"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay=d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a); -this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a);else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField"); -if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b=a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"? -b.toString():b+"";if(b=="")return null;var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff;e=typeof e!="string"?e:(new Date).getFullYear()%100+parseInt(e,10);for(var f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames,j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=A+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}v=this._daylightSavingAdjust(new Date(c,j-1,l));if(v.getFullYear()!=c||v.getMonth()+1!=j||v.getDate()!=l)throw"Invalid date";return v},ATOM:"yy-mm-dd", -COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames: -null)||this._defaults.monthNames;var i=function(o){(o=k+1 -12?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay=a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&& -a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(),b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay? -new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n=this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a)); -n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var s=this._get(a,"nextText");s=!h?s:this.formatDate(s,this._daylightSavingAdjust(new Date(m, -g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+s+"":f?"":''+s+"";j=this._get(a,"currentText");s=this._get(a,"gotoCurrent")&& -a.currentDay?u:b;j=!h?j:this.formatDate(j,s,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
        '+(c?h:"")+(this._isInRange(a,s)?'":"")+(c?"":h)+"
        ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");s=this._get(a,"dayNames");this._get(a,"dayNamesShort");var q=this._get(a,"dayNamesMin"),A=this._get(a,"monthNames"),v=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),D=this._get(a,"showOtherMonths"),K=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var E=this._getDefaultDate(a),w="",x=0;x1)switch(G){case 0:y+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]-1:y+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:y+=" ui-datepicker-group-middle";t="";break}y+='">'}y+='
        '+(/all|left/.test(t)&& -x==0?c?f:n:"")+(/all|right/.test(t)&&x==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,x>0||G>0,A,v)+'
        ';var z=j?'":"";for(t=0;t<7;t++){var r=(t+h)%7;z+="=5?' class="ui-datepicker-week-end"':"")+'>'+q[r]+""}y+=z+"";z=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay, -z);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;z=Math.ceil((t+z)/7);this.maxRows=z=l?this.maxRows>z?this.maxRows:z:z;r=this._daylightSavingAdjust(new Date(m,g,1-t));for(var Q=0;Q";var R=!j?"":'";for(t=0;t<7;t++){var I=p?p.apply(a.input?a.input[0]:null,[r]):[true,""],F=r.getMonth()!=g,L=F&&!K||!I[0]||k&&ro;R+='";r.setDate(r.getDate()+1);r=this._daylightSavingAdjust(r)}y+=R+""}g++;if(g>11){g=0;m++}y+="
        '+this._get(a,"weekHeader")+"
        '+this._get(a,"calculateWeek")(r)+""+(F&&!D?" ":L?''+ -r.getDate()+"":''+r.getDate()+"")+"
        "+(l?""+(i[0]>0&&G==i[1]-1?'
        ':""):"");O+=y}w+=O}w+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'': -"");a._keyEvent=false;return w},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
        ',o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&&l)?" ":""));if(!a.yearshtml){a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var s=(new Date).getFullYear();i=function(q){q=q.match(/c[+-].*/)?c+parseInt(q.substring(1),10):q.match(/[+-].*/)?s+parseInt(q,10):parseInt(q,10);return isNaN(q)?s:q};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b, -e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
        ";return k},_adjustInstDate:function(a,b,c){var e=a.drawYear+(c=="Y"?b:0),f=a.drawMonth+ -(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a,"onChangeMonthYear");if(b)b.apply(a.input? -a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-this._daylightSavingAdjust(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a);c=this._daylightSavingAdjust(new Date(c, -e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a,"dayNamesShort"),dayNames:this._get(a, -"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker=function(a){if(!this.length)return this; -if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));return this.each(function(){typeof a== -"string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new M;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.16";window["DP_jQuery_"+B]=d})(jQuery); +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t,e){function i(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.dpDiv=s(t("
        "))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.delegate(i,"mouseout",function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).delegate(i,"mouseover",function(){t.datepicker._isDisabledDatepicker(a.inline?e.parent()[0]:a.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))})}function n(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.extend(t.ui,{datepicker:{version:"1.10.3"}});var a,r="datepicker";t.extend(i.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return n(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,a;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),a=this._newInst(t(e),n),a.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,a):n&&this._inlineDatepicker(e,a)},_newInst:function(e,i){var n=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:n,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("
        ")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp),this._autoSize(i),t.data(e,r,i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,a,r=this._get(i,"appendText"),o=this._get(i,"isRTL");i.append&&i.append.remove(),r&&(i.append=t(""+r+""),e[o?"before":"after"](i.append)),e.unbind("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.focus(this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),a=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("").addClass(this._triggerClass).attr({src:a,alt:n,title:n}):t("").addClass(this._triggerClass).html(a?t("").attr({src:a,alt:n,title:n}):n)),e[o?"before":"after"](i.trigger),i.trigger.click(function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,a=new Date(2009,11,20),r=this._get(t,"dateFormat");r.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},a.setMonth(e(this._get(t,r.match(/MM/)?"monthNames":"monthNamesShort"))),a.setDate(e(this._get(t,r.match(/DD/)?"dayNames":"dayNamesShort"))+20-a.getDay())),t.input.attr("size",this._formatDate(t,a).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,r,i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,a,o){var h,l,c,u,d,p=this._dialogInst;return p||(this.uuid+=1,h="dp"+this.uuid,this._dialogInput=t(""),this._dialogInput.keydown(this._doKeyDown),t("body").append(this._dialogInput),p=this._dialogInst=this._newInst(this._dialogInput,!1),p.settings={},t.data(this._dialogInput[0],r,p)),n(p.settings,a||{}),i=i&&i.constructor===Date?this._formatDate(p,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,c=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,d=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,c/2-150+d]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),p.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],r,p),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,r);s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,r),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty())},_enableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,a.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),a=t.data(e,r);n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,a.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,r)}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(i,s,a){var r,o,h,l,c=this._getInst(i);return 2===arguments.length&&"string"==typeof s?"defaults"===s?t.extend({},t.datepicker._defaults):c?"all"===s?t.extend({},c.settings):this._get(c,s):null:(r=s||{},"string"==typeof s&&(r={},r[s]=a),c&&(this._curInst===c&&this._hideDatepicker(),o=this._getDateDatepicker(i,!0),h=this._getMinMaxDate(c,"min"),l=this._getMinMaxDate(c,"max"),n(c.settings,r),null!==h&&r.dateFormat!==e&&r.minDate===e&&(c.settings.minDate=this._formatDate(c,h)),null!==l&&r.dateFormat!==e&&r.maxDate===e&&(c.settings.maxDate=this._formatDate(c,l)),"disabled"in r&&(r.disabled?this._disableDatepicker(i):this._enableDatepicker(i)),this._attachments(t(i),c),this._autoSize(c),this._setDate(c,o),this._updateAlternate(c),this._updateDatepicker(c)),e)},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,a=t.datepicker._getInst(e.target),r=!0,o=a.dpDiv.is(".ui-datepicker-rtl");if(a._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),r=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",a.dpDiv),n[0]&&t.datepicker._selectDay(e.target,a.selectedMonth,a.selectedYear,n[0]),i=t.datepicker._get(a,"onSelect"),i?(s=t.datepicker._formatDate(a),i.apply(a.input?a.input[0]:null,[s,a])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),r=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),r=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?1:-1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(a,"stepBigMonths"):-t.datepicker._get(a,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),r=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,o?-1:1,"D"),r=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(a,"stepBigMonths"):+t.datepicker._get(a,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),r=e.ctrlKey||e.metaKey;break;default:r=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):r=!1;r&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(i){var s,n,a=t.datepicker._getInst(i.target);return t.datepicker._get(a,"constrainInput")?(s=t.datepicker._possibleChars(t.datepicker._get(a,"dateFormat")),n=String.fromCharCode(null==i.charCode?i.keyCode:i.charCode),i.ctrlKey||i.metaKey||" ">n||!s||s.indexOf(n)>-1):e},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var i,s,a,r,o,h,l;i=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==i&&(t.datepicker._curInst.dpDiv.stop(!0,!0),i&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(i,"beforeShow"),a=s?s.apply(e,[e,i]):{},a!==!1&&(n(i.settings,a),i.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(i),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),o={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,i.dpDiv.empty(),i.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(i),o=t.datepicker._checkOffset(i,o,r),i.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:o.left+"px",top:o.top+"px"}),i.inline||(h=t.datepicker._get(i,"showAnim"),l=t.datepicker._get(i,"duration"),i.dpDiv.zIndex(t(e).zIndex()+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?i.dpDiv.show(h,t.datepicker._get(i,"showOptions"),l):i.dpDiv[h||"show"](h?l:null),t.datepicker._shouldFocusInput(i)&&i.input.focus(),t.datepicker._curInst=i))}},_updateDatepicker:function(e){this.maxRows=4,a=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e),e.dpDiv.find("."+this._dayOverClass+" a").mouseover();var i,s=this._getNumberOfMonths(e),n=s[1],r=17;e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",r*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.focus(),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),a=e.dpDiv.outerHeight(),r=e.input?e.input.outerWidth():0,o=e.input?e.input.outerHeight():0,h=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),l=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-r:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+o?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>h&&h>n?Math.abs(i.left+n-h):0),i.top-=Math.min(i.top,i.top+a>l&&l>a?Math.abs(a+o):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,a,o=this._curInst;!o||e&&o!==t.data(e,r)||this._datepickerShowing&&(i=this._get(o,"showAnim"),s=this._get(o,"duration"),n=function(){t.datepicker._tidyDialog(o)},t.effects&&(t.effects.effect[i]||t.effects[i])?o.dpDiv.hide(i,t.datepicker._get(o,"showOptions"),s,n):o.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,a=this._get(o,"onClose"),a&&a.apply(o.input?o.input[0]:null,[o.input?o.input.val():"",o]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),a=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(a,i+("M"===s?this._get(a,"showCurrentAtPos"):0),s),this._updateDatepicker(a))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),a=this._getInst(n[0]);a["selected"+("M"===s?"Month":"Year")]=a["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(a),this._adjustDate(n)},_selectDay:function(e,i,s,n){var a,r=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(r[0])||(a=this._getInst(r[0]),a.selectedDay=a.currentDay=t("a",n).html(),a.selectedMonth=a.currentMonth=i,a.selectedYear=a.currentYear=s,this._selectDate(e,this._formatDate(a,a.currentDay,a.currentMonth,a.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),a=this._getInst(n[0]);i=null!=i?i:this._formatDate(a),a.input&&a.input.val(i),this._updateAlternate(a),s=this._get(a,"onSelect"),s?s.apply(a.input?a.input[0]:null,[i,a]):a.input&&a.input.trigger("change"),a.inline?this._updateDatepicker(a):(this._hideDatepicker(),this._lastInput=a.input[0],"object"!=typeof a.input[0]&&a.input.focus(),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,a=this._get(e,"altField");a&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(a).each(function(){t(this).val(n)}))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(i,s,n){if(null==i||null==s)throw"Invalid arguments";if(s="object"==typeof s?""+s:s+"",""===s)return null;var a,r,o,h,l=0,c=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof c?c:(new Date).getFullYear()%100+parseInt(c,10),d=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,p=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,m=(n?n.monthNames:null)||this._defaults.monthNames,g=-1,v=-1,_=-1,b=-1,y=!1,x=function(t){var e=i.length>a+1&&i.charAt(a+1)===t;return e&&a++,e},k=function(t){var e=x(t),i="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n=RegExp("^\\d{1,"+i+"}"),a=s.substring(l).match(n);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},w=function(i,n,a){var r=-1,o=t.map(x(i)?a:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(o,function(t,i){var n=i[1];return s.substr(l,n.length).toLowerCase()===n.toLowerCase()?(r=i[0],l+=n.length,!1):e}),-1!==r)return r+1;throw"Unknown name at position "+l},D=function(){if(s.charAt(l)!==i.charAt(a))throw"Unexpected literal at position "+l;l++};for(a=0;i.length>a;a++)if(y)"'"!==i.charAt(a)||x("'")?D():y=!1;else switch(i.charAt(a)){case"d":_=k("d");break;case"D":w("D",d,p);break;case"o":b=k("o");break;case"m":v=k("m");break;case"M":v=w("M",f,m);break;case"y":g=k("y");break;case"@":h=new Date(k("@")),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"!":h=new Date((k("!")-this._ticksTo1970)/1e4),g=h.getFullYear(),v=h.getMonth()+1,_=h.getDate();break;case"'":x("'")?D():y=!0;break;default:D()}if(s.length>l&&(o=s.substr(l),!/^\s+/.test(o)))throw"Extra/unparsed characters found in date: "+o;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(u>=g?0:-100)),b>-1)for(v=1,_=b;;){if(r=this._getDaysInMonth(g,v-1),r>=_)break;v++,_-=r}if(h=this._daylightSavingAdjust(new Date(g,v-1,_)),h.getFullYear()!==g||h.getMonth()+1!==v||h.getDate()!==_)throw"Invalid date";return h},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,a=(i?i.dayNames:null)||this._defaults.dayNames,r=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,o=(i?i.monthNames:null)||this._defaults.monthNames,h=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},l=function(t,e,i){var s=""+e;if(h(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return h(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||h("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=l("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,a);break;case"o":u+=l("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=l("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),r,o);break;case"y":u+=h("y")?e.getFullYear():(10>e.getYear()%100?"0":"")+e.getYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":h("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,i){return t.settings[i]!==e?t.settings[i]:this._defaults[i]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),a=n,r=this._getFormatConfig(t);try{a=this.parseDate(i,s,r)||n}catch(o){s=e?"":s}t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),t.currentDay=s?a.getDate():0,t.currentMonth=s?a.getMonth():0,t.currentYear=s?a.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},a=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,a=n.getFullYear(),r=n.getMonth(),o=n.getDate(),h=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=h.exec(i);l;){switch(l[2]||"d"){case"d":case"D":o+=parseInt(l[1],10);break;case"w":case"W":o+=7*parseInt(l[1],10);break;case"m":case"M":r+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r));break;case"y":case"Y":a+=parseInt(l[1],10),o=Math.min(o,t.datepicker._getDaysInMonth(a,r))}l=h.exec(i)}return new Date(a,r,o)},r=null==i||""===i?s:"string"==typeof i?a(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return r=r&&"Invalid Date"==""+r?s:r,r&&(r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0)),this._daylightSavingAdjust(r)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,a=t.selectedYear,r=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=r.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=r.getMonth(),t.drawYear=t.selectedYear=t.currentYear=r.getFullYear(),n===t.selectedMonth&&a===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,a,r,o,h,l,c,u,d,p,f,m,g,v,_,b,y,x,k,w,D,T,C,M,S,N,I,P,A,z,H,E,F,O,W,j,R=new Date,L=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),Y=this._get(t,"isRTL"),B=this._get(t,"showButtonPanel"),J=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),Q=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),U=this._get(t,"stepMonths"),q=1!==Q[0]||1!==Q[1],X=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),G=this._getMinMaxDate(t,"min"),$=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),$)for(e=this._daylightSavingAdjust(new Date($.getFullYear(),$.getMonth()-Q[0]*Q[1]+1,$.getDate())),e=G&&G>e?G:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-U,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?""+i+"":J?"":""+i+"",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+U,1)),this._getFormatConfig(t)):n,a=this._canAdjustMonth(t,1,te,Z)?""+n+"":J?"":""+n+"",r=this._get(t,"currentText"),o=this._get(t,"gotoCurrent")&&t.currentDay?X:L,r=K?this.formatDate(r,o,this._getFormatConfig(t)):r,h=t.inline?"":"",l=B?"
        "+(Y?h:"")+(this._isInRange(t,o)?"":"")+(Y?"":h)+"
        ":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),m=this._get(t,"monthNamesShort"),g=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),_=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;Q[0]>k;k++){for(w="",this.maxRows=4,D=0;Q[1]>D;D++){if(T=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),C=" ui-corner-all",M="",q){if(M+="
        "}for(M+="
        "+(/all|left/.test(C)&&0===k?Y?a:s:"")+(/all|right/.test(C)&&0===k?Y?s:a:"")+this._generateMonthYearHeader(t,Z,te,G,$,k>0||D>0,f,m)+"
        "+"",S=u?"":"",x=0;7>x;x++)N=(x+c)%7,S+="=5?" class='ui-datepicker-week-end'":"")+">"+""+p[N]+"";for(M+=S+"",I=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,I)),P=(this._getFirstDayOfMonth(te,Z)-c+7)%7,A=Math.ceil((P+I)/7),z=q?this.maxRows>A?this.maxRows:A:A,this.maxRows=z,H=this._daylightSavingAdjust(new Date(te,Z,1-P)),E=0;z>E;E++){for(M+="",F=u?"":"",x=0;7>x;x++)O=g?g.apply(t.input?t.input[0]:null,[H]):[!0,""],W=H.getMonth()!==Z,j=W&&!_||!O[0]||G&&G>H||$&&H>$,F+="",H.setDate(H.getDate()+1),H=this._daylightSavingAdjust(H);M+=F+""}Z++,Z>11&&(Z=0,te++),M+="
        "+this._get(t,"weekHeader")+"
        "+this._get(t,"calculateWeek")(H)+""+(W&&!v?" ":j?""+H.getDate()+"":""+H.getDate()+"")+"
        "+(q?"
        "+(Q[0]>0&&D===Q[1]-1?"
        ":""):""),w+=M}y+=w}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,a,r,o){var h,l,c,u,d,p,f,m,g=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),_=this._get(t,"showMonthAfterYear"),b="
        ",y="";if(a||!g)y+=""+r[e]+"";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+=""}if(_||(b+=y+(!a&&g&&v?"":" ")),!t.yearshtml)if(t.yearshtml="",a||!v)b+=""+i+"";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10); +return isNaN(e)?d:e},f=p(u[0]),m=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,m=n?Math.min(m,n.getFullYear()):m,t.yearshtml+="",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),_&&(b+=(!a&&g&&v?"":" ")+y),b+="
        "},_adjustInstDate:function(t,e,i){var s=t.drawYear+("Y"===i?e:0),n=t.drawMonth+("M"===i?e:0),a=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),r=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,a)));t.selectedDay=r.getDate(),t.drawMonth=t.selectedMonth=r.getMonth(),t.drawYear=t.selectedYear=r.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),a=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&a.setDate(this._getDaysInMonth(a.getFullYear(),a.getMonth())),this._isInRange(t,a)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),a=this._getMinMaxDate(t,"max"),r=null,o=null,h=this._get(t,"yearRange");return h&&(i=h.split(":"),s=(new Date).getFullYear(),r=parseInt(i[0],10),o=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(r+=s),i[1].match(/[+\-].*/)&&(o+=s)),(!n||e.getTime()>=n.getTime())&&(!a||e.getTime()<=a.getTime())&&(!r||e.getFullYear()>=r)&&(!o||o>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).mousedown(t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new i,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.10.3"})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.dialog.min.js b/js/jquery/ui/jquery.ui.dialog.min.js old mode 100755 new mode 100644 index a16bf9eb0..990f20219 --- a/js/jquery/ui/jquery.ui.dialog.min.js +++ b/js/jquery/ui/jquery.ui.dialog.min.js @@ -1,40 +1,4 @@ -/* - * jQuery UI Dialog 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Dialog - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.button.js - * jquery.ui.draggable.js - * jquery.ui.mouse.js - * jquery.ui.position.js - * jquery.ui.resizable.js - */ -(function(c,l){var m={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},n={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},o=c.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false, -position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&&c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
        ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+ -b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&!i.isDefaultPrevented()&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
        ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g), -h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id", -e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose=b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body"); -a.uiDialog.remove();a.originalTitle&&a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!== -b.uiDialog[0]){e=c(this).css("z-index");isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.scrollTop(),scrollLeft:d.element.scrollLeft()};c.ui.dialog.maxZ+=1; -d.uiDialog.css("z-index",c.ui.dialog.maxZ);d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target=== -f[0]&&e.shiftKey){g.focus(1);return false}}});c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
        ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
        ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a, -function(){return!(d=true)});if(d){c.each(a,function(f,h){h=c.isFunction(h)?{click:h,text:f}:h;var i=c('').click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.each(h,function(j,k){if(j!=="click")j in o?i[j](k):i.attr(j,k)});c.fn.button&&i.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close", -handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g=d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition, -originalSize:f.originalSize,position:f.position,size:f.size}}a=a===l?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize", -f,b(h))},stop:function(f,h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "): -[a[0],a[1]];if(b.length===1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f); -if(g in m)e=true;if(g in n)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"): -e.removeClass("ui-dialog-disabled");break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a= -this.options,b,d,e=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height- -b,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.16",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "), -create:function(a){if(this.instances.length===0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&& -c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return ai&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),this.options.title=this.options.title||this.originalTitle,this._createWrapper(),this.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(this.uiDialog),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._destroyOverlay(),this.element.removeUniqueId().removeClass("ui-dialog-content ui-widget-content").css(this.originalCss).detach(),this.uiDialog.stop(!0,!0).remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&this._trigger("beforeClose",e)!==!1&&(this._isOpen=!1,this._destroyOverlay(),this.opener.filter(":focusable").focus().length||t(this.document[0].activeElement).blur(),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!!this.uiDialog.nextAll(":visible").insertBefore(this.uiDialog).length;return i&&!e&&this._trigger("focus",t),i},open:function(){var e=this;return this._isOpen?(this._moveToTop()&&this._focusTabbable(),undefined):(this._isOpen=!0,this.opener=t(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._trigger("open"),undefined)},_focusTabbable:function(){var t=this.element.find("[autofocus]");t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).focus()},_keepFocus:function(e){function i(){var e=this.document[0].activeElement,i=this.uiDialog[0]===e||t.contains(this.uiDialog[0],e);i||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("
        ").addClass("ui-dialog ui-widget ui-widget-content ui-corner-all ui-front "+this.options.dialogClass).hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),this.close(e),undefined;if(e.keyCode===t.ui.keyCode.TAB){var i=this.uiDialog.find(":tabbable"),s=i.filter(":first"),n=i.filter(":last");e.target!==n[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==s[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(n.focus(1),e.preventDefault()):(s.focus(1),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("
        ").addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(this.uiDialog),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.focus()}}),this.uiDialogTitlebarClose=t("").button({label:this.options.closeText,icons:{primary:"ui-icon-closethick"},text:!1}).addClass("ui-dialog-titlebar-close").appendTo(this.uiDialogTitlebar),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("").uniqueId().addClass("ui-dialog-title").prependTo(this.uiDialogTitlebar),this._title(e),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title||t.html(" "),t.text(this.options.title)},_createButtonPane:function(){this.uiDialogButtonPane=t("
        ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("
        ").addClass("ui-dialog-buttonset").appendTo(this.uiDialogButtonPane),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;return this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length?(this.uiDialog.removeClass("ui-dialog-buttons"),undefined):(t.each(i,function(i,s){var n,a;s=t.isFunction(s)?{click:s,text:i}:s,s=t.extend({type:"button"},s),n=s.click,s.click=function(){n.apply(e.element[0],arguments)},a={icons:s.icons,text:s.showText},delete s.icons,delete s.showText,t("",s).button(a).appendTo(e.uiButtonSet)}),this.uiDialog.addClass("ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog),undefined)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,s=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(s,n){t(this).addClass("ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",s,e(n))},drag:function(t,s){i._trigger("drag",t,e(s))},stop:function(n,a){s.position=[a.position.left-i.document.scrollLeft(),a.position.top-i.document.scrollTop()],t(this).removeClass("ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",n,e(a))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,s=this.options,n=s.resizable,a=this.uiDialog.css("position"),o="string"==typeof n?n:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:s.maxWidth,maxHeight:s.maxHeight,minWidth:s.minWidth,minHeight:this._minHeight(),handles:o,start:function(s,n){t(this).addClass("ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",s,e(n))},resize:function(t,s){i._trigger("resize",t,e(s))},stop:function(n,a){s.height=t(this).height(),s.width=t(this).width(),t(this).removeClass("ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",n,e(a))}}).css("position",a)},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(s){var n=this,a=!1,o={};t.each(s,function(t,s){n._setOption(t,s),t in e&&(a=!0),t in i&&(o[t]=s)}),a&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",o)},_setOption:function(t,e){var i,s,n=this.uiDialog;"dialogClass"===t&&n.removeClass(this.options.dialogClass).addClass(e),"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:""+e}),"draggable"===t&&(i=n.is(":data(ui-draggable)"),i&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&(s=n.is(":data(ui-resizable)"),s&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||e===!1||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("
        ").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return t(e.target).closest(".ui-dialog").length?!0:!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=this,i=this.widgetFullName;t.ui.dialog.overlayInstances||this._delay(function(){t.ui.dialog.overlayInstances&&this.document.bind("focusin.dialog",function(s){e._allowInteraction(s)||(s.preventDefault(),t(".ui-dialog:visible:last .ui-dialog-content").data(i)._focusTabbable())})}),this.overlay=t("
        ").addClass("ui-widget-overlay ui-front").appendTo(this._appendTo()),this._on(this.overlay,{mousedown:"_keepFocus"}),t.ui.dialog.overlayInstances++}},_destroyOverlay:function(){this.options.modal&&this.overlay&&(t.ui.dialog.overlayInstances--,t.ui.dialog.overlayInstances||this.document.unbind("focusin.dialog"),this.overlay.remove(),this.overlay=null)}}),t.ui.dialog.overlayInstances=0,t.uiBackCompat!==!1&&t.widget("ui.dialog",t.ui.dialog,{_position:function(){var e,i=this.options.position,s=[],n=[0,0];i?(("string"==typeof i||"object"==typeof i&&"0"in i)&&(s=i.split?i.split(" "):[i[0],i[1]],1===s.length&&(s[1]=s[0]),t.each(["left","top"],function(t,e){+s[t]===s[t]&&(n[t]=s[t],s[t]=e)}),i={my:s[0]+(0>n[0]?n[0]:"+"+n[0])+" "+s[1]+(0>n[1]?n[1]:"+"+n[1]),at:s.join(" ")}),i=t.extend({},t.ui.dialog.prototype.options.position,i)):i=t.ui.dialog.prototype.options.position,e=this.uiDialog.is(":visible"),e||this.uiDialog.show(),this.uiDialog.position(i),e||this.uiDialog.hide()}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.draggable.min.js b/js/jquery/ui/jquery.ui.draggable.min.js old mode 100755 new mode 100644 index b72fb94ea..ac92817f3 --- a/js/jquery/ui/jquery.ui.draggable.min.js +++ b/js/jquery/ui/jquery.ui.draggable.min.js @@ -1,50 +1,4 @@ -/* - * jQuery UI Draggable 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Draggables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== -"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= -this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;if(b.iframeFix)d(b.iframeFix===true?"iframe":b.iframeFix).each(function(){d('
        ').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")});return true},_mouseStart:function(a){var b=this.options; -this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}); -this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions();d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);d.ui.ddmanager&&d.ui.ddmanager.dragStart(this,a);return true}, -_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b= -false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element,b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration, -10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},_mouseUp:function(a){this.options.iframeFix===true&&d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});d.ui.ddmanager&&d.ui.ddmanager.dragStop(this,a);return d.ui.mouse.prototype._mouseUp.call(this,a)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle|| -!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone().removeAttr("id"):this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&& -a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]||0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent= -this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"), -10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"), -10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment=="parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[a.containment=="document"?0:d(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,a.containment=="document"?0:d(window).scrollTop()-this.offset.relative.top-this.offset.parent.top, -(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"?0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){a=d(a.containment);var b=a[0];if(b){a.offset();var c=d(b).css("overflow")!= -"hidden";this.containment=[(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0),(parseInt(d(b).css("borderTopWidth"),10)||0)+(parseInt(d(b).css("paddingTop"),10)||0),(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"), -10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=a}}else if(a.containment.constructor==Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+ -this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&& -!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,h=a.pageY;if(this.originalPosition){var g;if(this.containment){if(this.relative_container){g=this.relative_container.offset();g=[this.containment[0]+g.left,this.containment[1]+g.top,this.containment[2]+g.left,this.containment[3]+g.top]}else g=this.containment;if(a.pageX-this.offset.click.leftg[2])e=g[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>g[3])h=g[3]+this.offset.click.top}if(b.grid){h=b.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/b.grid[1])*b.grid[1]:this.originalPageY;h=g?!(h-this.offset.click.topg[3])?h:!(h-this.offset.click.topg[2])?e:!(e-this.offset.click.left=0;i--){var j=c.snapElements[i].left,l=j+c.snapElements[i].width,k=c.snapElements[i].top,m=k+c.snapElements[i].height;if(j-e0?!1:(this.handle=this._getHandle(t),this.handle?(e(i.iframeFix===!0?"iframe":i.iframeFix).each(function(){e("
        ").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")}),!0):!1)},_mouseStart:function(t){var i=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),e.ui.ddmanager&&(e.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(),this.offsetParent=this.helper.offsetParent(),this.offsetParentCssPosition=this.offsetParent.css("position"),this.offset=this.positionAbs=this.element.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},this.offset.scroll=!1,e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.originalPosition=this.position=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),this._trigger("start",t)===!1?(this._clear(),!1):(this._cacheHelperProportions(),e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t),this._mouseDrag(t,!0),e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t),!0)},_mouseDrag:function(t,i){if("fixed"===this.offsetParentCssPosition&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),!i){var s=this._uiHash();if(this._trigger("drag",t,s)===!1)return this._mouseUp({}),!1;this.position=s.position}return this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),e.ui.ddmanager&&e.ui.ddmanager.drag(this,t),!1},_mouseStop:function(t){var i=this,s=!1;return e.ui.ddmanager&&!this.options.dropBehaviour&&(s=e.ui.ddmanager.drop(this,t)),this.dropped&&(s=this.dropped,this.dropped=!1),"original"!==this.options.helper||e.contains(this.element[0].ownerDocument,this.element[0])?("invalid"===this.options.revert&&!s||"valid"===this.options.revert&&s||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,s)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){i._trigger("stop",t)!==!1&&i._clear()}):this._trigger("stop",t)!==!1&&this._clear(),!1):!1},_mouseUp:function(t){return e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)}),e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t),e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear(),this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var i=this.options,s=e.isFunction(i.helper)?e(i.helper.apply(this.element[0],[t])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_adjustOffsetFromHelper:function(t){"string"==typeof t&&(t=t.split(" ")),e.isArray(t)&&(t={left:+t[0],top:+t[1]||0}),"left"in t&&(this.offset.click.left=t.left+this.margins.left),"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left),"top"in t&&(this.offset.click.top=t.top+this.margins.top),"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])&&(t.left+=this.scrollParent.scrollLeft(),t.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&e.ui.ie)&&(t={top:0,left:0}),{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,i,s,n=this.options;return n.containment?"window"===n.containment?(this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):"document"===n.containment?(this.containment=[0,0,e(document).width()-this.helperProportions.width-this.margins.left,(e(document).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top],undefined):n.containment.constructor===Array?(this.containment=n.containment,undefined):("parent"===n.containment&&(n.containment=this.helper[0].parentNode),i=e(n.containment),s=i[0],s&&(t="hidden"!==i.css("overflow"),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(t?Math.max(s.scrollWidth,s.offsetWidth):s.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(s.scrollHeight,s.offsetHeight):s.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relative_container=i),undefined):(this.containment=null,undefined)},_convertPositionTo:function(t,i){i||(i=this.position);var s="absolute"===t?1:-1,n="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent;return this.offset.scroll||(this.offset.scroll={top:n.scrollTop(),left:n.scrollLeft()}),{top:i.top+this.offset.relative.top*s+this.offset.parent.top*s-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top)*s,left:i.left+this.offset.relative.left*s+this.offset.parent.left*s-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)*s}},_generatePosition:function(t){var i,s,n,a,o=this.options,r="absolute"!==this.cssPosition||this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,h=t.pageX,l=t.pageY;return this.offset.scroll||(this.offset.scroll={top:r.scrollTop(),left:r.scrollLeft()}),this.originalPosition&&(this.containment&&(this.relative_container?(s=this.relative_container.offset(),i=[this.containment[0]+s.left,this.containment[1]+s.top,this.containment[2]+s.left,this.containment[3]+s.top]):i=this.containment,t.pageX-this.offset.click.lefti[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),o.grid&&(n=o.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-o.grid[1]:n+o.grid[1]:n,a=o.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX,h=i?a-this.offset.click.left>=i[0]||a-this.offset.click.left>i[2]?a:a-this.offset.click.left>=i[0]?a-o.grid[0]:a+o.grid[0]:a)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,i,s){return s=s||this._uiHash(),e.ui.plugin.call(this,t,[i,s]),"drag"===t&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,i,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,i){var s=e(this).data("ui-draggable"),n=s.options,a=e.extend({},i,{item:s.element});s.sortables=[],e(n.connectToSortable).each(function(){var i=e.data(this,"ui-sortable");i&&!i.options.disabled&&(s.sortables.push({instance:i,shouldRevert:i.options.revert}),i.refreshPositions(),i._trigger("activate",t,a))})},stop:function(t,i){var s=e(this).data("ui-draggable"),n=e.extend({},i,{item:s.element});e.each(s.sortables,function(){this.instance.isOver?(this.instance.isOver=0,s.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=this.shouldRevert),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,"original"===s.options.helper&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,n))})},drag:function(t,i){var s=e(this).data("ui-draggable"),n=this;e.each(s.sortables,function(){var a=!1,o=this;this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this.instance._intersectsWith(this.instance.containerCache)&&(a=!0,e.each(s.sortables,function(){return this.instance.positionAbs=s.positionAbs,this.instance.helperProportions=s.helperProportions,this.instance.offset.click=s.offset.click,this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(a=!1),a})),a?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(n).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return i.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=s.offset.click.top,this.instance.offset.click.left=s.offset.click.left,this.instance.offset.parent.left-=s.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=s.offset.parent.top-this.instance.offset.parent.top,s._trigger("toSortable",t),s.dropped=this.instance.element,s.currentItem=s.element,this.instance.fromOutside=s),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),s._trigger("fromSortable",t),s.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(){var t=e("body"),i=e(this).data("ui-draggable").options;t.css("cursor")&&(i._cursor=t.css("cursor")),t.css("cursor",i.cursor)},stop:function(){var t=e(this).data("ui-draggable").options;t._cursor&&e("body").css("cursor",t._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._opacity&&e(i.helper).css("opacity",s._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(){var t=e(this).data("ui-draggable");t.scrollParent[0]!==document&&"HTML"!==t.scrollParent[0].tagName&&(t.overflowOffset=t.scrollParent.offset())},drag:function(t){var i=e(this).data("ui-draggable"),s=i.options,n=!1;i.scrollParent[0]!==document&&"HTML"!==i.scrollParent[0].tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+i.scrollParent[0].offsetHeight-t.pageY=0;c--)r=p.snapElements[c].left,h=r+p.snapElements[c].width,l=p.snapElements[c].top,u=l+p.snapElements[c].height,r-m>v||g>h+m||l-m>y||b>u+m||!e.contains(p.snapElements[c].item.ownerDocument,p.snapElements[c].item)?(p.snapElements[c].snapping&&p.options.snap.release&&p.options.snap.release.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=!1):("inner"!==f.snapMode&&(s=m>=Math.abs(l-y),n=m>=Math.abs(u-b),a=m>=Math.abs(r-v),o=m>=Math.abs(h-g),s&&(i.position.top=p._convertPositionTo("relative",{top:l-p.helperProportions.height,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r-p.helperProportions.width}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h}).left-p.margins.left)),d=s||n||a||o,"outer"!==f.snapMode&&(s=m>=Math.abs(l-b),n=m>=Math.abs(u-y),a=m>=Math.abs(r-g),o=m>=Math.abs(h-v),s&&(i.position.top=p._convertPositionTo("relative",{top:l,left:0}).top-p.margins.top),n&&(i.position.top=p._convertPositionTo("relative",{top:u-p.helperProportions.height,left:0}).top-p.margins.top),a&&(i.position.left=p._convertPositionTo("relative",{top:0,left:r}).left-p.margins.left),o&&(i.position.left=p._convertPositionTo("relative",{top:0,left:h-p.helperProportions.width}).left-p.margins.left)),!p.snapElements[c].snapping&&(s||n||a||o||d)&&p.options.snap.snap&&p.options.snap.snap.call(p.element,t,e.extend(p._uiHash(),{snapItem:p.snapElements[c].item})),p.snapElements[c].snapping=s||n||a||o||d)}}),e.ui.plugin.add("draggable","stack",{start:function(){var t,i=this.data("ui-draggable").options,s=e.makeArray(e(i.stack)).sort(function(t,i){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(i).css("zIndex"),10)||0)});s.length&&(t=parseInt(e(s[0]).css("zIndex"),10)||0,e(s).each(function(i){e(this).css("zIndex",t+i)}),this.css("zIndex",t+s.length))}}),e.ui.plugin.add("draggable","zIndex",{start:function(t,i){var s=e(i.helper),n=e(this).data("ui-draggable").options;s.css("zIndex")&&(n._zIndex=s.css("zIndex")),s.css("zIndex",n.zIndex)},stop:function(t,i){var s=e(this).data("ui-draggable").options;s._zIndex&&e(i.helper).css("zIndex",s._zIndex)}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.droppable.min.js b/js/jquery/ui/jquery.ui.droppable.min.js old mode 100755 new mode 100644 index dc7904243..ba7b19400 --- a/js/jquery/ui/jquery.ui.droppable.min.js +++ b/js/jquery/ui/jquery.ui.droppable.min.js @@ -1,27 +1,4 @@ -/* - * jQuery UI Droppable 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Droppables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - * jquery.ui.mouse.js - * jquery.ui.draggable.js - */ -(function(d){d.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var a=this.options,b=a.accept;this.isover=0;this.isout=1;this.accept=d.isFunction(b)?b:function(c){return c.is(b)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};d.ui.ddmanager.droppables[a.scope]=d.ui.ddmanager.droppables[a.scope]||[];d.ui.ddmanager.droppables[a.scope].push(this); -a.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var a=d.ui.ddmanager.droppables[this.options.scope],b=0;b=j&&f<=l||h>=j&&h<=l||fl)&&(e>= -i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;ft&&t+i>e}e.widget("ui.droppable",{version:"1.10.3",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t=this.options,i=t.accept;this.isover=!1,this.isout=!0,this.accept=e.isFunction(i)?i:function(e){return e.is(i)},this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight},e.ui.ddmanager.droppables[t.scope]=e.ui.ddmanager.droppables[t.scope]||[],e.ui.ddmanager.droppables[t.scope].push(this),t.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){for(var t=0,i=e.ui.ddmanager.droppables[this.options.scope];i.length>t;t++)i[t]===this&&i.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,i){"accept"===t&&(this.accept=e.isFunction(i)?i:function(e){return e.is(i)}),e.Widget.prototype._setOption.apply(this,arguments)},_activate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass),i&&this._trigger("activate",t,this.ui(i))},_deactivate:function(t){var i=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass),i&&this._trigger("deactivate",t,this.ui(i))},_over:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.addClass(this.options.hoverClass),this._trigger("over",t,this.ui(i)))},_out:function(t){var i=e.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("out",t,this.ui(i)))},_drop:function(t,i){var s=i||e.ui.ddmanager.current,n=!1;return s&&(s.currentItem||s.element)[0]!==this.element[0]?(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e.data(this,"ui-droppable");return t.options.greedy&&!t.options.disabled&&t.options.scope===s.options.scope&&t.accept.call(t.element[0],s.currentItem||s.element)&&e.ui.intersect(s,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)?(n=!0,!1):undefined}),n?!1:this.accept.call(this.element[0],s.currentItem||s.element)?(this.options.activeClass&&this.element.removeClass(this.options.activeClass),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass),this._trigger("drop",t,this.ui(s)),this.element):!1):!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}}),e.ui.intersect=function(e,i,s){if(!i.offset)return!1;var n,a,o=(e.positionAbs||e.position.absolute).left,r=o+e.helperProportions.width,h=(e.positionAbs||e.position.absolute).top,l=h+e.helperProportions.height,u=i.offset.left,c=u+i.proportions.width,d=i.offset.top,p=d+i.proportions.height;switch(s){case"fit":return o>=u&&c>=r&&h>=d&&p>=l;case"intersect":return o+e.helperProportions.width/2>u&&c>r-e.helperProportions.width/2&&h+e.helperProportions.height/2>d&&p>l-e.helperProportions.height/2;case"pointer":return n=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left,a=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top,t(a,d,i.proportions.height)&&t(n,u,i.proportions.width);case"touch":return(h>=d&&p>=h||l>=d&&p>=l||d>h&&l>p)&&(o>=u&&c>=o||r>=u&&c>=r||u>o&&r>c);default:return!1}},e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,i){var s,n,a=e.ui.ddmanager.droppables[t.options.scope]||[],o=i?i.type:null,r=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(s=0;a.length>s;s++)if(!(a[s].options.disabled||t&&!a[s].accept.call(a[s].element[0],t.currentItem||t.element))){for(n=0;r.length>n;n++)if(r[n]===a[s].element[0]){a[s].proportions.height=0;continue e}a[s].visible="none"!==a[s].element.css("display"),a[s].visible&&("mousedown"===o&&a[s]._activate.call(a[s],i),a[s].offset=a[s].element.offset(),a[s].proportions={width:a[s].element[0].offsetWidth,height:a[s].element[0].offsetHeight})}},drop:function(t,i){var s=!1;return e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(s=this._drop.call(this,i)||s),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),s},dragStart:function(t,i){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)})},drag:function(t,i){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,i),e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var s,n,a,o=e.ui.intersect(t,this,this.options.tolerance),r=!o&&this.isover?"isout":o&&!this.isover?"isover":null;r&&(this.options.greedy&&(n=this.options.scope,a=this.element.parents(":data(ui-droppable)").filter(function(){return e.data(this,"ui-droppable").options.scope===n}),a.length&&(s=e.data(a[0],"ui-droppable"),s.greedyChild="isover"===r)),s&&"isover"===r&&(s.isover=!1,s.isout=!0,s._out.call(s,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),s&&"isout"===r&&(s.isout=!1,s.isover=!0,s._over.call(s,i)))}})},dragStop:function(t,i){t.element.parentsUntil("body").unbind("scroll.droppable"),t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,i)}}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-blind.min.js b/js/jquery/ui/jquery.ui.effect-blind.min.js new file mode 100644 index 000000000..ea34c3ccd --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-blind.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){var e=/up|down|vertical/,i=/up|left|vertical|horizontal/;t.effects.effect.blind=function(s,n){var a,o,r,h=t(this),l=["position","top","bottom","left","right","height","width"],c=t.effects.setMode(h,s.mode||"hide"),u=s.direction||"up",d=e.test(u),p=d?"height":"width",f=d?"top":"left",m=i.test(u),g={},v="show"===c;h.parent().is(".ui-effects-wrapper")?t.effects.save(h.parent(),l):t.effects.save(h,l),h.show(),a=t.effects.createWrapper(h).css({overflow:"hidden"}),o=a[p](),r=parseFloat(a.css(f))||0,g[p]=v?o:0,m||(h.css(d?"bottom":"right",0).css(d?"top":"left","auto").css({position:"absolute"}),g[f]=v?r:o+r),v&&(a.css(p,0),m||a.css(f,r+o)),a.animate(g,{duration:s.duration,easing:s.easing,queue:!1,complete:function(){"hide"===c&&h.hide(),t.effects.restore(h,l),t.effects.removeWrapper(h),n()}})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-bounce.min.js b/js/jquery/ui/jquery.ui.effect-bounce.min.js new file mode 100644 index 000000000..05a74f6eb --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-bounce.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.bounce=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"effect"),l="hide"===h,c="show"===h,u=e.direction||"up",d=e.distance,p=e.times||5,f=2*p+(c||l?1:0),m=e.duration/f,g=e.easing,v="up"===u||"down"===u?"top":"left",_="up"===u||"left"===u,b=o.queue(),y=b.length;for((c||l)&&r.push("opacity"),t.effects.save(o,r),o.show(),t.effects.createWrapper(o),d||(d=o["top"===v?"outerHeight":"outerWidth"]()/3),c&&(a={opacity:1},a[v]=0,o.css("opacity",0).css(v,_?2*-d:2*d).animate(a,m,g)),l&&(d/=Math.pow(2,p-1)),a={},a[v]=0,s=0;p>s;s++)n={},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g).animate(a,m,g),d=l?2*d:d/2;l&&(n={opacity:0},n[v]=(_?"-=":"+=")+d,o.animate(n,m,g)),o.queue(function(){l&&o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}),y>1&&b.splice.apply(b,[1,0].concat(b.splice(y,f+1))),o.dequeue()}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-clip.min.js b/js/jquery/ui/jquery.ui.effect-clip.min.js new file mode 100644 index 000000000..5b15f8ef0 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-clip.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.clip=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","height","width"],h=t.effects.setMode(o,e.mode||"hide"),l="show"===h,c=e.direction||"vertical",u="vertical"===c,d=u?"height":"width",p=u?"top":"left",f={};t.effects.save(o,r),o.show(),s=t.effects.createWrapper(o).css({overflow:"hidden"}),n="IMG"===o[0].tagName?s:o,a=n[d](),l&&(n.css(d,0),n.css(p,a/2)),f[d]=l?a:0,f[p]=l?0:a/2,n.animate(f,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){l||o.hide(),t.effects.restore(o,r),t.effects.removeWrapper(o),i()}})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-drop.min.js b/js/jquery/ui/jquery.ui.effect-drop.min.js new file mode 100644 index 000000000..02d148a16 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-drop.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.drop=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","opacity","height","width"],o=t.effects.setMode(n,e.mode||"hide"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h?"pos":"neg",u={opacity:r?1:0};t.effects.save(n,a),n.show(),t.effects.createWrapper(n),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0)/2,r&&n.css("opacity",0).css(l,"pos"===c?-s:s),u[l]=(r?"pos"===c?"+=":"-=":"pos"===c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-explode.min.js b/js/jquery/ui/jquery.ui.effect-explode.min.js new file mode 100644 index 000000000..096ff58f5 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-explode.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.explode=function(e,i){function s(){b.push(this),b.length===u*d&&n()}function n(){p.css({visibility:"visible"}),t(b).remove(),m||p.hide(),i()}var a,o,r,h,l,c,u=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=u,p=t(this),f=t.effects.setMode(p,e.mode||"hide"),m="show"===f,g=p.show().css("visibility","hidden").offset(),v=Math.ceil(p.outerWidth()/d),_=Math.ceil(p.outerHeight()/u),b=[];for(a=0;u>a;a++)for(h=g.top+a*_,c=a-(u-1)/2,o=0;d>o;o++)r=g.left+o*v,l=o-(d-1)/2,p.clone().appendTo("body").wrap("
        ").css({position:"absolute",visibility:"visible",left:-o*v,top:-a*_}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:_,left:r+(m?l*v:0),top:h+(m?c*_:0),opacity:m?0:1}).animate({left:r+(m?0:l*v),top:h+(m?0:c*_),opacity:m?1:0},e.duration||500,e.easing,s)}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-fade.min.js b/js/jquery/ui/jquery.ui.effect-fade.min.js new file mode 100644 index 000000000..09d3a0ec0 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-fade.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.fade=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"toggle");s.animate({opacity:n},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-fold.min.js b/js/jquery/ui/jquery.ui.effect-fold.min.js new file mode 100644 index 000000000..6b323bcd3 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-fold.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.fold=function(e,i){var s,n,a=t(this),o=["position","top","bottom","left","right","height","width"],r=t.effects.setMode(a,e.mode||"hide"),h="show"===r,l="hide"===r,c=e.size||15,u=/([0-9]+)%/.exec(c),d=!!e.horizFirst,p=h!==d,f=p?["width","height"]:["height","width"],m=e.duration/2,g={},v={};t.effects.save(a,o),a.show(),s=t.effects.createWrapper(a).css({overflow:"hidden"}),n=p?[s.width(),s.height()]:[s.height(),s.width()],u&&(c=parseInt(u[1],10)/100*n[l?0:1]),h&&s.css(d?{height:0,width:c}:{height:c,width:0}),g[f[0]]=h?n[0]:c,v[f[1]]=h?n[1]:0,s.animate(g,m,e.easing).animate(v,m,e.easing,function(){l&&a.hide(),t.effects.restore(a,o),t.effects.removeWrapper(a),i()})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-highlight.min.js b/js/jquery/ui/jquery.ui.effect-highlight.min.js new file mode 100644 index 000000000..8aac9b314 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-highlight.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.highlight=function(e,i){var s=t(this),n=["backgroundImage","backgroundColor","opacity"],a=t.effects.setMode(s,e.mode||"show"),o={backgroundColor:s.css("backgroundColor")};"hide"===a&&(o.opacity=0),t.effects.save(s,n),s.show().css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(o,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===a&&s.hide(),t.effects.restore(s,n),i()}})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-pulsate.min.js b/js/jquery/ui/jquery.ui.effect-pulsate.min.js new file mode 100644 index 000000000..1338dfa97 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-pulsate.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.pulsate=function(e,i){var s,n=t(this),a=t.effects.setMode(n,e.mode||"show"),o="show"===a,r="hide"===a,h=o||"hide"===a,l=2*(e.times||5)+(h?1:0),c=e.duration/l,u=0,d=n.queue(),p=d.length;for((o||!n.is(":visible"))&&(n.css("opacity",0).show(),u=1),s=1;l>s;s++)n.animate({opacity:u},c,e.easing),u=1-u;n.animate({opacity:u},c,e.easing),n.queue(function(){r&&n.hide(),i()}),p>1&&d.splice.apply(d,[1,0].concat(d.splice(p,l+1))),n.dequeue()}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-scale.min.js b/js/jquery/ui/jquery.ui.effect-scale.min.js new file mode 100644 index 000000000..0be8b0f31 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-scale.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.puff=function(e,i){var s=t(this),n=t.effects.setMode(s,e.mode||"hide"),a="hide"===n,o=parseInt(e.percent,10)||150,r=o/100,h={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()};t.extend(e,{effect:"scale",queue:!1,fade:!0,mode:n,complete:i,percent:a?o:100,from:a?h:{height:h.height*r,width:h.width*r,outerHeight:h.outerHeight*r,outerWidth:h.outerWidth*r}}),s.effect(e)},t.effects.effect.scale=function(e,i){var s=t(this),n=t.extend(!0,{},e),a=t.effects.setMode(s,e.mode||"effect"),o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"hide"===a?0:100),r=e.direction||"both",h=e.origin,l={height:s.height(),width:s.width(),outerHeight:s.outerHeight(),outerWidth:s.outerWidth()},c={y:"horizontal"!==r?o/100:1,x:"vertical"!==r?o/100:1};n.effect="size",n.queue=!1,n.complete=i,"effect"!==a&&(n.origin=h||["middle","center"],n.restore=!0),n.from=e.from||("show"===a?{height:0,width:0,outerHeight:0,outerWidth:0}:l),n.to={height:l.height*c.y,width:l.width*c.x,outerHeight:l.outerHeight*c.y,outerWidth:l.outerWidth*c.x},n.fade&&("show"===a&&(n.from.opacity=0,n.to.opacity=1),"hide"===a&&(n.from.opacity=1,n.to.opacity=0)),s.effect(n)},t.effects.effect.size=function(e,i){var s,n,a,o=t(this),r=["position","top","bottom","left","right","width","height","overflow","opacity"],h=["position","top","bottom","left","right","overflow","opacity"],l=["width","height","overflow"],c=["fontSize"],u=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],d=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],p=t.effects.setMode(o,e.mode||"effect"),f=e.restore||"effect"!==p,m=e.scale||"both",g=e.origin||["middle","center"],v=o.css("position"),_=f?r:h,b={height:0,width:0,outerHeight:0,outerWidth:0};"show"===p&&o.show(),s={height:o.height(),width:o.width(),outerHeight:o.outerHeight(),outerWidth:o.outerWidth()},"toggle"===e.mode&&"show"===p?(o.from=e.to||b,o.to=e.from||s):(o.from=e.from||("show"===p?b:s),o.to=e.to||("hide"===p?b:s)),a={from:{y:o.from.height/s.height,x:o.from.width/s.width},to:{y:o.to.height/s.height,x:o.to.width/s.width}},("box"===m||"both"===m)&&(a.from.y!==a.to.y&&(_=_.concat(u),o.from=t.effects.setTransition(o,u,a.from.y,o.from),o.to=t.effects.setTransition(o,u,a.to.y,o.to)),a.from.x!==a.to.x&&(_=_.concat(d),o.from=t.effects.setTransition(o,d,a.from.x,o.from),o.to=t.effects.setTransition(o,d,a.to.x,o.to))),("content"===m||"both"===m)&&a.from.y!==a.to.y&&(_=_.concat(c).concat(l),o.from=t.effects.setTransition(o,c,a.from.y,o.from),o.to=t.effects.setTransition(o,c,a.to.y,o.to)),t.effects.save(o,_),o.show(),t.effects.createWrapper(o),o.css("overflow","hidden").css(o.from),g&&(n=t.effects.getBaseline(g,s),o.from.top=(s.outerHeight-o.outerHeight())*n.y,o.from.left=(s.outerWidth-o.outerWidth())*n.x,o.to.top=(s.outerHeight-o.to.outerHeight)*n.y,o.to.left=(s.outerWidth-o.to.outerWidth)*n.x),o.css(o.from),("content"===m||"both"===m)&&(u=u.concat(["marginTop","marginBottom"]).concat(c),d=d.concat(["marginLeft","marginRight"]),l=r.concat(u).concat(d),o.find("*[width]").each(function(){var i=t(this),s={height:i.height(),width:i.width(),outerHeight:i.outerHeight(),outerWidth:i.outerWidth()};f&&t.effects.save(i,l),i.from={height:s.height*a.from.y,width:s.width*a.from.x,outerHeight:s.outerHeight*a.from.y,outerWidth:s.outerWidth*a.from.x},i.to={height:s.height*a.to.y,width:s.width*a.to.x,outerHeight:s.height*a.to.y,outerWidth:s.width*a.to.x},a.from.y!==a.to.y&&(i.from=t.effects.setTransition(i,u,a.from.y,i.from),i.to=t.effects.setTransition(i,u,a.to.y,i.to)),a.from.x!==a.to.x&&(i.from=t.effects.setTransition(i,d,a.from.x,i.from),i.to=t.effects.setTransition(i,d,a.to.x,i.to)),i.css(i.from),i.animate(i.to,e.duration,e.easing,function(){f&&t.effects.restore(i,l)})})),o.animate(o.to,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){0===o.to.opacity&&o.css("opacity",o.from.opacity),"hide"===p&&o.hide(),t.effects.restore(o,_),f||("static"===v?o.css({position:"relative",top:o.to.top,left:o.to.left}):t.each(["top","left"],function(t,e){o.css(e,function(e,i){var s=parseInt(i,10),n=t?o.to.left:o.to.top;return"auto"===i?n+"px":s+n+"px"})})),t.effects.removeWrapper(o),i()}})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-shake.min.js b/js/jquery/ui/jquery.ui.effect-shake.min.js new file mode 100644 index 000000000..8bfffec5f --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-shake.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.shake=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","height","width"],o=t.effects.setMode(n,e.mode||"effect"),r=e.direction||"left",h=e.distance||20,l=e.times||3,c=2*l+1,u=Math.round(e.duration/c),d="up"===r||"down"===r?"top":"left",p="up"===r||"left"===r,f={},m={},g={},v=n.queue(),_=v.length;for(t.effects.save(n,a),n.show(),t.effects.createWrapper(n),f[d]=(p?"-=":"+=")+h,m[d]=(p?"+=":"-=")+2*h,g[d]=(p?"-=":"+=")+2*h,n.animate(f,u,e.easing),s=1;l>s;s++)n.animate(m,u,e.easing).animate(g,u,e.easing);n.animate(m,u,e.easing).animate(f,u/2,e.easing).queue(function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}),_>1&&v.splice.apply(v,[1,0].concat(v.splice(_,c+1))),n.dequeue()}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-slide.min.js b/js/jquery/ui/jquery.ui.effect-slide.min.js new file mode 100644 index 000000000..b3de22e04 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-slide.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.slide=function(e,i){var s,n=t(this),a=["position","top","bottom","left","right","width","height"],o=t.effects.setMode(n,e.mode||"show"),r="show"===o,h=e.direction||"left",l="up"===h||"down"===h?"top":"left",c="up"===h||"left"===h,u={};t.effects.save(n,a),n.show(),s=e.distance||n["top"===l?"outerHeight":"outerWidth"](!0),t.effects.createWrapper(n).css({overflow:"hidden"}),r&&n.css(l,c?isNaN(s)?"-"+s:-s:s),u[l]=(r?c?"+=":"-=":c?"-=":"+=")+s,n.animate(u,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){"hide"===o&&n.hide(),t.effects.restore(n,a),t.effects.removeWrapper(n),i()}})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect-transfer.min.js b/js/jquery/ui/jquery.ui.effect-transfer.min.js new file mode 100644 index 000000000..cec83690d --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect-transfer.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.effects.effect.transfer=function(e,i){var s=t(this),n=t(e.to),a="fixed"===n.css("position"),o=t("body"),r=a?o.scrollTop():0,h=a?o.scrollLeft():0,l=n.offset(),c={top:l.top-r,left:l.left-h,height:n.innerHeight(),width:n.innerWidth()},u=s.offset(),d=t("
        ").appendTo(document.body).addClass(e.className).css({top:u.top-r,left:u.left-h,height:s.innerHeight(),width:s.innerWidth(),position:a?"fixed":"absolute"}).animate(c,e.duration,e.easing,function(){d.remove(),i()})}})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.effect.min.js b/js/jquery/ui/jquery.ui.effect.min.js new file mode 100644 index 000000000..50fbc7992 --- /dev/null +++ b/js/jquery/ui/jquery.ui.effect.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t,e){var i="ui-effects-";t.effects={effect:{}},function(t,e){function i(t,e,i){var s=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:0>t?0:t>s.max?s.max:t)}function s(i){var s=l(),n=s._rgba=[];return i=i.toLowerCase(),f(h,function(t,a){var o,r=a.re.exec(i),h=r&&a.parse(r),l=a.space||"rgba";return h?(o=s[l](h),s[c[l].cache]=o[c[l].cache],n=s._rgba=o._rgba,!1):e}),n.length?("0,0,0,0"===n.join()&&t.extend(n,a.transparent),s):a[i]}function n(t,e,i){return i=(i+1)%1,1>6*i?t+6*(e-t)*i:1>2*i?e:2>3*i?t+6*(e-t)*(2/3-i):t}var a,o="backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor",r=/^([\-+])=\s*(\d+\.?\d*)/,h=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,s,n){return new t.Color.fn.parse(e,i,s,n)},c={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={"byte":{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},d=l.support={},p=t("

        ")[0],f=t.each;p.style.cssText="background-color:rgba(1,1,1,.5)",d.rgba=p.style.backgroundColor.indexOf("rgba")>-1,f(c,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(n,o,r,h){if(n===e)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=t(n).css(o),o=e);var u=this,d=t.type(n),p=this._rgba=[];return o!==e&&(n=[n,o,r,h],d="array"),"string"===d?this.parse(s(n)||a._default):"array"===d?(f(c.rgba.props,function(t,e){p[e.idx]=i(n[e.idx],e)}),this):"object"===d?(n instanceof l?f(c,function(t,e){n[e.cache]&&(u[e.cache]=n[e.cache].slice())}):f(c,function(e,s){var a=s.cache;f(s.props,function(t,e){if(!u[a]&&s.to){if("alpha"===t||null==n[t])return;u[a]=s.to(u._rgba)}u[a][e.idx]=i(n[t],e,!0)}),u[a]&&0>t.inArray(null,u[a].slice(0,3))&&(u[a][3]=1,s.from&&(u._rgba=s.from(u[a])))}),this):e},is:function(t){var i=l(t),s=!0,n=this;return f(c,function(t,a){var o,r=i[a.cache];return r&&(o=n[a.cache]||a.to&&a.to(n._rgba)||[],f(a.props,function(t,i){return null!=r[i.idx]?s=r[i.idx]===o[i.idx]:e})),s}),s},_space:function(){var t=[],e=this;return f(c,function(i,s){e[s.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var s=l(t),n=s._space(),a=c[n],o=0===this.alpha()?l("transparent"):this,r=o[a.cache]||a.to(o._rgba),h=r.slice();return s=s[a.cache],f(a.props,function(t,n){var a=n.idx,o=r[a],l=s[a],c=u[n.type]||{};null!==l&&(null===o?h[a]=l:(c.mod&&(l-o>c.mod/2?o+=c.mod:o-l>c.mod/2&&(o-=c.mod)),h[a]=i((l-o)*e+o,n)))}),this[n](h)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),s=i.pop(),n=l(e)._rgba;return l(t.map(i,function(t,e){return(1-s)*n[e]+s*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&3>e&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),s=i.pop();return e&&i.push(~~(255*s)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,c.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,s=t[0]/255,n=t[1]/255,a=t[2]/255,o=t[3],r=Math.max(s,n,a),h=Math.min(s,n,a),l=r-h,c=r+h,u=.5*c;return e=h===r?0:s===r?60*(n-a)/l+360:n===r?60*(a-s)/l+120:60*(s-n)/l+240,i=0===l?0:.5>=u?l/c:l/(2-c),[Math.round(e)%360,i,u,null==o?1:o]},c.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],s=t[2],a=t[3],o=.5>=s?s*(1+i):s+i-s*i,r=2*s-o;return[Math.round(255*n(r,o,e+1/3)),Math.round(255*n(r,o,e)),Math.round(255*n(r,o,e-1/3)),a]},f(c,function(s,n){var a=n.props,o=n.cache,h=n.to,c=n.from;l.fn[s]=function(s){if(h&&!this[o]&&(this[o]=h(this._rgba)),s===e)return this[o].slice();var n,r=t.type(s),u="array"===r||"object"===r?s:arguments,d=this[o].slice();return f(a,function(t,e){var s=u["object"===r?t:e.idx];null==s&&(s=d[e.idx]),d[e.idx]=i(s,e)}),c?(n=l(c(d)),n[o]=d,n):l(d)},f(a,function(e,i){l.fn[e]||(l.fn[e]=function(n){var a,o=t.type(n),h="alpha"===e?this._hsla?"hsla":"rgba":s,l=this[h](),c=l[i.idx];return"undefined"===o?c:("function"===o&&(n=n.call(this,c),o=t.type(n)),null==n&&i.empty?this:("string"===o&&(a=r.exec(n),a&&(n=c+parseFloat(a[2])*("+"===a[1]?1:-1))),l[i.idx]=n,this[h](l)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,n){var a,o,r="";if("transparent"!==n&&("string"!==t.type(n)||(a=s(n)))){if(n=l(a||n),!d.rgba&&1!==n._rgba[3]){for(o="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&o&&o.style;)try{r=t.css(o,"backgroundColor"),o=o.parentNode}catch(h){}n=n.blend(r&&"transparent"!==r?r:"_default")}n=n.toRgbaString()}try{e.style[i]=n}catch(h){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook(o),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,s){e["border"+s+"Color"]=t}),e}},a=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(jQuery),function(){function i(e){var i,s,n=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,a={};if(n&&n.length&&n[0]&&n[n[0]])for(s=n.length;s--;)i=n[s],"string"==typeof n[i]&&(a[t.camelCase(i)]=n[i]);else for(i in n)"string"==typeof n[i]&&(a[i]=n[i]);return a}function s(e,i){var s,n,o={};for(s in i)n=i[s],e[s]!==n&&(a[s]||(t.fx.step[s]||!isNaN(parseFloat(n)))&&(o[s]=n));return o}var n=["add","remove","toggle"],a={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(jQuery.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(e,a,o,r){var h=t.speed(a,o,r);return this.queue(function(){var a,o=t(this),r=o.attr("class")||"",l=h.children?o.find("*").addBack():o;l=l.map(function(){var e=t(this);return{el:e,start:i(this)}}),a=function(){t.each(n,function(t,i){e[i]&&o[i+"Class"](e[i])})},a(),l=l.map(function(){return this.end=i(this.el[0]),this.diff=s(this.start,this.end),this}),o.attr("class",r),l=l.map(function(){var e=this,i=t.Deferred(),s=t.extend({},h,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,s),i.promise()}),t.when.apply(t,l.get()).done(function(){a(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),h.complete.call(o[0])})})},t.fn.extend({addClass:function(e){return function(i,s,n,a){return s?t.effects.animateClass.call(this,{add:i},s,n,a):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,s,n,a){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},s,n,a):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(i){return function(s,n,a,o,r){return"boolean"==typeof n||n===e?a?t.effects.animateClass.call(this,n?{add:s}:{remove:s},a,o,r):i.apply(this,arguments):t.effects.animateClass.call(this,{toggle:s},n,a,o)}}(t.fn.toggleClass),switchClass:function(e,i,s,n,a){return t.effects.animateClass.call(this,{add:i,remove:e},s,n,a)}})}(),function(){function s(e,i,s,n){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(n=i,s=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(n=s,s=i,i={}),t.isFunction(s)&&(n=s,s=null),i&&t.extend(e,i),s=s||i.duration,e.duration=t.fx.off?0:"number"==typeof s?s:s in t.fx.speeds?t.fx.speeds[s]:t.fx.speeds._default,e.complete=n||i.complete,e}function n(e){return!e||"number"==typeof e||t.fx.speeds[e]?!0:"string"!=typeof e||t.effects.effect[e]?t.isFunction(e)?!0:"object"!=typeof e||e.effect?!1:!0:!0}t.extend(t.effects,{version:"1.10.3",save:function(t,e){for(var s=0;e.length>s;s++)null!==e[s]&&t.data(i+e[s],t[0].style[e[s]])},restore:function(t,s){var n,a;for(a=0;s.length>a;a++)null!==s[a]&&(n=t.data(i+s[a]),n===e&&(n=""),t.css(s[a],n))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},getBaseline:function(t,e){var i,s;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":s=0;break;case"center":s=.5;break;case"right":s=1;break;default:s=t[1]/e.width}return{x:s,y:i}},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),"float":e.css("float")},s=t("

        ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),n={width:e.width(),height:e.height()},a=document.activeElement;try{a.id}catch(o){a=document.body}return e.wrap(s),(e[0]===a||t.contains(e[0],a))&&t(a).focus(),s=e.parent(),"static"===e.css("position")?(s.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,s){i[s]=e.css(s),isNaN(parseInt(i[s],10))&&(i[s]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(n),s.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).focus()),e},setTransition:function(e,i,s,n){return n=n||{},t.each(i,function(t,i){var a=e.cssUnit(i);a[0]>0&&(n[i]=a[0]*s+a[1])}),n}}),t.fn.extend({effect:function(){function e(e){function s(){t.isFunction(a)&&a.call(n[0]),t.isFunction(e)&&e()}var n=t(this),a=i.complete,r=i.mode;(n.is(":hidden")?"hide"===r:"show"===r)?(n[r](),s()):o.call(n[0],i,s)}var i=s.apply(this,arguments),n=i.mode,a=i.queue,o=t.effects.effect[i.effect];return t.fx.off||!o?n?this[n](i.duration,i.complete):this.each(function(){i.complete&&i.complete.call(this)}):a===!1?this.each(e):this.queue(a||"fx",e)},show:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="show",this.effect.call(this,i)}}(t.fn.show),hide:function(t){return function(e){if(n(e))return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="hide",this.effect.call(this,i)}}(t.fn.hide),toggle:function(t){return function(e){if(n(e)||"boolean"==typeof e)return t.apply(this,arguments);var i=s.apply(this,arguments);return i.mode="toggle",this.effect.call(this,i)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),s=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(s=[parseFloat(i),e])}),s}})}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;((e=Math.pow(2,--i))-1)/11>t;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return.5>t?i(2*t)/2:1-i(-2*t+2)/2}})}()})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.menu.min.js b/js/jquery/ui/jquery.ui.menu.min.js new file mode 100644 index 000000000..113d53fb1 --- /dev/null +++ b/js/jquery/ui/jquery.ui.menu.min.js @@ -0,0 +1,4 @@ +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){t.widget("ui.menu",{version:"1.10.3",defaultElement:"
          ",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a);return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){b(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted= -false;a.target==this._mouseDownEvent.target&&b.data(a.target,this.widgetName+".preventClickEvent",true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.position.min.js b/js/jquery/ui/jquery.ui.position.min.js old mode 100755 new mode 100644 index 42d93654d..9bd2ecd47 --- a/js/jquery/ui/jquery.ui.position.min.js +++ b/js/jquery/ui/jquery.ui.position.min.js @@ -1,16 +1,4 @@ -/* - * jQuery UI Position 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Position - */ -(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, -left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= -k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+(parseInt(c.curCSS(this,"marginRight",true))||0),w=m+q+(parseInt(c.curCSS(this,"marginBottom",true))||0),i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-= -m/2;i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= -d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= -a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), -g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("
          "),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.widths?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>m&&m>r(n+a)&&(h.vertical="middle"),h.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(C,{using:l}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-o-h,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-o-h,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-o-a,t.top+p+f+m>c&&(0>s||r(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,t.top+p+f+m>u&&(i>0||u>r(i))&&(t.top+=p+f+m))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.progressbar.min.js b/js/jquery/ui/jquery.ui.progressbar.min.js old mode 100755 new mode 100644 index b758ebaee..432ec0260 --- a/js/jquery/ui/jquery.ui.progressbar.min.js +++ b/js/jquery/ui/jquery.ui.progressbar.min.js @@ -1,16 +1,4 @@ -/* - * jQuery UI Progressbar 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar - * - * Depends: - * jquery.ui.core.js - * jquery.ui.widget.js - */ -(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
          ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); -this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* -this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggle(a>this.min).toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.16"})})(jQuery); +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t,e){t.widget("ui.progressbar",{version:"1.10.3",options:{max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min}),this.valueDiv=t("
          ").appendTo(this.element),this._refreshValue()},_destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"),this.valueDiv.remove()},value:function(t){return t===e?this.options.value:(this.options.value=this._constrainedValue(t),this._refreshValue(),e)},_constrainedValue:function(t){return t===e&&(t=this.options.value),this.indeterminate=t===!1,"number"!=typeof t&&(t=0),this.indeterminate?!1:Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).toggleClass("ui-corner-right",e===this.options.max).width(i.toFixed(0)+"%"),this.element.toggleClass("ui-progressbar-indeterminate",this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("
          ").appendTo(this.valueDiv))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.resizable.min.js b/js/jquery/ui/jquery.ui.resizable.min.js old mode 100755 new mode 100644 index d6b71b39f..1c29259e4 --- a/js/jquery/ui/jquery.ui.resizable.min.js +++ b/js/jquery/ui/jquery.ui.resizable.min.js @@ -1,49 +1,4 @@ -/* - * jQuery UI Resizable 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Resizables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(e){e.widget("ui.resizable",e.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var b=this,a=this.options;this.element.addClass("ui-resizable");e.extend(this,{_aspectRatio:!!a.aspectRatio,aspectRatio:a.aspectRatio,originalElement:this.element, -_proportionallyResizeElements:[],_helper:a.helper||a.ghost||a.animate?a.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&e.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(e('
          ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), -top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= -this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", -nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d
        ');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== -String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),l=0;l=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,l);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); -this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){if(!a.disabled){e(this).removeClass("ui-resizable-autohide");b._handles.show()}},function(){if(!a.disabled)if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy(); -var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a= -false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"}); -this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff= -{width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio:this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis]; -if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);this._updateVirtualBoundaries(b.shiftKey);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize",b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false}, -_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height;f=f?0:c.sizeDiff.width;f={width:c.helper.width()-f,height:c.helper.height()-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f, -{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",b);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(b){var a=this.options,c,d,f;a={minWidth:k(a.minWidth)?a.minWidth:0,maxWidth:k(a.maxWidth)?a.maxWidth:Infinity,minHeight:k(a.minHeight)?a.minHeight:0,maxHeight:k(a.maxHeight)?a.maxHeight: -Infinity};if(this._aspectRatio||b){b=a.minHeight*this.aspectRatio;d=a.minWidth/this.aspectRatio;c=a.maxHeight*this.aspectRatio;f=a.maxWidth/this.aspectRatio;if(b>a.minWidth)a.minWidth=b;if(d>a.minHeight)a.minHeight=d;if(cb.width,h=k(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height,l=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&l)b.left=i-a.minWidth;if(d&&l)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left= -null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a
        ');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+ -a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+ -c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]); -b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable,{version:"1.8.16"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(), -10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize,function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top- -f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var l=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:l.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n=(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(l.css("position"))){c._revertToRelativePosition=true;l.css({position:"absolute",top:"auto",left:"auto"})}l.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType? -e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition=false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a= -e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left-a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing, -step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize",b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement= -e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top","Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset; -var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset,f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left: -a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left=a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top- -d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition, -f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25, -display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative",height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b= -e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height= -d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},k=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(e){function t(e){return parseInt(e,10)||0}function i(e){return!isNaN(parseInt(e,10))}e.widget("ui.resizable",e.ui.mouse,{version:"1.10.3",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_create:function(){var t,i,s,n,a,o=this,r=this.options;if(this.element.addClass("ui-resizable"),e.extend(this,{_aspectRatio:!!r.aspectRatio,aspectRatio:r.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:r.helper||r.ghost||r.animate?r.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)&&(this.element.wrap(e("
        ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.data("ui-resizable")),this.elementIsWrapper=!0,this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")}),this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0}),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css({margin:this.originalElement.css("margin")}),this._proportionallyResize()),this.handles=r.handles||(e(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),t=this.handles.split(","),this.handles={},i=0;t.length>i;i++)s=e.trim(t[i]),a="ui-resizable-"+s,n=e("
        "),n.css({zIndex:r.zIndex}),"se"===s&&n.addClass("ui-icon ui-icon-gripsmall-diagonal-se"),this.handles[s]=".ui-resizable-"+s,this.element.append(n);this._renderAxis=function(t){var i,s,n,a;t=t||this.element;for(i in this.handles)this.handles[i].constructor===String&&(this.handles[i]=e(this.handles[i],this.element).show()),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)&&(s=e(this.handles[i],this.element),a=/sw|ne|nw|se|n|s/.test(i)?s.outerHeight():s.outerWidth(),n=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),t.css(n,a),this._proportionallyResize()),e(this.handles[i]).length},this._renderAxis(this.element),this._handles=e(".ui-resizable-handle",this.element).disableSelection(),this._handles.mouseover(function(){o.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),o.axis=n&&n[1]?n[1]:"se")}),r.autoHide&&(this._handles.hide(),e(this.element).addClass("ui-resizable-autohide").mouseenter(function(){r.disabled||(e(this).removeClass("ui-resizable-autohide"),o._handles.show())}).mouseleave(function(){r.disabled||o.resizing||(e(this).addClass("ui-resizable-autohide"),o._handles.hide())})),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,i=function(t){e(t).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").removeData("ui-resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_mouseCapture:function(t){var i,s,n=!1;for(i in this.handles)s=e(this.handles[i])[0],(s===t.target||e.contains(s,t.target))&&(n=!0);return!this.options.disabled&&n},_mouseStart:function(i){var s,n,a,o=this.options,r=this.element.position(),h=this.element;return this.resizing=!0,/absolute/.test(h.css("position"))?h.css({position:"absolute",top:h.css("top"),left:h.css("left")}):h.is(".ui-draggable")&&h.css({position:"absolute",top:r.top,left:r.left}),this._renderProxy(),s=t(this.helper.css("left")),n=t(this.helper.css("top")),o.containment&&(s+=e(o.containment).scrollLeft()||0,n+=e(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:s,top:n},this.size=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalSize=this._helper?{width:h.outerWidth(),height:h.outerHeight()}:{width:h.width(),height:h.height()},this.originalPosition={left:s,top:n},this.sizeDiff={width:h.outerWidth()-h.width(),height:h.outerHeight()-h.height()},this.originalMousePosition={left:i.pageX,top:i.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,a=e(".ui-resizable-"+this.axis).css("cursor"),e("body").css("cursor","auto"===a?this.axis+"-resize":a),h.addClass("ui-resizable-resizing"),this._propagate("start",i),!0},_mouseDrag:function(t){var i,s=this.helper,n={},a=this.originalMousePosition,o=this.axis,r=this.position.top,h=this.position.left,l=this.size.width,u=this.size.height,c=t.pageX-a.left||0,d=t.pageY-a.top||0,p=this._change[o];return p?(i=p.apply(this,[t,c,d]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),this.position.top!==r&&(n.top=this.position.top+"px"),this.position.left!==h&&(n.left=this.position.left+"px"),this.size.width!==l&&(n.width=this.size.width+"px"),this.size.height!==u&&(n.height=this.size.height+"px"),s.css(n),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),e.isEmptyObject(n)||this._trigger("resize",t,this.ui()),!1):!1},_mouseStop:function(t){this.resizing=!1;var i,s,n,a,o,r,h,l=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,s=i.length&&/textarea/i.test(i[0].nodeName),n=s&&e.ui.hasScroll(i[0],"left")?0:u.sizeDiff.height,a=s?0:u.sizeDiff.width,o={width:u.helper.width()-a,height:u.helper.height()-n},r=parseInt(u.element.css("left"),10)+(u.position.left-u.originalPosition.left)||null,h=parseInt(u.element.css("top"),10)+(u.position.top-u.originalPosition.top)||null,l.animate||this.element.css(e.extend(o,{top:h,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!l.animate&&this._proportionallyResize()),e("body").css("cursor","auto"),this.element.removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updateVirtualBoundaries:function(e){var t,s,n,a,o,r=this.options;o={minWidth:i(r.minWidth)?r.minWidth:0,maxWidth:i(r.maxWidth)?r.maxWidth:1/0,minHeight:i(r.minHeight)?r.minHeight:0,maxHeight:i(r.maxHeight)?r.maxHeight:1/0},(this._aspectRatio||e)&&(t=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,s=o.maxHeight*this.aspectRatio,a=o.maxWidth/this.aspectRatio,t>o.minWidth&&(o.minWidth=t),n>o.minHeight&&(o.minHeight=n),o.maxWidth>s&&(o.maxWidth=s),o.maxHeight>a&&(o.maxHeight=a)),this._vBoundaries=o},_updateCache:function(e){this.offset=this.helper.offset(),i(e.left)&&(this.position.left=e.left),i(e.top)&&(this.position.top=e.top),i(e.height)&&(this.size.height=e.height),i(e.width)&&(this.size.width=e.width)},_updateRatio:function(e){var t=this.position,s=this.size,n=this.axis;return i(e.height)?e.width=e.height*this.aspectRatio:i(e.width)&&(e.height=e.width/this.aspectRatio),"sw"===n&&(e.left=t.left+(s.width-e.width),e.top=null),"nw"===n&&(e.top=t.top+(s.height-e.height),e.left=t.left+(s.width-e.width)),e},_respectSize:function(e){var t=this._vBoundaries,s=this.axis,n=i(e.width)&&t.maxWidth&&t.maxWidthe.width,r=i(e.height)&&t.minHeight&&t.minHeight>e.height,h=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,u=/sw|nw|w/.test(s),c=/nw|ne|n/.test(s);return o&&(e.width=t.minWidth),r&&(e.height=t.minHeight),n&&(e.width=t.maxWidth),a&&(e.height=t.maxHeight),o&&u&&(e.left=h-t.minWidth),n&&u&&(e.left=h-t.maxWidth),r&&c&&(e.top=l-t.minHeight),a&&c&&(e.top=l-t.maxHeight),e.width||e.height||e.left||!e.top?e.width||e.height||e.top||!e.left||(e.left=null):e.top=null,e},_proportionallyResize:function(){if(this._proportionallyResizeElements.length){var e,t,i,s,n,a=this.helper||this.element;for(e=0;this._proportionallyResizeElements.length>e;e++){if(n=this._proportionallyResizeElements[e],!this.borderDif)for(this.borderDif=[],i=[n.css("borderTopWidth"),n.css("borderRightWidth"),n.css("borderBottomWidth"),n.css("borderLeftWidth")],s=[n.css("paddingTop"),n.css("paddingRight"),n.css("paddingBottom"),n.css("paddingLeft")],t=0;i.length>t;t++)this.borderDif[t]=(parseInt(i[t],10)||0)+(parseInt(s[t],10)||0);n.css({height:a.height()-this.borderDif[0]-this.borderDif[2]||0,width:a.width()-this.borderDif[1]-this.borderDif[3]||0})}}},_renderProxy:function(){var t=this.element,i=this.options;this.elementOffset=t.offset(),this._helper?(this.helper=this.helper||e("
        "),this.helper.addClass(this._helper).css({width:this.element.outerWidth()-1,height:this.element.outerHeight()-1,position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(e,t){return{width:this.originalSize.width+t}},w:function(e,t){var i=this.originalSize,s=this.originalPosition;return{left:s.left+t,width:i.width-t}},n:function(e,t,i){var s=this.originalSize,n=this.originalPosition;return{top:n.top+i,height:s.height-i}},s:function(e,t,i){return{height:this.originalSize.height+i}},se:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},sw:function(t,i,s){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,i,s]))},ne:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,i,s]))},nw:function(t,i,s){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,i,s]))}},_propagate:function(t,i){e.ui.plugin.call(this,t,[i,this.ui()]),"resize"!==t&&this._trigger(t,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),e.ui.plugin.add("resizable","animate",{stop:function(t){var i=e(this).data("ui-resizable"),s=i.options,n=i._proportionallyResizeElements,a=n.length&&/textarea/i.test(n[0].nodeName),o=a&&e.ui.hasScroll(n[0],"left")?0:i.sizeDiff.height,r=a?0:i.sizeDiff.width,h={width:i.size.width-r,height:i.size.height-o},l=parseInt(i.element.css("left"),10)+(i.position.left-i.originalPosition.left)||null,u=parseInt(i.element.css("top"),10)+(i.position.top-i.originalPosition.top)||null;i.element.animate(e.extend(h,u&&l?{top:u,left:l}:{}),{duration:s.animateDuration,easing:s.animateEasing,step:function(){var s={width:parseInt(i.element.css("width"),10),height:parseInt(i.element.css("height"),10),top:parseInt(i.element.css("top"),10),left:parseInt(i.element.css("left"),10)};n&&n.length&&e(n[0]).css({width:s.width,height:s.height}),i._updateCache(s),i._propagate("resize",t)}})}}),e.ui.plugin.add("resizable","containment",{start:function(){var i,s,n,a,o,r,h,l=e(this).data("ui-resizable"),u=l.options,c=l.element,d=u.containment,p=d instanceof e?d.get(0):/parent/.test(d)?c.parent().get(0):d;p&&(l.containerElement=e(p),/document/.test(d)||d===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}):(i=e(p),s=[],e(["Top","Right","Left","Bottom"]).each(function(e,n){s[e]=t(i.css("padding"+n))}),l.containerOffset=i.offset(),l.containerPosition=i.position(),l.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},n=l.containerOffset,a=l.containerSize.height,o=l.containerSize.width,r=e.ui.hasScroll(p,"left")?p.scrollWidth:o,h=e.ui.hasScroll(p)?p.scrollHeight:a,l.parentData={element:p,left:n.left,top:n.top,width:r,height:h}))},resize:function(t){var i,s,n,a,o=e(this).data("ui-resizable"),r=o.options,h=o.containerOffset,l=o.position,u=o._aspectRatio||t.shiftKey,c={top:0,left:0},d=o.containerElement;d[0]!==document&&/static/.test(d.css("position"))&&(c=h),l.left<(o._helper?h.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-h.left:o.position.left-c.left),u&&(o.size.height=o.size.width/o.aspectRatio),o.position.left=r.helper?h.left:0),l.top<(o._helper?h.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-h.top:o.position.top),u&&(o.size.width=o.size.height*o.aspectRatio),o.position.top=o._helper?h.top:0),o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top,i=Math.abs((o._helper?o.offset.left-c.left:o.offset.left-c.left)+o.sizeDiff.width),s=Math.abs((o._helper?o.offset.top-c.top:o.offset.top-h.top)+o.sizeDiff.height),n=o.containerElement.get(0)===o.element.parent().get(0),a=/relative|absolute/.test(o.containerElement.css("position")),n&&a&&(i-=o.parentData.left),i+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-i,u&&(o.size.height=o.size.width/o.aspectRatio)),s+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-s,u&&(o.size.width=o.size.height*o.aspectRatio))},stop:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.containerOffset,n=t.containerPosition,a=t.containerElement,o=e(t.helper),r=o.offset(),h=o.outerWidth()-t.sizeDiff.width,l=o.outerHeight()-t.sizeDiff.height;t._helper&&!i.animate&&/relative/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l}),t._helper&&!i.animate&&/static/.test(a.css("position"))&&e(this).css({left:r.left-n.left-s.left,width:h,height:l})}}),e.ui.plugin.add("resizable","alsoResize",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=function(t){e(t).each(function(){var t=e(this);t.data("ui-resizable-alsoresize",{width:parseInt(t.width(),10),height:parseInt(t.height(),10),left:parseInt(t.css("left"),10),top:parseInt(t.css("top"),10)})})};"object"!=typeof i.alsoResize||i.alsoResize.parentNode?s(i.alsoResize):i.alsoResize.length?(i.alsoResize=i.alsoResize[0],s(i.alsoResize)):e.each(i.alsoResize,function(e){s(e)})},resize:function(t,i){var s=e(this).data("ui-resizable"),n=s.options,a=s.originalSize,o=s.originalPosition,r={height:s.size.height-a.height||0,width:s.size.width-a.width||0,top:s.position.top-o.top||0,left:s.position.left-o.left||0},h=function(t,s){e(t).each(function(){var t=e(this),n=e(this).data("ui-resizable-alsoresize"),a={},o=s&&s.length?s:t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(o,function(e,t){var i=(n[t]||0)+(r[t]||0);i&&i>=0&&(a[t]=i||null)}),t.css(a)})};"object"!=typeof n.alsoResize||n.alsoResize.nodeType?h(n.alsoResize):e.each(n.alsoResize,function(e,t){h(e,t)})},stop:function(){e(this).removeData("resizable-alsoresize")}}),e.ui.plugin.add("resizable","ghost",{start:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:s.height,width:s.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass("string"==typeof i.ghost?i.ghost:""),t.ghost.appendTo(t.helper)},resize:function(){var t=e(this).data("ui-resizable");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=e(this).data("ui-resizable");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),e.ui.plugin.add("resizable","grid",{resize:function(){var t=e(this).data("ui-resizable"),i=t.options,s=t.size,n=t.originalSize,a=t.originalPosition,o=t.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,u=Math.round((s.width-n.width)/h)*h,c=Math.round((s.height-n.height)/l)*l,d=n.width+u,p=n.height+c,f=i.maxWidth&&d>i.maxWidth,m=i.maxHeight&&p>i.maxHeight,g=i.minWidth&&i.minWidth>d,v=i.minHeight&&i.minHeight>p;i.grid=r,g&&(d+=h),v&&(p+=l),f&&(d-=h),m&&(p-=l),/^(se|s|e)$/.test(o)?(t.size.width=d,t.size.height=p):/^(ne)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.top=a.top-c):/^(sw)$/.test(o)?(t.size.width=d,t.size.height=p,t.position.left=a.left-u):(t.size.width=d,t.size.height=p,t.position.top=a.top-c,t.position.left=a.left-u)}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.selectable.min.js b/js/jquery/ui/jquery.ui.selectable.min.js old mode 100755 new mode 100644 index 3c600af0a..2ac1c60c7 --- a/js/jquery/ui/jquery.ui.selectable.min.js +++ b/js/jquery/ui/jquery.ui.selectable.min.js @@ -1,22 +1,4 @@ -/* - * jQuery UI Selectable 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), -selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
        ")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, -c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", -c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= -this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom
        ")},_destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled"),this._mouseDestroy()},_mouseStart:function(t){var i=this,s=this.options;this.opos=[t.pageX,t.pageY],this.options.disabled||(this.selectees=e(s.filter,this.element[0]),this._trigger("start",t),e(s.appendTo).append(this.helper),this.helper.css({left:t.pageX,top:t.pageY,width:0,height:0}),s.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var s=e.data(this,"selectable-item");s.startselected=!0,t.metaKey||t.ctrlKey||(s.$element.removeClass("ui-selected"),s.selected=!1,s.$element.addClass("ui-unselecting"),s.unselecting=!0,i._trigger("unselecting",t,{unselecting:s.element}))}),e(t.target).parents().addBack().each(function(){var s,n=e.data(this,"selectable-item");return n?(s=!t.metaKey&&!t.ctrlKey||!n.$element.hasClass("ui-selected"),n.$element.removeClass(s?"ui-unselecting":"ui-selected").addClass(s?"ui-selecting":"ui-unselecting"),n.unselecting=!s,n.selecting=s,n.selected=s,s?i._trigger("selecting",t,{selecting:n.element}):i._trigger("unselecting",t,{unselecting:n.element}),!1):undefined}))},_mouseDrag:function(t){if(this.dragged=!0,!this.options.disabled){var i,s=this,n=this.options,a=this.opos[0],o=this.opos[1],r=t.pageX,h=t.pageY;return a>r&&(i=r,r=a,a=i),o>h&&(i=h,h=o,o=i),this.helper.css({left:a,top:o,width:r-a,height:h-o}),this.selectees.each(function(){var i=e.data(this,"selectable-item"),l=!1;i&&i.element!==s.element[0]&&("touch"===n.tolerance?l=!(i.left>r||a>i.right||i.top>h||o>i.bottom):"fit"===n.tolerance&&(l=i.left>a&&r>i.right&&i.top>o&&h>i.bottom),l?(i.selected&&(i.$element.removeClass("ui-selected"),i.selected=!1),i.unselecting&&(i.$element.removeClass("ui-unselecting"),i.unselecting=!1),i.selecting||(i.$element.addClass("ui-selecting"),i.selecting=!0,s._trigger("selecting",t,{selecting:i.element}))):(i.selecting&&((t.metaKey||t.ctrlKey)&&i.startselected?(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.$element.addClass("ui-selected"),i.selected=!0):(i.$element.removeClass("ui-selecting"),i.selecting=!1,i.startselected&&(i.$element.addClass("ui-unselecting"),i.unselecting=!0),s._trigger("unselecting",t,{unselecting:i.element}))),i.selected&&(t.metaKey||t.ctrlKey||i.startselected||(i.$element.removeClass("ui-selected"),i.selected=!1,i.$element.addClass("ui-unselecting"),i.unselecting=!0,s._trigger("unselecting",t,{unselecting:i.element})))))}),!1}},_mouseStop:function(t){var i=this;return this.dragged=!1,e(".ui-unselecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-unselecting"),s.unselecting=!1,s.startselected=!1,i._trigger("unselected",t,{unselected:s.element})}),e(".ui-selecting",this.element[0]).each(function(){var s=e.data(this,"selectable-item");s.$element.removeClass("ui-selecting").addClass("ui-selected"),s.selecting=!1,s.selected=!0,s.startselected=!0,i._trigger("selected",t,{selected:s.element})}),this._trigger("stop",t),this.helper.remove(),!1}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.slider.min.js b/js/jquery/ui/jquery.ui.slider.min.js old mode 100755 new mode 100644 index cc8dee1fe..7e3192721 --- a/js/jquery/ui/jquery.ui.slider.min.js +++ b/js/jquery/ui/jquery.ui.slider.min.js @@ -1,33 +1,4 @@ -/* - * jQuery UI Slider 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Slider - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.slider",d.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var a=this,b=this.options,c=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=b.values&&b.values.length||1,e=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+ -this.orientation+" ui-widget ui-widget-content ui-corner-all"+(b.disabled?" ui-slider-disabled ui-disabled":""));this.range=d([]);if(b.range){if(b.range===true){if(!b.values)b.values=[this._valueMin(),this._valueMin()];if(b.values.length&&b.values.length!==2)b.values=[b.values[0],b.values[0]]}this.range=d("
        ").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(b.range==="min"||b.range==="max"?" ui-slider-range-"+b.range:""))}for(var j=c.length;j"); -this.handles=c.add(d(e.join("")).appendTo(a.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(g){g.preventDefault()}).hover(function(){b.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(b.disabled)d(this).blur();else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(g){d(this).data("index.ui-slider-handle", -g)});this.handles.keydown(function(g){var k=true,l=d(this).data("index.ui-slider-handle"),i,h,m;if(!a.options.disabled){switch(g.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:k=false;if(!a._keySliding){a._keySliding=true;d(this).addClass("ui-state-active");i=a._start(g,l);if(i===false)return}break}m=a.options.step;i=a.options.values&&a.options.values.length? -(h=a.values(l)):(h=a.value());switch(g.keyCode){case d.ui.keyCode.HOME:h=a._valueMin();break;case d.ui.keyCode.END:h=a._valueMax();break;case d.ui.keyCode.PAGE_UP:h=a._trimAlignValue(i+(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:h=a._trimAlignValue(i-(a._valueMax()-a._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(i===a._valueMax())return;h=a._trimAlignValue(i+m);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(i===a._valueMin())return;h=a._trimAlignValue(i- -m);break}a._slide(g,l,h);return k}}).keyup(function(g){var k=d(this).data("index.ui-slider-handle");if(a._keySliding){a._keySliding=false;a._stop(g,k);a._change(g,k);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy(); -return this},_mouseCapture:function(a){var b=this.options,c,f,e,j,g;if(b.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:a.pageX,y:a.pageY});f=this._valueMax()-this._valueMin()+1;j=this;this.handles.each(function(k){var l=Math.abs(c-j.values(k));if(f>l){f=l;e=d(this);g=k}});if(b.range===true&&this.values(1)===b.min){g+=1;e=d(this.handles[g])}if(this._start(a,g)===false)return false; -this._mouseSliding=true;j._handleIndex=g;e.addClass("ui-state-active").focus();b=e.offset();this._clickOffset=!d(a.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:a.pageX-b.left-e.width()/2,top:a.pageY-b.top-e.height()/2-(parseInt(e.css("borderTopWidth"),10)||0)-(parseInt(e.css("borderBottomWidth"),10)||0)+(parseInt(e.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(a,g,c);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(a){var b= -this._normValueFromMouse({x:a.pageX,y:a.pageY});this._slide(a,this._handleIndex,b);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(a){var b;if(this.orientation==="horizontal"){b= -this.elementSize.width;a=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;a=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}b=a/b;if(b>1)b=1;if(b<0)b=0;if(this.orientation==="vertical")b=1-b;a=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+b*a)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b); -c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var f;if(this.options.values&&this.options.values.length){f=this.values(b?0:1);if(this.options.values.length===2&&this.options.range===true&&(b===0&&c>f||b===1&&c1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}else if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;f=arguments[0];for(e=0;e=this._valueMax())return this._valueMax();var b=this.options.step>0?this.options.step:1,c=(a-this._valueMin())%b;a=a-c;if(Math.abs(c)*2>=b)a+=c>0?b:-b;return parseFloat(a.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a= -this.options.range,b=this.options,c=this,f=!this._animateOff?b.animate:false,e,j={},g,k,l,i;if(this.options.values&&this.options.values.length)this.handles.each(function(h){e=(c.values(h)-c._valueMin())/(c._valueMax()-c._valueMin())*100;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";d(this).stop(1,1)[f?"animate":"css"](j,b.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(h===0)c.range.stop(1,1)[f?"animate":"css"]({left:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({width:e- -g+"%"},{queue:false,duration:b.animate})}else{if(h===0)c.range.stop(1,1)[f?"animate":"css"]({bottom:e+"%"},b.animate);if(h===1)c.range[f?"animate":"css"]({height:e-g+"%"},{queue:false,duration:b.animate})}g=e});else{k=this.value();l=this._valueMin();i=this._valueMax();e=i!==l?(k-l)/(i-l)*100:0;j[c.orientation==="horizontal"?"left":"bottom"]=e+"%";this.handle.stop(1,1)[f?"animate":"css"](j,b.animate);if(a==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:e+"%"}, -b.animate);if(a==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-e+"%"},{queue:false,duration:b.animate});if(a==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:e+"%"},b.animate);if(a==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-e+"%"},{queue:false,duration:b.animate})}}});d.extend(d.ui.slider,{version:"1.8.16"})})(jQuery); +/*! jQuery UI - v1.10.3 - 2013-05-03 +* http://jqueryui.com +* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ +(function(t){var e=5;t.widget("ui.slider",t.ui.mouse,{version:"1.10.3",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget"+" ui-widget-content"+" ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,s=this.options,n=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a="",o=[];for(i=s.values&&s.values.length||1,n.length>i&&(n.slice(i).remove(),n=n.slice(0,i)),e=n.length;i>e;e++)o.push(a);this.handles=n.add(t(o.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,i="";e.range?(e.range===!0&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=t("
        ").appendTo(this.element),i="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(i+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):this.range=t([])},_setupEvents:function(){var t=this.handles.add(this.range).filter("a");this._off(t),this._on(t,this._handleEvents),this._hoverable(t),this._focusable(t)},_destroy:function(){this.handles.remove(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var i,s,n,a,o,r,h,l,u=this,c=this.options;return c.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},s=this._normValueFromMouse(i),n=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(s-u.values(e));(n>i||n===i&&(e===u._lastChangedValue||u.values(e)===c.min))&&(n=i,a=t(this),o=e)}),r=this._start(e,o),r===!1?!1:(this._mouseSliding=!0,this._handleIndex=o,a.addClass("ui-state-active").focus(),h=a.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-h.left-a.width()/2,top:e.pageY-h.top-a.height()/2-(parseInt(a.css("borderTopWidth"),10)||0)-(parseInt(a.css("borderBottomWidth"),10)||0)+(parseInt(a.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,o,s),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,s,n,a;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),s=i/e,s>1&&(s=1),0>s&&(s=0),"vertical"===this.orientation&&(s=1-s),n=this._valueMax()-this._valueMin(),a=this._valueMin()+s*n,this._trimAlignValue(a)},_start:function(t,e){var i={handle:this.handles[e],value:this.value()};return this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("start",t,i)},_slide:function(t,e,i){var s,n,a;this.options.values&&this.options.values.length?(s=this.values(e?0:1),2===this.options.values.length&&this.options.range===!0&&(0===e&&i>s||1===e&&s>i)&&(i=s),i!==this.values(e)&&(n=this.values(),n[e]=i,a=this._trigger("slide",t,{handle:this.handles[e],value:i,values:n}),s=this.values(e?0:1),a!==!1&&this.values(e,i,!0))):i!==this.value()&&(a=this._trigger("slide",t,{handle:this.handles[e],value:i}),a!==!1&&this.value(i))},_stop:function(t,e){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._trigger("stop",t,i)},_change:function(t,e){if(!this._keySliding&&!this._mouseSliding){var i={handle:this.handles[e],value:this.value()};this.options.values&&this.options.values.length&&(i.value=this.values(e),i.values=this.values()),this._lastChangedValue=e,this._trigger("change",t,i)}},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),this._change(null,0),undefined):this._value()},values:function(e,i){var s,n,a;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),this._change(null,e),undefined;if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(e):this.value();for(s=this.options.values,n=arguments[0],a=0;s.length>a;a+=1)s[a]=this._trimAlignValue(n[a]),this._change(null,a);this._refreshValue()},_setOption:function(e,i){var s,n=0;switch("range"===e&&this.options.range===!0&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(n=this.options.values.length),t.Widget.prototype._setOption.apply(this,arguments),e){case"orientation":this._detectOrientation(),this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation),this._refreshValue();break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),s=0;n>s;s+=1)this._change(null,s);this._animateOff=!1;break;case"min":case"max":this._animateOff=!0,this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,s;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this.options.values&&this.options.values.length){for(i=this.options.values.slice(),s=0;i.length>s;s+=1)i[s]=this._trimAlignValue(i[s]);return i}return[]},_trimAlignValue:function(t){if(this._valueMin()>=t)return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,s=t-i;return 2*Math.abs(i)>=e&&(s+=i>0?e:-e),parseFloat(s.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var e,i,s,n,a,o=this.options.range,r=this.options,h=this,l=this._animateOff?!1:r.animate,u={};this.options.values&&this.options.values.length?this.handles.each(function(s){i=100*((h.values(s)-h._valueMin())/(h._valueMax()-h._valueMin())),u["horizontal"===h.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[l?"animate":"css"](u,r.animate),h.options.range===!0&&("horizontal"===h.orientation?(0===s&&h.range.stop(1,1)[l?"animate":"css"]({left:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===s&&h.range.stop(1,1)[l?"animate":"css"]({bottom:i+"%"},r.animate),1===s&&h.range[l?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(s=this.value(),n=this._valueMin(),a=this._valueMax(),i=a!==n?100*((s-n)/(a-n)):0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[l?"animate":"css"](u,r.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({width:i+"%"},r.animate),"max"===o&&"horizontal"===this.orientation&&this.range[l?"animate":"css"]({width:100-i+"%"},{queue:!1,duration:r.animate}),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[l?"animate":"css"]({height:i+"%"},r.animate),"max"===o&&"vertical"===this.orientation&&this.range[l?"animate":"css"]({height:100-i+"%"},{queue:!1,duration:r.animate}))},_handleEvents:{keydown:function(i){var s,n,a,o,r=t(i.target).data("ui-slider-handle-index");switch(i.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i.preventDefault(),!this._keySliding&&(this._keySliding=!0,t(i.target).addClass("ui-state-active"),s=this._start(i,r),s===!1))return}switch(o=this.options.step,n=a=this.options.values&&this.options.values.length?this.values(r):this.value(),i.keyCode){case t.ui.keyCode.HOME:a=this._valueMin();break;case t.ui.keyCode.END:a=this._valueMax();break;case t.ui.keyCode.PAGE_UP:a=this._trimAlignValue(n+(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.PAGE_DOWN:a=this._trimAlignValue(n-(this._valueMax()-this._valueMin())/e);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(n===this._valueMax())return;a=this._trimAlignValue(n+o);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(n===this._valueMin())return;a=this._trimAlignValue(n-o)}this._slide(i,r,a)},click:function(t){t.preventDefault()},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),t(e.target).removeClass("ui-state-active"))}}})})(jQuery); \ No newline at end of file diff --git a/js/jquery/ui/jquery.ui.sortable.min.js b/js/jquery/ui/jquery.ui.sortable.min.js old mode 100755 new mode 100644 index d0ad528df..1a84db7ae --- a/js/jquery/ui/jquery.ui.sortable.min.js +++ b/js/jquery/ui/jquery.ui.sortable.min.js @@ -1,60 +1,4 @@ -/* - * jQuery UI Sortable 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Sortables - * - * Depends: - * jquery.ui.core.js - * jquery.ui.mouse.js - * jquery.ui.widget.js - */ -(function(d){d.widget("ui.sortable",d.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var a=this.options;this.containerCache={};this.element.addClass("ui-sortable"); -this.refresh();this.floating=this.items.length?a.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a=== -"disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&& -!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem=c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top, -left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]}; -this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment();if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!= -document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a); -return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0], -e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a,c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset(); -c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"): -this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null, -dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem):d(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")}, -toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute||"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")},_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith(); -if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!=this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), -this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a=this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable");if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h=0;b--){var c=this.items[b];if(!(c.instance!=this.currentContainer&&this.currentContainer&&c.item[0]!=this.currentItem[0])){var e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b= -this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width=this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f= -d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f},update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")|| -0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b=null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out", -a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this));this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h- -f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g- -this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive",g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this, -this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over=0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop", -a,this._uiHash());for(e=0;ee&&e+i>t}function i(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))}t.widget("ui.sortable",t.ui.mouse,{version:"1.10.3",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var t=this.options;this.containerCache={},this.element.addClass("ui-sortable"),this.refresh(),this.floating=this.items.length?"x"===t.axis||i(this.items[0].item):!1,this.offset=this.element.offset(),this._mouseInit(),this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled"),this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_setOption:function(e,i){"disabled"===e?(this.options[e]=i,this.widget().toggleClass("ui-sortable-disabled",!!i)):t.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(e,i){var s=null,n=!1,a=this;return this.reverting?!1:this.options.disabled||"static"===this.options.type?!1:(this._refreshItems(e),t(e.target).parents().each(function(){return t.data(this,a.widgetName+"-item")===a?(s=t(this),!1):undefined}),t.data(e.target,a.widgetName+"-item")===a&&(s=t(e.target)),s?!this.options.handle||i||(t(this.options.handle,s).find("*").addBack().each(function(){this===e.target&&(n=!0)}),n)?(this.currentItem=s,this._removeCurrentsFromItems(),!0):!1:!1)},_mouseStart:function(e,i,s){var n,a,o=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),this._cacheHelperProportions(),this._cacheMargins(),this.scrollParent=this.helper.scrollParent(),this.offset=this.currentItem.offset(),this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()}),this.helper.css("position","absolute"),this.cssPosition=this.helper.css("position"),this.originalPosition=this._generatePosition(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),o.containment&&this._setContainment(),o.cursor&&"auto"!==o.cursor&&(a=this.document.find("body"),this.storedCursor=a.css("cursor"),a.css("cursor",o.cursor),this.storedStylesheet=t("").appendTo(a)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!s)for(n=this.containers.length-1;n>=0;n--)this.containers[n]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!o.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this.helper.addClass("ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,s,n,a,o=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==document&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY=0;i--)if(s=this.items[i],n=s.item[0],a=this._intersectsWithPointer(s),a&&s.instance===this.currentContainer&&n!==this.currentItem[0]&&this.placeholder[1===a?"next":"prev"]()[0]!==n&&!t.contains(this.placeholder[0],n)&&("semi-dynamic"===this.options.type?!t.contains(this.element[0],n):!0)){if(this.direction=1===a?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(s))break;this._rearrange(e,s),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var s=this,n=this.placeholder.offset(),a=this.options.axis,o={};a&&"x"!==a||(o.left=n.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft)),a&&"y"!==a||(o.top=n.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){s._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp({target:null}),"original"===this.options.helper?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&s.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!s.length&&e.key&&s.push(e.key+"="),s.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),s=[];return e=e||{},i.each(function(){s.push(t(e.item||this).attr(e.attribute||"id")||"")}),s},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,s=this.positionAbs.top,n=s+this.helperProportions.height,a=t.left,o=a+t.width,r=t.top,h=r+t.height,l=this.offset.click.top,c=this.offset.click.left,u="x"===this.options.axis||s+l>r&&h>s+l,d="y"===this.options.axis||e+c>a&&o>e+c,p=u&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?p:e+this.helperProportions.width/2>a&&o>i-this.helperProportions.width/2&&s+this.helperProportions.height/2>r&&h>n-this.helperProportions.height/2},_intersectsWithPointer:function(t){var i="x"===this.options.axis||e(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||e(this.positionAbs.left+this.offset.click.left,t.left,t.width),n=i&&s,a=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return n?this.floating?o&&"right"===o||"down"===a?2:1:a&&("down"===a?2:1):!1},_intersectsWithSides:function(t){var i=e(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),s=e(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),a=this._getDragHorizontalDirection();return this.floating&&a?"right"===a&&s||"left"===a&&!s:n&&("down"===n&&i||"up"===n&&!i)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){var i,s,n,a,o=[],r=[],h=this._connectWith();if(h&&e)for(i=h.length-1;i>=0;i--)for(n=t(h[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&r.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(r.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),i=r.length-1;i>=0;i--)r[i][0].each(function(){o.push(this)});return t(o)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;e.length>i;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,s,n,a,o,r,h,l,c=this.items,u=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(n=t(d[i]),s=n.length-1;s>=0;s--)a=t.data(n[s],this.widgetFullName),a&&a!==this&&!a.options.disabled&&(u.push([t.isFunction(a.options.items)?a.options.items.call(a.element[0],e,{item:this.currentItem}):t(a.options.items,a.element),a]),this.containers.push(a));for(i=u.length-1;i>=0;i--)for(o=u[i][1],r=u[i][0],s=0,l=r.length;l>s;s++)h=t(r[s]),h.data(this.widgetName+"-item",o),c.push({item:h,instance:o,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,s,n,a;for(i=this.items.length-1;i>=0;i--)s=this.items[i],s.instance!==this.currentContainer&&this.currentContainer&&s.item[0]!==this.currentItem[0]||(n=this.options.toleranceElement?t(this.options.toleranceElement,s.item):s.item,e||(s.width=n.outerWidth(),s.height=n.outerHeight()),a=n.offset(),s.left=a.left,s.top=a.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)a=this.containers[i].element.offset(),this.containers[i].containerCache.left=a.left,this.containers[i].containerCache.top=a.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,s=e.options;s.placeholder&&s.placeholder.constructor!==String||(i=s.placeholder,s.placeholder={element:function(){var s=e.currentItem[0].nodeName.toLowerCase(),n=t("<"+s+">",e.document[0]).addClass(i||e.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");return"tr"===s?e.currentItem.children().each(function(){t("
         
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihre Konto-Login-Details
         
        E-Mail-Adresse: {email}
        Kennwort: {passwd}
         
        Sicherheitstipps:

        Schützen Sie Ihre Kontodetails.
        Geben Sie Ihre Login-Details nicht an Dritte weiter.
        Ändern Sie Ihr Kennwort regelmäßig.
        Falls Sie vermuten, dass jemand Ihr Konto unerlaubt benutzt, benachrichtigen Sie uns bitte sofort.
         
        Sie können nun Bestellungen auf unserer Webseite vornehmen: {shop_name}.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/account.txt b/mails/de/account.txt deleted file mode 100644 index cbf70afd5..000000000 --- a/mails/de/account.txt +++ /dev/null @@ -1,18 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihre Konto-Login-Details - -E-Mail-Adresse: {email} -Kennwort: {passwd} - -Sicherheitstipps: - -* Schützen Sie Ihre Kontodetails. -* Geben Sie Ihre Login-Details nicht an Dritte weiter. -* Ändern Sie Ihr Kennwort regelmäßig. -* Falls Sie vermuten, dass jemand Ihr Konto unerlaubt benutzt, benachrichtigen Sie uns bitte sofort. - -Sie können nun Bestellungen auf unserer Webseite vornehmen: {shop_name}. - -{shop_name} powered with PrestaShop™ - diff --git a/mails/de/backoffice_order.html b/mails/de/backoffice_order.html deleted file mode 100644 index 71147f705..000000000 --- a/mails/de/backoffice_order.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hi {firstname} {lastname},
         
        A new command has been generated to you.
         
        Go on {order_link} to finalize the payment.
         
        {shop_name} powered by PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/backoffice_order.txt b/mails/de/backoffice_order.txt deleted file mode 100644 index 8f38f4ba0..000000000 --- a/mails/de/backoffice_order.txt +++ /dev/null @@ -1,9 +0,0 @@ -Hi {firstname} {lastname}, - -A new command has been generated to you. - -Go on {order_link} to finalize the payment. - -{shop_name} - {shop_url} - -{shop_url} réalisé par PrestaShop™ diff --git a/mails/de/bankwire.html b/mails/de/bankwire.html deleted file mode 100644 index 8ac1e9d08..000000000 --- a/mails/de/bankwire.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihre Bestellung Nr.{order_name}
         
        Ihre Bestellung wurde erfolgreich aufgenommen und wird, sobald die Zahlung eingegangen ist, versendet.
         
        Bitte beachten Sie, dass Sie die Banküberweisung für Ihre Zahlung gewählt haben. Bitte senden Sie Ihre Banküberweisung an:

        {bankwire_owner}

        {bankwire_details}

        {bankwire_address}

        Der Gesamtbetrag der Bestellung ist {total_paid}
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/bankwire.txt b/mails/de/bankwire.txt deleted file mode 100644 index 824f4cb1e..000000000 --- a/mails/de/bankwire.txt +++ /dev/null @@ -1,20 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihre Bestellung Nr.{order_name} Verlauf - -Ihre Bestellung wurde erfolgreich aufgenommen und wird, sobald die Zahlung eingegangen ist, versendet. - -Bitte beachten Sie, dass Sie die Banküberweisung für Ihre Zahlung gewählt haben. Bitte senden Sie Ihre Banküberweisung an: - -{bankwire_owner} - -{bankwire_details} - -{bankwire_address} - -Der Gesamtbetrag der Bestellung ist {total_paid} - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/cheque.html b/mails/de/cheque.html deleted file mode 100644 index dcae38ab2..000000000 --- a/mails/de/cheque.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihr Bestellverlauf {order_name}
         
        Ihre Bestellung wurde erfolgreich aufgenommen und wird, sobald die Zahlung eingegangen ist, versendet.
         
        Bitte beachten Sie, dass Sie die Zahlung per Scheck gewählt haben. Bitte senden Sie Ihren Scheck an:

        - ein Betrag über {total_paid}

        - zahlbar an {cheque_name}

        - Adresse {cheque_address_html}
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/cheque.txt b/mails/de/cheque.txt deleted file mode 100644 index 07627441b..000000000 --- a/mails/de/cheque.txt +++ /dev/null @@ -1,18 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihr Bestellverlauf {order_name} - -Ihre Bestellung wurde erfolgreich aufgenommen und wird, sobald die Zahlung eingegangen ist, versendet. - -Bitte beachten Sie, dass Sie die Zahlung per Scheck gewählt haben. Bitte senden Sie Ihren Scheck an: - -- ein Betrag über {total_paid} - -- zahlbar an {cheque_name} - -- Adresse {cheque_address_html} - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/contact.html b/mails/de/contact.html deleted file mode 100644 index 112b08e55..000000000 --- a/mails/de/contact.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Nachricht von Ihrem Shop {shop_name}
         
        E-Mail-Adresse: {email}

        Nachricht: {message}
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/contact.txt b/mails/de/contact.txt deleted file mode 100644 index 588cf1429..000000000 --- a/mails/de/contact.txt +++ /dev/null @@ -1,7 +0,0 @@ -Nachricht von Ihrem Shop {shop_name} - -E-Mail-Adresse: {email} - -Nachricht: {message} - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/contact_form.html b/mails/de/contact_form.html deleted file mode 100644 index f241a214f..000000000 --- a/mails/de/contact_form.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Ihre Nachricht wurde korrekt an unseren Kundendienst weitergeleitet.
         
        Ihre Nachricht: {message}
         
        Wir werden so schnell wie möglich antworten.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/contact_form.txt b/mails/de/contact_form.txt deleted file mode 100644 index 34b119529..000000000 --- a/mails/de/contact_form.txt +++ /dev/null @@ -1,7 +0,0 @@ -Ihre Nachricht wurde korrekt an unseren Kundendienst weitergeleitet. - -Ihre Nachricht: {message} - -Wir werden so schnell wie möglich antworten. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/credit_slip.html b/mails/de/credit_slip.html deleted file mode 100644 index 8b4320ee7..000000000 --- a/mails/de/credit_slip.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihre Bestellung Nr.{id_order}
         
        Damit werden Sie über die Erstellung eines Gutscheins auf Ihren Namen nach Ihrer Bestellung Nr. {id_order} informiert.
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverfolgung" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/credit_slip.txt b/mails/de/credit_slip.txt deleted file mode 100644 index ea19637c1..000000000 --- a/mails/de/credit_slip.txt +++ /dev/null @@ -1,9 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihre Bestellung Nr.{id_order} - -Damit werden Sie über die Erstellung eines Gutscheins auf Ihren Namen nach Ihrer Bestellung Nr. {id_order} informiert. - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverfolgung" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/download-product.tpl b/mails/de/download-product.tpl deleted file mode 100644 index e3ceccc3a..000000000 --- a/mails/de/download-product.tpl +++ /dev/null @@ -1,13 +0,0 @@ -
        \ No newline at end of file diff --git a/mails/de/download_product.html b/mails/de/download_product.html deleted file mode 100644 index 8f2d3ecb7..000000000 --- a/mails/de/download_product.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname}, danke für Ihren Einkauf bei {shop_name}.
         
        Produkt (e) zum Download
         
        Es liegen für Sie {nbProducts} Produkt (e) zum Download bereit.
         
        Hier sind direkte Links zu diesen Produkten: {virtualProducts}
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/download_product.txt b/mails/de/download_product.txt deleted file mode 100644 index b812a0159..000000000 --- a/mails/de/download_product.txt +++ /dev/null @@ -1,12 +0,0 @@ -Hallo {firstname} {lastname}, danke für Ihren Einkauf bei {shop_name}. - -Produkt (e) zum Download - -Es liegen für Sie {nbProducts} Produkt (e) zum Download bereit. - -Hier sind direkte Links zu diesen Produkten: {virtualProducts} - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/employee_password.html b/mails/de/employee_password.html deleted file mode 100644 index 32e042b3c..000000000 --- a/mails/de/employee_password.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihre persönlichen Login-Daten
         
        Vorname: {firstname}
        Nachname: {lastname}
        Kennwort: {passwd}
        E-Mail-Adresse: {email}
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/employee_password.txt b/mails/de/employee_password.txt deleted file mode 100644 index 2b71efd2d..000000000 --- a/mails/de/employee_password.txt +++ /dev/null @@ -1,10 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihre persönlichen Login-Daten - -Vorname: {firstname} -Nachname: {lastname} -Kennwort: {passwd} -E-Mail-Adresse: {email} - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/forward_msg.html b/mails/de/forward_msg.html deleted file mode 100644 index 48f011bee..000000000 --- a/mails/de/forward_msg.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - -
        {employee} wollte Ihnen diesen Chat weiterleiten.

        {messages}

        {employee} fügte"{comment}" hinzu.
        - - \ No newline at end of file diff --git a/mails/de/forward_msg.txt b/mails/de/forward_msg.txt deleted file mode 100644 index dd1b9ed73..000000000 --- a/mails/de/forward_msg.txt +++ /dev/null @@ -1,4 +0,0 @@ -{employee} wollte Ihnen diesen Chat weiterleiten. -Kommentar: {comment} - -{messages} diff --git a/mails/de/guest_to_customer.html b/mails/de/guest_to_customer.html deleted file mode 100644 index ef792b505..000000000 --- a/mails/de/guest_to_customer.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihr Gast-Konto wurde in ein Kunden-Konto umgewandelt
         
        E-Mail-Adresse: {email}
        Kennword: {passwd}
         
        Bitte seien Sie vorsichtig bei der gemeinsamen Nutzung dieser Login-Daten mit anderen.

        Sie können auf Ihr Konto auf unserer Webseite zugreifen: {shop_url}
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/guest_to_customer.txt b/mails/de/guest_to_customer.txt deleted file mode 100644 index ccbed22c5..000000000 --- a/mails/de/guest_to_customer.txt +++ /dev/null @@ -1,12 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihr Gast-Konto wurde in ein Kunden-Konto umgewandelt - -E-Mail-Adresse: {email} -Kennword: {passwd} - -Bitte seien Sie vorsichtig bei der gemeinsamen Nutzung dieser Login-Daten mit anderen. - -Sie können auf Ihr Konto auf unserer Webseite zugreifen: {shop_url} - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/in_transit.html b/mails/de/in_transit.html deleted file mode 100644 index c54d878f1..000000000 --- a/mails/de/in_transit.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihre Bestellung Nr.{id_order}
         
        Ihre Bestellung ist derzeit auf dem Weg.
         
        Sie können Ihr Paket verfolgen, indem Sie auf den folgenden Link klicken: {followup}
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/in_transit.txt b/mails/de/in_transit.txt deleted file mode 100644 index bdb73e217..000000000 --- a/mails/de/in_transit.txt +++ /dev/null @@ -1,12 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihre Bestellung Nr.{id_order} - -Ihre Bestellung ist derzeit auf dem Weg. - -Sie können Ihr Paket verfolgen, indem Sie auf den folgenden Link klicken: {followup} - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/lang.php b/mails/de/lang.php deleted file mode 100644 index bb335c3e7..000000000 --- a/mails/de/lang.php +++ /dev/null @@ -1,42 +0,0 @@ - \ No newline at end of file diff --git a/mails/de/log_alert.html b/mails/de/log_alert.html deleted file mode 100755 index 0687ff878..000000000 --- a/mails/de/log_alert.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo,
         
        Neue Log-Warnung
         
        Leider wurde eine neue Log-Warnung gespeichert.
         
        Sie können sie einsehen in Ihrem Back Office > Tools > Anmeldung auf Ihrer Website.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/log_alert.txt b/mails/de/log_alert.txt deleted file mode 100755 index fdba87e8d..000000000 --- a/mails/de/log_alert.txt +++ /dev/null @@ -1,10 +0,0 @@ -Hallo, - -Neue Log-Warnung - -Leider wurde eine neue Log-Warnung gespeichert. - -Sie können sie einsehen in Ihrem Back Office > Tools > Anmeldung auf Ihrer Website. -{shop_name} - {shop_url} - -{shop_url} powered by PrestaShop™ diff --git a/mails/de/newsletter.html b/mails/de/newsletter.html deleted file mode 100644 index 009ec9c42..000000000 --- a/mails/de/newsletter.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Nachricht von {shop_name}
         
        {message}
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/newsletter.txt b/mails/de/newsletter.txt deleted file mode 100644 index 3cbebf2f5..000000000 --- a/mails/de/newsletter.txt +++ /dev/null @@ -1,9 +0,0 @@ -Nachricht von {shop_name} - -Nachricht - -{message} - - - -{shop_url} powered by PrestaShop™ diff --git a/mails/de/order_canceled.html b/mails/de/order_canceled.html deleted file mode 100644 index 5fca793f4..000000000 --- a/mails/de/order_canceled.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihre Bestellung Nr.{id_order}
         
        Ihre Bestellung wurde abgebrochen.
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/order_canceled.txt b/mails/de/order_canceled.txt deleted file mode 100644 index 75bc2eefc..000000000 --- a/mails/de/order_canceled.txt +++ /dev/null @@ -1,10 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihre Bestellung Nr.{id_order} - -Ihre Bestellung wurde abgebrochen. - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/order_changed.html b/mails/de/order_changed.html deleted file mode 100644 index 18d2fc3d1..000000000 --- a/mails/de/order_changed.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hi {firstname} {lastname},
         
        Your order with the reference {order_name} - Order changed
         
        Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
         
        You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

        If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.
         
        {shop_name} powered by PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/order_changed.txt b/mails/de/order_changed.txt deleted file mode 100644 index c0c41f3d1..000000000 --- a/mails/de/order_changed.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hi {firstname} {lastname}, - -Your order with the reference {order_name} from {shop_name} has been changed by the merchant. - -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop. - -If you have guest account, you can follow your order using this link: {guest_tracking_url} - -{shop_name} - {shop_url} - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/de/order_conf.html b/mails/de/order_conf.html deleted file mode 100644 index 22d03fd64..000000000 --- a/mails/de/order_conf.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname}, danke für Ihren Einkauf bei {shop_name}.
         
        Details zu Ihrer Bestellung
         
        Bestellung: {order_name} vom {date}
        Zahlung: {payment}
         
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        Artikelnr.ProduktStückpreisMengeGesamtpreis
        {products}
        {discounts}
         Produkte{total_products}
         Rabatte{total_discounts}
         Geschenkverpackung{total_wrapping}
         Versand{total_shipping}
         Gesamt{total_paid}
        -
         
        Versand
         
        Spediteur: {carrier}
         
        - - - - - - - - -
        LieferanschriftRechnungsanschrift
        {delivery_block_html}{invoice_block_html}
        -
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/order_conf.txt b/mails/de/order_conf.txt deleted file mode 100644 index b5e162a30..000000000 --- a/mails/de/order_conf.txt +++ /dev/null @@ -1,30 +0,0 @@ -Hallo {firstname} {lastname}, vielen Dank für Ihre Bestellung auf {shop_name}! - -Details zur Bestellung - - Bestellung: {order_name} vorgenommen am {date} - Zahlung: {payment} - - Produkte: {total_products} - Rabatte: {total_discounts} - Versand: {total_shipping} - Geschenkverpackung: {total_wrapping} - Insgesamt bezahlt: {total_paid} - - -Versand - - Spediteur: {carrier} - - Lieferanschrift: - - {delivery_block_txt} - - Rechnungsanschrift: - - {invoice_block_txt} - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung auf dieser Webseite verfolgen: {guest_tracking_url} - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/order_customer_comment.html b/mails/de/order_customer_comment.html deleted file mode 100644 index f6113b85a..000000000 --- a/mails/de/order_customer_comment.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Nachricht von einem Kunden von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo,
         
        Nachricht von {firstname} {lastname} ({email})
         
        Sie haben eine neue Nachricht zur Bestellung Nr. {id_order} erhalten:

        {message}
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/order_customer_comment.txt b/mails/de/order_customer_comment.txt deleted file mode 100644 index a3f54c981..000000000 --- a/mails/de/order_customer_comment.txt +++ /dev/null @@ -1,8 +0,0 @@ -Hallo {firstname} {lastname}, - -Sie haben eine neue Nachricht zur Bestellung Nr. {id_order} erhalten: - -{message} - - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/order_merchant_comment.html b/mails/de/order_merchant_comment.html deleted file mode 100644 index 07e659ca9..000000000 --- a/mails/de/order_merchant_comment.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Nachricht von {shop_name}
         
        Sie haben eine neue Nachricht zur Bestellung Nr. {id_order} erhalten:

        {message}
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/order_merchant_comment.txt b/mails/de/order_merchant_comment.txt deleted file mode 100644 index 9063bdc6a..000000000 --- a/mails/de/order_merchant_comment.txt +++ /dev/null @@ -1,10 +0,0 @@ -Nachricht von {shop_name} - -Hallo {firstname} {lastname}, - -Sie haben eine neue Nachricht zur Bestellung Nr. {id_order} erhalten: -{message} - - - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/order_return_state.html b/mails/de/order_return_state.html deleted file mode 100644 index a31814e16..000000000 --- a/mails/de/order_return_state.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Der Verlauf Ihrer Bestellrücksendung Nr. {id_order_return}
         
        Ihre Bestellrücksendung wurde in "{state_order_return}" geändert.
         
        Sie können diese Bestellrücksendung im Abschnitt "Bestellverlauf" Ihres Kontos ansehen, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/order_return_state.txt b/mails/de/order_return_state.txt deleted file mode 100644 index 8b11d9b31..000000000 --- a/mails/de/order_return_state.txt +++ /dev/null @@ -1,9 +0,0 @@ -Hallo {firstname} {lastname}, - -Der Verlauf Ihrer Bestellrücksendung Nr. {id_order_return} - -Ihre Bestellrücksendung wurde in "{state_order_return}" geändert. - -Sie können diese Bestellrücksendung im Abschnitt "Bestellverlauf" Ihres Kontos ansehen, indem Sie auf unserer Webseite auf "Mein Konto" klicken. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/outofstock.html b/mails/de/outofstock.html deleted file mode 100644 index ec07e7f5c..000000000 --- a/mails/de/outofstock.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Der Verlauf Ihrer Bestellung Nr.{id_order}
         
        Leider sind ein oder mehrere Artikel aus Ihrer Bestellung Nr. {id_order} derzeit nicht auf Lager. Dies kann zu einer leichten Verzögerung bei Auslieferung führen. Wir entschuldigen uns und versichern Ihnen, dass wir alles dafür tun werden, um dies zu ändern.
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/outofstock.txt b/mails/de/outofstock.txt deleted file mode 100644 index d678b7f65..000000000 --- a/mails/de/outofstock.txt +++ /dev/null @@ -1,10 +0,0 @@ -Hallo {firstname} {lastname}, - -Der Verlauf Ihrer Bestellung Nr.{id_order} - -Leider sind ein oder mehrere Artikel aus Ihrer Bestellung Nr. {id_order} derzeit nicht auf Lager. Dies kann zu einer leichten Verzögerung bei Auslieferung führen. Wir entschuldigen uns und versichern Ihnen, dass wir alles dafür tun werden, um dies zu ändern. - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/password.html b/mails/de/password.html deleted file mode 100644 index 9533a6e30..000000000 --- a/mails/de/password.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihre neuen Login-Details
         
        E-Mail-Adresse: {email}
        Kennword: {passwd}
         
        Bitte seien Sie vorsichtig bei der gemeinsamen Nutzung dieser Login-Daten mit anderen.

        Sie können nun Bestellungen auf unserer Webseite vornehmen: {shop_url}
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/password.txt b/mails/de/password.txt deleted file mode 100644 index 2d9c61e46..000000000 --- a/mails/de/password.txt +++ /dev/null @@ -1,12 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihre neuen Login-Details - -E-Mail-Adresse: {email} -Kennword: {passwd} - -Bitte seien Sie vorsichtig bei der gemeinsamen Nutzung dieser Login-Daten mit anderen. - -Sie können nun Bestellungen auf unserer Webseite vornehmen: {shop_url} - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/password_query.html b/mails/de/password_query.html deleted file mode 100644 index d58393fc4..000000000 --- a/mails/de/password_query.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Sie haben um Ihre Zugangscodes für {shop_name} gebeten.
        Beachten Sie, dass dieser Vorgang Ihr aktuelles Kennwort ändert.
         
        Wenn Sie dies wirklich wollen, klicken Sie auf den folgenden Link:
        {url}
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/password_query.txt b/mails/de/password_query.txt deleted file mode 100644 index 4b1c7fab4..000000000 --- a/mails/de/password_query.txt +++ /dev/null @@ -1,9 +0,0 @@ -Hallo {firstname} {lastname}, - -Sie haben um Ihre Zugangscodes für {shop_name} gebeten. -Beachten Sie, dass dieser Vorgang Ihr aktuelles Kennwort ändert. - -Wenn Sie dies wirklich wollen, klicken Sie auf den folgenden Link: -{url} - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/payment.html b/mails/de/payment.html deleted file mode 100644 index d261e7efc..000000000 --- a/mails/de/payment.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Ihre Bestellung Nr.{id_order} Verlauf
         
        Wir haben Ihre Zahlung dankend erhalten.
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/payment.txt b/mails/de/payment.txt deleted file mode 100644 index d45fd3eba..000000000 --- a/mails/de/payment.txt +++ /dev/null @@ -1,9 +0,0 @@ -Hallo {firstname} {lastname}, - -Ihre Bestellung Nr.{id_order} Verlauf - -Wir haben Ihre Zahlung dankend erhalten. - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/payment_error.html b/mails/de/payment_error.html deleted file mode 100644 index b54b87343..000000000 --- a/mails/de/payment_error.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Der Verlauf Ihrer Bestellung Nr.{id_order}
         
        Es ist ein Problem bei Ihrer Zahlung der Bestellung Nr. {id_order} aufgetreten. Bitte kontaktieren Sie uns so bald wie möglich.
         
        Ihre Bestellung wird nicht versandt, bis wir dieses Problem gelöst haben.
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf"Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/payment_error.txt b/mails/de/payment_error.txt deleted file mode 100644 index c711be4d2..000000000 --- a/mails/de/payment_error.txt +++ /dev/null @@ -1,12 +0,0 @@ -Hallo {firstname} {lastname}, - -Der Verlauf Ihrer Bestellung Nr.{id_order} - -Es ist ein Problem bei Ihrer Zahlung der Bestellung Nr. {id_order} aufgetreten. Bitte kontaktieren Sie uns so bald wie möglich. - -Ihre Bestellung wird nicht versandt, bis wir dieses Problem gelöst haben. - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf"Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/preparation.html b/mails/de/preparation.html deleted file mode 100644 index 0bde6833c..000000000 --- a/mails/de/preparation.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Der Verlauf Ihrer Bestellung Nr.{id_order}
         
        Ihre Bestellung befindet sich aktuell in der Bearbeitung.
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/preparation.txt b/mails/de/preparation.txt deleted file mode 100644 index 2ddba792d..000000000 --- a/mails/de/preparation.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hallo {firstname} {lastname}, - -Der Verlauf Ihrer Bestellung Nr.{id_order} - -Ihre Bestellung befindet sich aktuell in der Bearbeitung. - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ - diff --git a/mails/de/refund.html b/mails/de/refund.html deleted file mode 100644 index 3fb4a61e4..000000000 --- a/mails/de/refund.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Der Verlauf Ihrer Bestellung Nr.{id_order}
         
        Ihr Bestellbetrag wurde rückerstattet.
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/refund.txt b/mails/de/refund.txt deleted file mode 100644 index 3057bd4d9..000000000 --- a/mails/de/refund.txt +++ /dev/null @@ -1,10 +0,0 @@ -Hallo {firstname} {lastname}, - -Der Verlauf Ihrer Bestellung Nr.{id_order} - -Ihr Bestellbetrag wurde rückerstattet. - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/reply_msg.html b/mails/de/reply_msg.html deleted file mode 100644 index 3de77ed18..000000000 --- a/mails/de/reply_msg.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - -
        {reply}

        Bitte antworten Sie nicht auf diese Nachricht mit Ihrem E-Mail-Client, wir würden diese Nachricht nicht erhalten.
        Um zu antworten, verwenden Sie bitte ausschließlich folgenden Link: {link}.
        - - \ No newline at end of file diff --git a/mails/de/reply_msg.txt b/mails/de/reply_msg.txt deleted file mode 100644 index 7419bc2b1..000000000 --- a/mails/de/reply_msg.txt +++ /dev/null @@ -1,4 +0,0 @@ -{reply} - -Bitte antworten Sie nicht auf diese Nachricht mit Ihrem E-Mail-Client, wir würden diese Nachricht nicht erhalten. -Um zu antworten, verwenden Sie bitte ausschließlich folgenden Link: {link}. diff --git a/mails/de/shipped.html b/mails/de/shipped.html deleted file mode 100644 index bc2ea167d..000000000 --- a/mails/de/shipped.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Der Verlauf Ihrer Bestellung Nr.{id_order}
         
        Ihre Bestellung wurde versendet.
        Sie erhalten in Kürze eine URL, auf die Sie klicken können, um den Lieferfortschritt Ihrer Sendung zu verfolgen.
         
        Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken.
        Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/shipped.txt b/mails/de/shipped.txt deleted file mode 100644 index e23e64f7a..000000000 --- a/mails/de/shipped.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hallo {firstname} {lastname}, - -Der Verlauf Ihrer Bestellung Nr.{id_order} - -Ihre Bestellung wurde versendet. -Sie erhalten in Kürze eine URL, auf die Sie klicken können, um den Lieferfortschritt Ihrer Sendung zu verfolgen. - -Sie können diese Bestellung ansehen und Ihre Rechnung aus dem Abschnitt "Bestellverlauf" Ihres Kontos downloaden, indem Sie auf unserer Webseite auf "Mein Konto" klicken. -Wenn Sie ein Gast-Konto haben, können Sie Ihre Bestellung im Abschnitt "Bestellverfolgung Gast" auf unserer Webseite verfolgen. - -{shop_name} powered with PrestaShop™ diff --git a/mails/de/test.html b/mails/de/test.html deleted file mode 100644 index 4a3758230..000000000 --- a/mails/de/test.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Testmail - - - - - - - - - - - - - - -
        Hallo,

        dies ist eine Testmail von Ihrem Shop.
         
        powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/test.txt b/mails/de/test.txt deleted file mode 100644 index c87360948..000000000 --- a/mails/de/test.txt +++ /dev/null @@ -1,5 +0,0 @@ -Hallo, - -dies ist eine Testmail von Ihrem Shop. - -powered with PrestaShop™ diff --git a/mails/de/voucher.html b/mails/de/voucher.html deleted file mode 100644 index 30bf19eb3..000000000 --- a/mails/de/voucher.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Nachricht von {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hallo {firstname} {lastname},
         
        Verlauf Ihrer Bestellung Nr.{id_order}
         
        Damit werden Sie über die Erstellung eines Gutscheins auf Ihrem Namen nach Ihrer Bestellung Nr. informiert.{id_order}.
         
        Hier ist der Code Ihres Gutscheins: {voucher_num}, über einen Betrag von {voucher_amount}.
        Für Ihre nächste Bestellung müssen Sie diesen Code einfach nur während des Bezahlvorgangs kopieren.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/voucher.txt b/mails/de/voucher.txt deleted file mode 100644 index bf8d40047..000000000 --- a/mails/de/voucher.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hallo {firstname} {lastname}, - -Verlauf Ihrer Bestellung Nr.{id_order} - -Damit werden Sie über die Erstellung eines Gutscheins auf Ihrem Namen nach Ihrer Bestellung Nr. informiert.{id_order}. - -Hier ist der Code Ihres Gutscheins: {voucher_num}, über einen Betrag von {voucher_amount}. -Für Ihre nächste Bestellung müssen Sie diesen Code einfach nur während des Bezahlvorgangs kopieren. - -{shop_name} powered with PrestaShop™ - diff --git a/mails/de/voucher_new.html b/mails/de/voucher_new.html deleted file mode 100644 index a248df3dd..000000000 --- a/mails/de/voucher_new.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        {shop_name}
         
        Hi {firstname} {lastname},
         
        This is to inform you about the creation of a voucher.
         
        Here is the code of your voucher : {voucher_num}.
        Simply copy/paste this code during the payment process for your next order.
         
        {shop_name} powered with PrestaShop™
        - - \ No newline at end of file diff --git a/mails/de/voucher_new.txt b/mails/de/voucher_new.txt deleted file mode 100644 index b8324d82d..000000000 --- a/mails/de/voucher_new.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hi {firstname} {lastname}, - -This is to inform you about the creation of a voucher. - -Here is the code of your voucher : {voucher_num}. - -Simply copy/paste this code during the payment process for your next order. - -Thank you for shopping at {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/en/account.html b/mails/en/account.html index 51894fff7..a7e86c404 100644 --- a/mails/en/account.html +++ b/mails/en/account.html @@ -14,19 +14,19 @@
         
        Hi {firstname} {lastname},Hi {firstname} {lastname},
         
        Your {shop_name} login detailsYour {shop_name} login details
         
        Thank you for creating a customer account at {shop_name}.

        Here are your login details:

        E-mail address: {email}
        Password: {passwd}
        Thank you for creating a customer account at {shop_name}.

        Here are your login details:

        E-mail address: {email}
        Password: {passwd}
          
        {shop_name} powered by PrestaShop™{shop_name} powered by PrestaShop™
        diff --git a/mails/en/backoffice_order.html b/mails/en/backoffice_order.html index d12b75ae7..cd5bd4286 100644 --- a/mails/en/backoffice_order.html +++ b/mails/en/backoffice_order.html @@ -14,25 +14,25 @@
         
        Hi {firstname} {lastname},Hi {firstname} {lastname},
         
        A new command has been generated to you.A new command has been generated to you.
         
        Go on {order_link} to finalize the payment.Go on {order_link} to finalize the payment.
         
        {shop_name} powered by PrestaShop™{shop_name} powered by PrestaShop™
        diff --git a/mails/en/bankwire.html b/mails/en/bankwire.html index 3ff23aeed..624ed99f3 100644 --- a/mails/en/bankwire.html +++ b/mails/en/bankwire.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Awaiting wire payment +Your order with the reference {order_name} - Awaiting wire payment   @@ -38,16 +38,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

        +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

        -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/cheque.html b/mails/en/cheque.html index e2a84caa8..80b88796a 100644 --- a/mails/en/cheque.html +++ b/mails/en/cheque.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Awaiting check payment +Your order with the reference {order_name} - Awaiting check payment   @@ -38,16 +38,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

        +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

        -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/contact.html b/mails/en/contact.html index 87bd641df..a122cab61 100644 --- a/mails/en/contact.html +++ b/mails/en/contact.html @@ -14,19 +14,23 @@   -Message from a {shop_name} customer +Message from a {shop_name} customer   -Customer e-mail address: {email}

        Customer message: {message} +Customer e-mail address: {email} +

        Customer message: {message} +

        Order ID : {order_name} +

        Attached file : {attached_file} +   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/contact.txt b/mails/en/contact.txt index 2e1bc5eb7..d97039345 100644 --- a/mails/en/contact.txt +++ b/mails/en/contact.txt @@ -8,4 +8,8 @@ Customer message: {message} +Order reference : {order_name} + +Attached file : {attached_file} + {shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/en/contact_form.html b/mails/en/contact_form.html index 524994467..e7c9018b2 100644 --- a/mails/en/contact_form.html +++ b/mails/en/contact_form.html @@ -14,13 +14,13 @@   -Your message to {shop_name} Customer Service +Your message to {shop_name} Customer Service   -Your message has been sent successfully.

        Message: {message}

        Order ID : {order_name}

        Attached file : {attached_file} +Your message has been sent successfully.

        Message: {message}

        Order ID : {order_name}

        Product : {product_name}

        Attached file : {attached_file}   @@ -32,7 +32,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/credit_slip.html b/mails/en/credit_slip.html index 4d4430eae..6e77a07ef 100644 --- a/mails/en/credit_slip.html +++ b/mails/en/credit_slip.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Credit slip created +Your order with the reference {order_name} - Credit slip created   @@ -32,13 +32,13 @@   -You can review this credit slip and download your invoice from the "My credit slips" section of your account by clicking "My account" on our shop. +You can review this credit slip and download your invoice from the "My credit slips" section of your account by clicking "My account" on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/download-product.tpl b/mails/en/download-product.tpl index 69dea48ba..3ad0101b8 100644 --- a/mails/en/download-product.tpl +++ b/mails/en/download-product.tpl @@ -1,7 +1,7 @@
          {foreach from=$virtualProducts item=product}
        • - {$product.name} + {$product.name} {if isset($product.deadline)} expires on {$product.deadline} {/if} diff --git a/mails/en/download_product.html b/mails/en/download_product.html index 89ffc55ec..679f3826d 100644 --- a/mails/en/download_product.html +++ b/mails/en/download_product.html @@ -14,13 +14,13 @@   -Hello {firstname} {lastname} +Hello {firstname} {lastname}   -Product(s) now available for download +Product(s) now available for download   @@ -38,16 +38,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/employee_password.html b/mails/en/employee_password.html index beffeffef..adcd4d689 100644 --- a/mails/en/employee_password.html +++ b/mails/en/employee_password.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your {shop_name} login information +Your {shop_name} login information   @@ -32,7 +32,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/forward_msg.html b/mails/en/forward_msg.html index e2ffb7853..095308131 100644 --- a/mails/en/forward_msg.html +++ b/mails/en/forward_msg.html @@ -8,7 +8,7 @@ - + @@ -20,7 +20,7 @@ - +
          Customer service - Forwarded discussionCustomer service - Forwarded discussion
            
          {shop_name} powered by PrestaShop™{shop_name} powered by PrestaShop™
          diff --git a/mails/en/guest_to_customer.html b/mails/en/guest_to_customer.html index 5858f3800..1e04e69d2 100644 --- a/mails/en/guest_to_customer.html +++ b/mails/en/guest_to_customer.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your customer account creation +Your customer account creation   @@ -44,7 +44,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/in_transit.html b/mails/en/in_transit.html index e464c66d0..5ea27e06b 100755 --- a/mails/en/in_transit.html +++ b/mails/en/in_transit.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - In transit +Your order with the reference {order_name} - In transit   @@ -32,16 +32,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/index.php b/mails/en/index.php index 08550506c..d8c3ebafb 100644 --- a/mails/en/index.php +++ b/mails/en/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/mails/en/lang.php b/mails/en/lang.php index 77dd41de1..5a7a5d491 100644 --- a/mails/en/lang.php +++ b/mails/en/lang.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/mails/en/log_alert.html b/mails/en/log_alert.html index d434f6ece..e6ca7b45e 100755 --- a/mails/en/log_alert.html +++ b/mails/en/log_alert.html @@ -20,7 +20,7 @@   -You have received a new log alert +You have received a new log alert   @@ -38,7 +38,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/newsletter.html b/mails/en/newsletter.html index 7d6c70523..02c6d14ac 100644 --- a/mails/en/newsletter.html +++ b/mails/en/newsletter.html @@ -14,7 +14,7 @@   -Newsletter from {shop_name} +Newsletter from {shop_name}   @@ -26,7 +26,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/order_canceled.html b/mails/en/order_canceled.html index e32c8030d..08d4d898f 100644 --- a/mails/en/order_canceled.html +++ b/mails/en/order_canceled.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Order cancelled +Your order with the reference {order_name} - Order cancelled   @@ -32,16 +32,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/order_changed.html b/mails/en/order_changed.html index 42c5c9d25..04ea9150c 100644 --- a/mails/en/order_changed.html +++ b/mails/en/order_changed.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Order changed +Your order with the reference {order_name} - Order changed   @@ -32,16 +32,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/order_conf.html b/mails/en/order_conf.html index b633150ed..22b5ddea8 100644 --- a/mails/en/order_conf.html +++ b/mails/en/order_conf.html @@ -14,19 +14,19 @@   -Hi {firstname} {lastname},

          Thank you for shopping with {shop_name}! +Hi {firstname} {lastname},

          Thank you for shopping with {shop_name}!   -Order details +Order details   -Order: {order_name} placed on {date}
          Payment: {payment} +Order: {order_name} placed on {date}
          Payment: {payment}   @@ -35,7 +35,7 @@ - + @@ -52,8 +52,8 @@ - - + + @@ -83,7 +83,7 @@ - + @@ -98,7 +98,7 @@ - + @@ -32,7 +32,7 @@ - +
          Reference Product Unit price
           Products{total_products}Products{total_products}
            
          ShippingShipping
            - + @@ -111,16 +111,16 @@ - + - + - +
          Delivery addressBilling address
          Delivery addressBilling address
          {delivery_block_html} {invoice_block_html} 
          You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.
           
          {shop_name} powered by PrestaShop™{shop_name} powered by PrestaShop™
          diff --git a/mails/en/order_customer_comment.html b/mails/en/order_customer_comment.html index e32f17fdf..671a97dfd 100644 --- a/mails/en/order_customer_comment.html +++ b/mails/en/order_customer_comment.html @@ -20,7 +20,7 @@
           
          Message from a customerMessage from a customer
            
          {shop_name} powered by PrestaShop™{shop_name} powered by PrestaShop™
          diff --git a/mails/en/order_merchant_comment.html b/mails/en/order_merchant_comment.html index 19c97e84b..8b5c04615 100644 --- a/mails/en/order_merchant_comment.html +++ b/mails/en/order_merchant_comment.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -New message from {shop_name} +New message from {shop_name}   @@ -32,7 +32,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/order_return_state.html b/mails/en/order_return_state.html index 1d340104a..4ba720b7c 100644 --- a/mails/en/order_return_state.html +++ b/mails/en/order_return_state.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Return #{id_order_return} - update +Return #{id_order_return} - update   @@ -32,13 +32,13 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

            -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/outofstock.html b/mails/en/outofstock.html index bd3c6e9b7..59e9d1b26 100644 --- a/mails/en/outofstock.html +++ b/mails/en/outofstock.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Item(s) out of stock +Your order with the reference {order_name} - Item(s) out of stock   @@ -32,16 +32,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/password.html b/mails/en/password.html index 2cf30df6e..fdfa0486f 100644 --- a/mails/en/password.html +++ b/mails/en/password.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your new {shop_name} login details +Your new {shop_name} login details   @@ -38,7 +38,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/password_query.html b/mails/en/password_query.html index e91f7e29d..b85db5bb7 100644 --- a/mails/en/password_query.html +++ b/mails/en/password_query.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Password reset request for {shop_name} +Password reset request for {shop_name}   @@ -38,7 +38,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/payment.html b/mails/en/payment.html index 06149f20a..489b0063f 100644 --- a/mails/en/payment.html +++ b/mails/en/payment.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Payment processed +Your order with the reference {order_name} - Payment processed   @@ -32,16 +32,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/payment_error.html b/mails/en/payment_error.html index 53a179665..c6e117334 100644 --- a/mails/en/payment_error.html +++ b/mails/en/payment_error.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Payment processing error +Your order with the reference {order_name} - Payment processing error   @@ -38,16 +38,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/preparation.html b/mails/en/preparation.html index 83d013915..c6e4be688 100644 --- a/mails/en/preparation.html +++ b/mails/en/preparation.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order {order_name} - Processing +Your order {order_name} - Processing   @@ -32,16 +32,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/refund.html b/mails/en/refund.html index 68a1bff78..1e7236671 100644 --- a/mails/en/refund.html +++ b/mails/en/refund.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Refund processed for order with the reference {order_name} +Refund processed for order with the reference {order_name}   @@ -32,16 +32,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/shipped.html b/mails/en/shipped.html index bb8656601..9f17deb21 100644 --- a/mails/en/shipped.html +++ b/mails/en/shipped.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Shipped +Your order with the reference {order_name} - Shipped   @@ -32,16 +32,16 @@   -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          +You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          -If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop. +If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/test.html b/mails/en/test.html index 1a037ce34..8e2a9b412 100644 --- a/mails/en/test.html +++ b/mails/en/test.html @@ -14,7 +14,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/voucher.html b/mails/en/voucher.html index 582ca6106..c9c04acb0 100644 --- a/mails/en/voucher.html +++ b/mails/en/voucher.html @@ -14,13 +14,13 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   -Your order with the reference {order_name} - Voucher created +Your order with the reference {order_name} - Voucher created   @@ -38,7 +38,7 @@   -{shop_name} powered by PrestaShop™ +{shop_name} powered by PrestaShop™ diff --git a/mails/en/voucher_new.html b/mails/en/voucher_new.html index 0f1da4ddb..3678364c5 100644 --- a/mails/en/voucher_new.html +++ b/mails/en/voucher_new.html @@ -14,7 +14,7 @@   -Hi {firstname} {lastname}, +Hi {firstname} {lastname},   @@ -32,7 +32,7 @@   -{shop_name} powered with PrestaShop™ +{shop_name} powered with PrestaShop™ diff --git a/mails/es/account.html b/mails/es/account.html deleted file mode 100644 index 844ff7727..000000000 --- a/mails/es/account.html +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Detalles de tu cuenta
           
          Email: {email}
          Contraseña: {passwd}
           
          Consejos de Seguridad:

          Mantén los datos de tu cuenta en lugar seguro.
          No des los detalles de tu cuenta a nadie.
          Cambia tu contraseña regularmente.
          Si sospechas que alguien esta usando ilegalmente tu cuenta, avísanos inmediatamente.
           
          Ahora podrás guardar y consultar tus pedidos en nuestra web: {shop_name}.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/account.txt b/mails/es/account.txt deleted file mode 100644 index 142cb2a02..000000000 --- a/mails/es/account.txt +++ /dev/null @@ -1,20 +0,0 @@ -Hola {firstname} {lastname}, - -Gracias por crear tu cuenta en {shop_name}. - -Detalles de tu cuenta: - -Email: {email} -Contraseña: {passwd} - -Ahora podrás guardar y consultar tus pedidos en nuestra web: {shop_url} - -Consejos de Seguridad: - -* Mantén los datos de tu cuenta en lugar seguro. -* No des los detalles de tu cuenta a nadie. -* Cambia tu contraseña regularmente. -* Si sospechas que alguien esta usando ilegalmente tu cuenta, avísanos inmediatamente. - - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/backoffice_order.html b/mails/es/backoffice_order.html deleted file mode 100644 index 1c451a44b..000000000 --- a/mails/es/backoffice_order.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Mensaje de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Una nueva orden se ha generado para usted
           
          Vaya {order_link} para finalizar el pago.
           
          {shop_name} powered by PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/backoffice_order.txt b/mails/es/backoffice_order.txt deleted file mode 100644 index ab080a9b9..000000000 --- a/mails/es/backoffice_order.txt +++ /dev/null @@ -1,9 +0,0 @@ -Hola {firstname} {lastname}, - -Se ha generado un nuevo comando para usted - -Vaya a{order_link} para finalizar el pago - -{shop_name} - {shop_url} - -{shop_url} creado por PrestaShop™ diff --git a/mails/es/bankwire.html b/mails/es/bankwire.html deleted file mode 100644 index 5da9b1bfc..000000000 --- a/mails/es/bankwire.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Tu pedido es el número #{id_order}
           
          Tu pedido #{id_order} ha sido recibido correctamente, y será enviado en cuanto recibamos el pago.
           
          Por favor, recuerda que has seleccionado transferencia bancaria. Envíela a:

          {bankwire_owner}

          {bankwire_details}

          Total Pedido: {total_paid}
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/bankwire.txt b/mails/es/bankwire.txt deleted file mode 100644 index 717fb4805..000000000 --- a/mails/es/bankwire.txt +++ /dev/null @@ -1,20 +0,0 @@ -Hola {firstname} {lastname}, - -Tu pedido #{id_order} ha sido recibido correctamente, y será enviado en cuanto recibamos el pago. -Por favor, recuerda que has seleccionado transferencia bancaria. Envíala a: - -{bankwire_owner} - -{bankwire_details} - -Total Pedido: {total_paid} - -Puedes revisar tu pedido y descargar la factura desde tu cuenta de nuestra web en (sección "Historial de Pedidos"). -If you have guest account, you can follow your order at this page: {guest_tracking_url} - -Muchas gracias por comprar en {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} powered by PrestaShop® diff --git a/mails/es/cheque.html b/mails/es/cheque.html deleted file mode 100644 index 8fd074420..000000000 --- a/mails/es/cheque.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Tu pedido es el número #{id_order}
           
          Tu pedido #{id_order} ha sido recibido correctamente, y será enviado en cuanto recibamos el pago.
           
          Por favor, recuerda que ha seleccionado pagar con cheque. Rellénalo con:

          - total {total_paid}

          - por el pedido de {cheque_name}

          - a {cheque_address_html}
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/cheque.txt b/mails/es/cheque.txt deleted file mode 100644 index 336bcd768..000000000 --- a/mails/es/cheque.txt +++ /dev/null @@ -1,19 +0,0 @@ -Hola {firstname} {lastname}, - -Tu pedido #{id_order} ha sido recibido correctamente, y será enviado en cuanto recibamos el pago. -Por favor, recuerda que ha seleccionado pagar con cheque. Rellénalo con: - -- Total {total_paid} - -- por el pedido de {cheque_name} - -- a {cheque_address} - -Puedes revisar tu pedido y descargar la factura desde tu cuenta de nuestra web en (historial de pedidos). -If you have guest account, you can follow your order at this page: {guest_tracking_url} - -Muchas gracias por comprar en {shop_name}. - -{shop_name} - {shop_url} - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/contact.html b/mails/es/contact.html deleted file mode 100644 index d1375814c..000000000 --- a/mails/es/contact.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Mensaje desde tu tienda {shop_name}
           
          Email: {email}

          Mensaje: {message}
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/contact.txt b/mails/es/contact.txt deleted file mode 100644 index 890358954..000000000 --- a/mails/es/contact.txt +++ /dev/null @@ -1,11 +0,0 @@ -Has recibido un mensaje de un cliente desde tu tienda: {shop_name} - -Detalles del mensaje: - -Email: {email} - -Mensaje: - -{message} - -{shop_url} desarrollado por PrestaShop™ \ No newline at end of file diff --git a/mails/es/contact_form.html b/mails/es/contact_form.html deleted file mode 100644 index 11226bb4c..000000000 --- a/mails/es/contact_form.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - Mensaje de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          SU mensaje se envio correctamente al centro de atención de cliente.
           
          - - - - - - - - - - - - -
          Su mensaje se envio correctamente
          Mensaje: {message}

          Order ID : {id_order}

          Archivo : {attached_file}
           
          Responderemos a la brevedad
          -
           
          Responderemos a la brevedad
           
          {shop_name} powered with PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/contact_form.txt b/mails/es/contact_form.txt deleted file mode 100644 index 71907ab32..000000000 --- a/mails/es/contact_form.txt +++ /dev/null @@ -1,15 +0,0 @@ -Tu mensaje ha sido enviado correctamenta a nuestro Servicio Cliente. - -Tu mensaje: - -{message} - -Order ID : {id_order} - -Archivo : {attached_file} - -Te responderemos cuanto antes. - -Saludos, - -{shop_url} desarrollado por PrestaShop™ \ No newline at end of file diff --git a/mails/es/credit_slip.html b/mails/es/credit_slip.html deleted file mode 100644 index 7c80135be..000000000 --- a/mails/es/credit_slip.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Histórico del Pedido #{id_order}
           
          Te informamos que se ha generado un vale de compra a tu favor desde el pedido #{id_order}.
           
          Puedes revisar este pedido y descargar la factura desde la sección "Seguimiento de Pedido" de tu cuenta "Mi Cuenta" en nuestra web.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/credit_slip.txt b/mails/es/credit_slip.txt deleted file mode 100644 index 56a02bd5f..000000000 --- a/mails/es/credit_slip.txt +++ /dev/null @@ -1,12 +0,0 @@ -Hola {firstname} {lastname}, - -Te informamos que se ha generado un vale de compra a tu favor desde el pedido #{id_order}. - -Puedes revisar este recibo y descargar la factura desde la sección "Seguimiento de Pedido" de tu cuenta pulsando en "Mi cuenta" en nuestra web. - -Gracias por comprar en {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} desarrollado por PrestaShop® \ No newline at end of file diff --git a/mails/es/download-product.tpl b/mails/es/download-product.tpl deleted file mode 100644 index e3ceccc3a..000000000 --- a/mails/es/download-product.tpl +++ /dev/null @@ -1,13 +0,0 @@ -
            -{foreach from=$virtualProducts item=product} -
          • - {$product.name} - {if isset($product.deadline)} - expires on {$product.deadline} - {/if} - {if isset($product.downloadable)} - downloadable {$product.downloadable} times - {/if} -
          • -{/foreach} -
          \ No newline at end of file diff --git a/mails/es/download_product.html b/mails/es/download_product.html deleted file mode 100644 index 40eba5b90..000000000 --- a/mails/es/download_product.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname}, gracias por comprar en {shop_name}.
           
          Producto(s) para descargar
           
          Tienes {nbProducts} producto(s) para descargar.
           
          Este es el acceso directo: {virtualProducts}
           
          Puedes revisar este pedido y descargar su factura desde la sección "Seguimiento de Pedido" de tu cuenta "Mi Cuenta" en nuestra web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/download_product.txt b/mails/es/download_product.txt deleted file mode 100644 index b3b195963..000000000 --- a/mails/es/download_product.txt +++ /dev/null @@ -1,13 +0,0 @@ -{firstname} {lastname}, gracias por comprar en {shop_name}! - -Tienes {nbProducts} producto(s) para descargar. - -Este es el acceso directo: -{virtualProducts} - - -Puedes revisar este pedido y descargar la factura desde la sección "Seguimiento de Pedido" de tu cuenta pulsando en "Mi cuenta" en nuestra web. -Si tienes una cuenta invitado, puedes seguir tu pedido en esta página: {guest_tracking_url}?id_order={id_order} - - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/employee_password.html b/mails/es/employee_password.html deleted file mode 100644 index 89313e8ab..000000000 --- a/mails/es/employee_password.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Su {shop_name} información de sesión
           
          Esta es su información para {shop_name}:

          Nombre: {firstname}
          Apellido: {lastname}
          Password: {passwd}
          E-mail : {email}
           
          {shop_name} powered by PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/employee_password.txt b/mails/es/employee_password.txt deleted file mode 100644 index 95b3654cb..000000000 --- a/mails/es/employee_password.txt +++ /dev/null @@ -1,13 +0,0 @@ -Hola {firstname} {lastname}, - -Tu información personal en {shop_name} es: - -* Nombre: {firstname} -* Apellidos: {lastname} -* Contraseña: {passwd} -* Email: {email} - -{shop_name} - {shop_url} - - -{shop_url} desarrollado por PrestaShop® \ No newline at end of file diff --git a/mails/es/forward_msg.html b/mails/es/forward_msg.html deleted file mode 100644 index 069702705..000000000 --- a/mails/es/forward_msg.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Mensaje de {shop_name} - - - - - - - - -
          -

          {employee} desea seguir el chat con isted.

          {messages}

          {employee} added "{comment}".

          -

          Historial de discusion:

          -
          - - \ No newline at end of file diff --git a/mails/es/forward_msg.txt b/mails/es/forward_msg.txt deleted file mode 100644 index d11613442..000000000 --- a/mails/es/forward_msg.txt +++ /dev/null @@ -1,8 +0,0 @@ -{employee} en espera para seguir esta conversación contigo:. -Comentario: {comment} - -Historial de charla: -{messages} - -Saludos, -{shop_name} powered by PrestaShop� \ No newline at end of file diff --git a/mails/es/guest_to_customer.html b/mails/es/guest_to_customer.html deleted file mode 100644 index 1042afc2b..000000000 --- a/mails/es/guest_to_customer.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Su cuenta de invitado se ha transformado en cuenta de cliente
           
          E-mail: {email}
          Password: {passwd}
           
          Sea cuidadoso al compartir sus datos con otros

          Puede acceder con su cuenta a nuestro sitio: {shop_url}
           
          {shop_name} powered with PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/guest_to_customer.txt b/mails/es/guest_to_customer.txt deleted file mode 100644 index 6a4ff0e89..000000000 --- a/mails/es/guest_to_customer.txt +++ /dev/null @@ -1,15 +0,0 @@ - Hola {firstname} {lastname}, - - Su cuenta se ha transformado en cuenta de cliente - - E-mail address: {email} - Password: {passwd} - - - Puede acceder a su cuenta en nuestro sitio: {shop_url} - - Sea cuidadoso en compartir estos detalles con otros. - - - - {shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/es/in_transit.html b/mails/es/in_transit.html deleted file mode 100644 index 535db9932..000000000 --- a/mails/es/in_transit.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Mensaje desde{shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Historial del Pedido #{id_order}
           
          Tu pedido está en camino.
           
          Puedes seguir su ubicación actual haciendo clic en este enlace: {followup}
           
          También puedes revisar tus pedidos y descargar tus facturas desde tu "Historial de Pedidos" dentro de tu cuenta en nuestra web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/in_transit.txt b/mails/es/in_transit.txt deleted file mode 100644 index 24ff17e21..000000000 --- a/mails/es/in_transit.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hola {firstname} {lastname}, - -Tu pedido está en camino. -Puedes seguir su ubicación actual haciendo clic en este enlace: {followup} - -También puedes revisar tus pedidos y descargar tus facturas desde tu "Historial de Pedidos" dentro de tu cuenta. -If you have guest account, you can follow your order at this page: {guest_tracking_url} - -Gracias por comprar en {shop_name}! - -{shop_name} - {shop_url} - - -{shop_url} desarrollado por PrestaShop® \ No newline at end of file diff --git a/mails/es/lang.php b/mails/es/lang.php deleted file mode 100644 index a7ee208c2..000000000 --- a/mails/es/lang.php +++ /dev/null @@ -1,41 +0,0 @@ - \ No newline at end of file diff --git a/mails/es/log_alert.html b/mails/es/log_alert.html deleted file mode 100755 index 5c53a631b..000000000 --- a/mails/es/log_alert.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Mensaje de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola,
           
          Nueva alerta 
           
          Desafortunadamente a recibido un nuevo mensaje de alerta.
           
          Puede verificarlo desde > Herramientas > Log en su Back Office
           
          {shop_name} powered with PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/log_alert.txt b/mails/es/log_alert.txt deleted file mode 100755 index fa8a5f440..000000000 --- a/mails/es/log_alert.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hola, - -Nuevo log de alerta - -Desafortunadamente se ha grabado una nueva alerta - -Puede verlo en su Panel de administracion > Herramientas> Log en si sitio. - -{shop_name} - {shop_url} - -{shop_url} powered by PrestaShop™ diff --git a/mails/es/newsletter.html b/mails/es/newsletter.html deleted file mode 100644 index 55ce176f8..000000000 --- a/mails/es/newsletter.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Newsletter de {shop_name}
           
          {message}
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/newsletter.txt b/mails/es/newsletter.txt deleted file mode 100644 index 8f26ec2e2..000000000 --- a/mails/es/newsletter.txt +++ /dev/null @@ -1,9 +0,0 @@ -Newsletter de {shop_name} - -Mensaje - -{message} - - - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/order_canceled.html b/mails/es/order_canceled.html deleted file mode 100644 index ab85c3f1c..000000000 --- a/mails/es/order_canceled.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Respecto al pedido #{id_order}
           
          Tu pedido ha sido cancelado.
           
          Puedes revisar este pedido y descargar tu factura desde la sección "Seguimiento de Pedido" de su cuenta "Mi Cuenta" en nuestra web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/order_canceled.txt b/mails/es/order_canceled.txt deleted file mode 100644 index 888fd157d..000000000 --- a/mails/es/order_canceled.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hola {firstname} {lastname}, - -Respecto al pedido #{id_order}: - -Tu pedido ha sido cancelado. - -Puedes revisar este pedido y descargar tu factura desde la seccion de "Historial de Pedidos" dentro de tu cuenta en nuestra web. -If you have guest account, you can follow your order at this page: {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/order_changed.html b/mails/es/order_changed.html deleted file mode 100644 index 18d2fc3d1..000000000 --- a/mails/es/order_changed.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hi {firstname} {lastname},
           
          Your order with the reference {order_name} - Order changed
           
          Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
           
          You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.
           
          {shop_name} powered by PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/order_changed.txt b/mails/es/order_changed.txt deleted file mode 100644 index c0c41f3d1..000000000 --- a/mails/es/order_changed.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hi {firstname} {lastname}, - -Your order with the reference {order_name} from {shop_name} has been changed by the merchant. - -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop. - -If you have guest account, you can follow your order using this link: {guest_tracking_url} - -{shop_name} - {shop_url} - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/es/order_conf.html b/mails/es/order_conf.html deleted file mode 100644 index 7fa6743d8..000000000 --- a/mails/es/order_conf.html +++ /dev/null @@ -1,115 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname}, gracias por comprar en {shop_name}.
           
          Detalles del Pedido
           
          Pedido: {order_name} realizado el {date}
          Forma de Pago: {payment}
           
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          ReferenciaProductoPrecio UnidadCantidadPrecio Total
          {products}
          {discounts}
           Productos{total_products}
           Descuentos{total_discounts}
           Envíos{total_shipping}
           TOTAL{total_paid}
          -
           
          Envío
           
          Transporte: {carrier}
           
          - - - - - - - - -
          Dirección de EntregaDirección de Facturación
          {delivery_block_html}{invoice_block_html}
          -
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/order_conf.txt b/mails/es/order_conf.txt deleted file mode 100644 index 70364a2d7..000000000 --- a/mails/es/order_conf.txt +++ /dev/null @@ -1,29 +0,0 @@ - {firstname} {lastname}, gracias por realizar su pedido en {shop_name}! - - Detalles del Pedido - - Pedido: {order_name} realizado el {date} - Forma de Pago: {payment} - - Total Productos: {total_products} - Descuentos: {total_discounts} - Gastos Envío: {total_shipping} - Total: {total_paid} - - - Envios - - Transporte: {carrier} - - Dirección de Entrega: - {delivery_block_txt} - - Direccion de Facturación: - {invoice_block_txt} - - Puedes revisar tu pedido y descargar la factura desde tu cuenta de nuestra web en (historial de pedidos). - If you have guest account, you can follow your order at this page: {guest_tracking_url} - - Gracias por comprar en {shop_name}. - - {shop_url} desarrollado por PrestaShop® diff --git a/mails/es/order_customer_comment.html b/mails/es/order_customer_comment.html deleted file mode 100644 index 02df0d4fb..000000000 --- a/mails/es/order_customer_comment.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Mensaje de un cliente de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola,
           
          Mensaje desde {shop_name}
           
          Has recibido un nuevo mensaje sobre el pedido #{id_order}:

          {message}
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          - - \ No newline at end of file diff --git a/mails/es/order_customer_comment.txt b/mails/es/order_customer_comment.txt deleted file mode 100644 index aeddcc0a2..000000000 --- a/mails/es/order_customer_comment.txt +++ /dev/null @@ -1,8 +0,0 @@ -Hola {firstname} {lastname}, - -Has recibido un nuevo mensaje sobre el pedido #{id_order}: - -{message} - - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/order_merchant_comment.html b/mails/es/order_merchant_comment.html deleted file mode 100644 index 4874adabf..000000000 --- a/mails/es/order_merchant_comment.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Mensaje de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Mensaje de {shop_name}
           
          Has recibido un nuevo mensaje sobre el pedido n°{id_order} :
          Mensaje:
          {message}
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/order_merchant_comment.txt b/mails/es/order_merchant_comment.txt deleted file mode 100644 index 30971e36d..000000000 --- a/mails/es/order_merchant_comment.txt +++ /dev/null @@ -1,10 +0,0 @@ -Hola {firstname} {lastname}, - -Has recibido un mensaje sobre el pedido n°{id_order} : -{message} - -Puedes, en cualquier momento, consultar tus antiguos mensajes en Seguimiento de pedido. - - - -{shop_url} desarrollado por PrestaShop™ \ No newline at end of file diff --git a/mails/es/order_return_state.html b/mails/es/order_return_state.html deleted file mode 100644 index 3565f1c48..000000000 --- a/mails/es/order_return_state.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Mensaje de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Buenos días {firstname} {lastname},
           
          Historico de su devolución N°{id_order_return}
           
          El estado de su devolución ha cambiado a "{state_order_return}".
           
          Puede acceder al seguimiento de su devolución y descargar su factura en "Histórico de pedidos" en la sección "Mi cuenta" de nuestra Web.
           
          {shop_name}
          - - \ No newline at end of file diff --git a/mails/es/order_return_state.txt b/mails/es/order_return_state.txt deleted file mode 100644 index 7b0f791d0..000000000 --- a/mails/es/order_return_state.txt +++ /dev/null @@ -1,9 +0,0 @@ -Buenos días: {firstname} {lastname}, - -El estado de tu devolución {id_order_return} a cambiado a "{state_order_return}". - -Puedes revisar esta orden de devolución en "Historial y detalles de tus pedidos" de tu cuenta pulsando sobre "Mi cuenta" en nuestro sitio web. - -{shop_name} - {shop_url} - -{shop_url} desarrollado por PrestaShop® \ No newline at end of file diff --git a/mails/es/outofstock.html b/mails/es/outofstock.html deleted file mode 100644 index fbf513767..000000000 --- a/mails/es/outofstock.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Incidencia en tu pedido #{id_order}
           
          Desgraciadamente, uno o mas productos de tu pedido #{id_order} se encuentran actualmente fuera de stock. Esto puede originar un retraso en el envío. Por favor, acepta nuestras disculpas y puedes estar seguro que trabajeremos lo más rápidamente posible para solucionarlo.
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/outofstock.txt b/mails/es/outofstock.txt deleted file mode 100644 index 66ed4278c..000000000 --- a/mails/es/outofstock.txt +++ /dev/null @@ -1,17 +0,0 @@ -Hola {firstname} {lastname}, - -Incidencia en tu pedido #{id_order} - -Desgraciadamente, uno o mas productos de tu pedido #{id_order} se encuentran actualmente fuera de stock. -Esto puede originar un retraso en el envío. Por favor, acepta nuestras disculpas y puedes estar seguro que trabajaremos lo más rápidamente posible para solucionarlo. - - - -Puedes revisar tu pedido y descargar la factura desde tu cuenta de nuestra web en (historial de pedidos). -If you have guest account, you can follow your order at this page: {guest_tracking_url} - - {shop_name} - {shop_url} - - - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/password.html b/mails/es/password.html deleted file mode 100644 index ba39af2ea..000000000 --- a/mails/es/password.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Detalles de tu nuevo Login
           
          Email: {email}
          Contraseña: {passwd}
           
          Por favor, ten cuidado en no compartir con nadie estos detalles.

          Ahora puedes realizar pedidos en nuestra web de: {shop_url}
           
          {shop_name} pdesarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/password.txt b/mails/es/password.txt deleted file mode 100644 index 7b8b1e1f4..000000000 --- a/mails/es/password.txt +++ /dev/null @@ -1,15 +0,0 @@ -Hola {firstname} {lastname}, - -Detalles de tu nuevo login: - -Email: {email} -Contraseña: {passwd} - - -Ahora puedes realizar pedidos en nuestra web de: {shop_url} - - -Por favor, ten cuidado en no compartir con nadie estos detalles. - - -{shop_url} desarrollado por PrestaShop® \ No newline at end of file diff --git a/mails/es/password_query.html b/mails/es/password_query.html deleted file mode 100644 index a14663e33..000000000 --- a/mails/es/password_query.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          You asked to get back your {shop_name}identifiers,
          Note that this action will change your actual password.
           
          If you really want to do it, click the next link :
          {url}
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/password_query.txt b/mails/es/password_query.txt deleted file mode 100644 index 352c26666..000000000 --- a/mails/es/password_query.txt +++ /dev/null @@ -1,9 +0,0 @@ -Hola {firstname} {lastname}, - -You asked to get back your {shop_name} access codes. -Note that this action will change your current password. - -If you really want to do it, click the following link : -{url} - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/payment.html b/mails/es/payment.html deleted file mode 100644 index c89a8a20d..000000000 --- a/mails/es/payment.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          En referencia a tu pedido #{id_order}:
           
          El pago de tu pedido fue recibido CORRECTAMENTE .
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/payment.txt b/mails/es/payment.txt deleted file mode 100644 index 610f4c766..000000000 --- a/mails/es/payment.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hola {firstname} {lastname}, - -En referencia a tu pedido #{id_order}: - -El pago de tu pedido fue recibido CORRECTAMENTE . - -Puedes revisar tu pedido y descargar la factura desde tu cuenta de nuestra web en (historial de pedidos). -If you have guest account, you can follow your order at this page: {guest_tracking_url} - -{shop_name} - {shop_url} - -Gracias por comprar en {shop_name}. - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/payment_error.html b/mails/es/payment_error.html deleted file mode 100644 index 2fd1a2d86..000000000 --- a/mails/es/payment_error.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Incidencia en su pedido #{id_order}
           
          Hay un problema con tu pago para el pedido: #{id_order}. Por favor, ponte en contacto con nosotros en cuanto puedas.
           
          Tu pedido no será enviado hasta que resolvamos este problema.
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/payment_error.txt b/mails/es/payment_error.txt deleted file mode 100644 index a6b38315e..000000000 --- a/mails/es/payment_error.txt +++ /dev/null @@ -1,16 +0,0 @@ -Hola {firstname} {lastname}, - - -Hay un problema con tu pago para el pedido: #{id_order}. Por favor, ponte en contacto con nosotros en cuanto puedas. - -Tu pedido no será enviado hasta que resolvamos este problema. - - -Puedes revisar tu pedido y descargar la factura desde tu cuenta de nuestra web en (historial de pedidos). -If you have guest account, you can follow your order at this page: {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/preparation.html b/mails/es/preparation.html deleted file mode 100644 index c8bbe0aaf..000000000 --- a/mails/es/preparation.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Sobre tu pedido: #{id_order}
           
          Estamos preparando tu pedido.
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/preparation.txt b/mails/es/preparation.txt deleted file mode 100644 index d333af177..000000000 --- a/mails/es/preparation.txt +++ /dev/null @@ -1,13 +0,0 @@ -Hola {firstname} {lastname}, - -Sobre tu pedido #{id_order}: - -Estamos preparando tu pedido. - -Puedes revisar tu pedido y descargar la factura desde tu cuenta de nuestra web en (historial de pedidos). -If you have guest account, you can follow your order at this page: {guest_tracking_url} - -{shop_name} - {shop_url} - - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/refund.html b/mails/es/refund.html deleted file mode 100644 index 5e3e62ae0..000000000 --- a/mails/es/refund.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Sobre su pedido: #{id_order}
           
          Se ha reembolsado el pago de tu pedido.
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          If you have guest account, you can follow your order at "Guest Tracking" section on our Website.
           
          {shop_name} desarrollado por PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/refund.txt b/mails/es/refund.txt deleted file mode 100644 index c2a65a2ca..000000000 --- a/mails/es/refund.txt +++ /dev/null @@ -1,12 +0,0 @@ -Hola {firstname} {lastname}, - -Se ha reembolsado el pago de tu pedido. - -Puedes revisar tu pedido y descargar la factura desde tu cuenta de nuestra web en (historial de pedidos). -If you have guest account, you can follow your order at this page: {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} desarrollado por PrestaShop® diff --git a/mails/es/reply_msg.html b/mails/es/reply_msg.html deleted file mode 100644 index e009b43cf..000000000 --- a/mails/es/reply_msg.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Mensaje de {shop_name} - - - - - - - - -
          {reply}

          Por favor no responda este mensaje desde cu cuenta de cliente , no reciviremos su mensaje.
          Para responder, use este link exclusivo  {link}.
          - - \ No newline at end of file diff --git a/mails/es/reply_msg.txt b/mails/es/reply_msg.txt deleted file mode 100644 index 26a027988..000000000 --- a/mails/es/reply_msg.txt +++ /dev/null @@ -1,4 +0,0 @@ -{reply} - -Please do not reply to this message using your e-mail client, we would not receive your message. -In order to reply, please use exclusively the following link: {link} diff --git a/mails/es/shipped.html b/mails/es/shipped.html deleted file mode 100644 index 73c008988..000000000 --- a/mails/es/shipped.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Historial de tu Pedido #{id_order}
           
          Tu pedido ha sido enviado.
          Recibirás pronto una URL para realizar el seguimiento del envío de tu pedido.
           
          Puedes revisar tu pedido y descargar la factura aquí: "Historial de Pedidos" dentro de tu cuenta "Entrar en Mi Cuenta" de nuestro sitio web.
          Si tiene una cuenta de invitado, puede seguirla desde la sección  "Seguimiento de invitado" en nuestro sitio.
           
          {shop_name} powered with PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/shipped.txt b/mails/es/shipped.txt deleted file mode 100644 index 7daafc480..000000000 --- a/mails/es/shipped.txt +++ /dev/null @@ -1,15 +0,0 @@ -Hola {firstname} {lastname}, - -Tu pedido acaba de ser enviado. -Pronto recibirás una URL para realizar el seguimiento de tu pedido. - -Puedes revisar este pedido y descargar tu factura en la sección "Historial" dentro de tu cuenta en nuestra web. -Si tiene una cuenta de invitado, puede seguirla desde la sección : {shop_url}?controller=guest-tracking - -Gracias por comprar en {shop_name}! - -{shop_name} - {shop_url} - - - -{shop_url} powered by PrestaShop® \ No newline at end of file diff --git a/mails/es/test.html b/mails/es/test.html deleted file mode 100644 index 464ca1aa9..000000000 --- a/mails/es/test.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Prueba de Corrreo - - - - - - - - - - - - - - -
          Hola,

          Esto es una prueba de correo desde tu tienda.
           
          powered with PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/test.txt b/mails/es/test.txt deleted file mode 100644 index 5680ded11..000000000 --- a/mails/es/test.txt +++ /dev/null @@ -1,3 +0,0 @@ -Hola, - -Esto es una prueba de correo desde tu tienda Prestashop. \ No newline at end of file diff --git a/mails/es/voucher.html b/mails/es/voucher.html deleted file mode 100644 index 9e75bc5e8..000000000 --- a/mails/es/voucher.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Mensaje desde {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Historial de tu Pedido #{id_order}
           
          Te informamos de la creación de un cupón de descuento para tí como resultado de tu pedido #{id_order}.
           
          Aquí tienes tu código del cupón: {voucher_num}, por la cantidad de {voucher_amount}.
          Simplemente copia y pega éste código durante el proceso de pago de tu próximo pedido.
           
          {shop_name} powered with PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/voucher.txt b/mails/es/voucher.txt deleted file mode 100644 index 7cc229bca..000000000 --- a/mails/es/voucher.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hola {firstname} {lastname}, - -Te informamos de la creación de un vale de descuento para ti como resultado de tu pedido #{id_order}. - -Aquí tienes tu código del vale:{voucher_num}, por la cantidad de:{voucher_amount}. - -Simplemente copia y pega este código durante el proceso de pago de tu próximo pedido. - -Gracias por comprar en {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} desarrollado por PrestaShop® \ No newline at end of file diff --git a/mails/es/voucher_new.html b/mails/es/voucher_new.html deleted file mode 100644 index 1eedcc0c2..000000000 --- a/mails/es/voucher_new.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Mensaje de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hola {firstname} {lastname},
           
          Esto es para informarle acerca de la creacion de un cupon de descuento.
           
          Este es el código del cupon : {voucher_num}.
          Solo copie/pegue este código durante el proceso de pago de su próxima orden.
           
          {shop_name} powered with PrestaShop™
          - - \ No newline at end of file diff --git a/mails/es/voucher_new.txt b/mails/es/voucher_new.txt deleted file mode 100644 index bb2015e1b..000000000 --- a/mails/es/voucher_new.txt +++ /dev/null @@ -1,13 +0,0 @@ -Hola {firstname} {lastname}, - -Esto es para informarle acerca de la creacion de un cupon de descuento. - -Este es el código del cupon : {voucher_num}. -Solo copie/pegue este código durante el proceso de pago de su próxima orden. - -Gracias por su compra en {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/fr/account.html b/mails/fr/account.html deleted file mode 100644 index c77d4047b..000000000 --- a/mails/fr/account.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Merci d'avoir créé un compte sur {shop_name}. Voici un rappel de vos codes d'accès.
           
          Adresse e-mail : {email}
          Mot de passe : {passwd}
           
          Vous pouvez dès à présent passer commande sur notre site internet {shop_name}.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/account.txt b/mails/fr/account.txt deleted file mode 100644 index 553312b3c..000000000 --- a/mails/fr/account.txt +++ /dev/null @@ -1,13 +0,0 @@ -Merci d'avoir créé votre compte client sur {shop_name}, vous trouverez dans ce message un rappel de vos codes d'accès. - -Vos codes d'accès : - -Adresse électronique : {email} -Mot de passe : {passwd} - -Vous pouvez dès à présent passer commande sur notre site Internet : -{shop_url} - - - -{shop_url} réalisé par PrestaShop™ \ No newline at end of file diff --git a/mails/fr/backoffice_order.html b/mails/fr/backoffice_order.html deleted file mode 100644 index 65b301bdd..000000000 --- a/mails/fr/backoffice_order.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Une nouvelle commande vous a été générée.
           
          Rendez vous sur {order_link} pour finaliser le paiement.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/backoffice_order.txt b/mails/fr/backoffice_order.txt deleted file mode 100644 index 6405d9b8f..000000000 --- a/mails/fr/backoffice_order.txt +++ /dev/null @@ -1,9 +0,0 @@ -Bonjour {firstname} {lastname}, - -Une nouvelle commande vous a été générée. - -Rendez vous sur cette adresse pour finaliser le paiement : {order_link} - -{shop_name} - {shop_url} - -{shop_url} réalisé par PrestaShop™ diff --git a/mails/fr/bankwire.html b/mails/fr/bankwire.html deleted file mode 100644 index 77b9cd6cd..000000000 --- a/mails/fr/bankwire.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}.
           
          Nous avons bien enregistré votre commande ayant pour référence {order_name}. Celle-ci vous sera envoyée dès réception de votre paiement.
           
          Pour rappel, vous avez sélectionné le mode de paiement par virement bancaire et celui-ci est à envoyer à :

          {bankwire_owner}

          {bankwire_details}

          {bankwire_address}

          Le montant total est de {total_paid}
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/bankwire.txt b/mails/fr/bankwire.txt deleted file mode 100644 index 05e2239cb..000000000 --- a/mails/fr/bankwire.txt +++ /dev/null @@ -1,22 +0,0 @@ -Bonjour {firstname} {lastname}, - -Nous avons bien enregistré votre commande ayant pour référence {order_name}. Celle-ci vous sera envoyée dès réception de votre paiement. -Pour rappel, vous avez sélectionné le mode de paiement par virement bancaire et celui-ci est à envoyer à : - -{bankwire_owner} - -{bankwire_details} - -{bankwire_address} - -Le montant total est de {total_paid} - -Vous pouvez accéder à tout moment au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site {shop_url} -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -Merci et à bientôt sur {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/cheque.html b/mails/fr/cheque.html deleted file mode 100644 index a95040cf5..000000000 --- a/mails/fr/cheque.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}.
           
          Nous avons bien enregistré votre commande ayant pour référence {order_name}. Celle-ci vous sera envoyée dès réception de votre paiement.
           
          Pour rappel, vous avez choisi de régler votre commande par chèque, merci de nous transmettre votre règlement :

          - d'un montant de {total_paid}

          - à l'ordre de {cheque_name}

          - à {cheque_address_html}
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/cheque.txt b/mails/fr/cheque.txt deleted file mode 100644 index 6c5b9492b..000000000 --- a/mails/fr/cheque.txt +++ /dev/null @@ -1,21 +0,0 @@ -Bonjour {firstname} {lastname}, - -Nous avons bien enregistré votre commande ayant pour référence {order_name}. -Celle-ci vous sera envoyée dès réception de votre paiement. - -Pour rappel, vous avez choisi de régler votre commande par chèque, merci de nous transmettre votre règlement : - -- d'un montant de {total_paid} - -- à l'ordre de {cheque_name} - -- à {cheque_address} - -Vous pouvez accéder à tout moment au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site {shop_url} -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/contact.html b/mails/fr/contact.html deleted file mode 100644 index 29bbcf39c..000000000 --- a/mails/fr/contact.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Vous avez reçu un message de la part d'un client depuis votre boutique {shop_name}.
           
          Adresse électronique : {email}

          Message: {message}
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/contact.txt b/mails/fr/contact.txt deleted file mode 100644 index 91933d8e8..000000000 --- a/mails/fr/contact.txt +++ /dev/null @@ -1,11 +0,0 @@ -Vous avez reçu un message de la part d'un client depuis votre boutique {shop_name} - -Informations - -Adresse électronique : {email} - -Message - -{message} - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/contact_form.html b/mails/fr/contact_form.html deleted file mode 100644 index 3267f3027..000000000 --- a/mails/fr/contact_form.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Votre message a bien été envoyé à notre service client.
           
          Votre message a bien été envoyé.

          Message : {message}

          Référence de commande : {order_name}

          Fichier attaché : {attached_file}
           
          Nous vous répondrons dès que possible.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/contact_form.txt b/mails/fr/contact_form.txt deleted file mode 100644 index def387f90..000000000 --- a/mails/fr/contact_form.txt +++ /dev/null @@ -1,15 +0,0 @@ -Votre message a bien été envoyé à notre service client. - -Votre message : - -{message} - -Référence commande : {order_name} - -Fichier attaché : {attached_file} - -Nous vous répondrons dés que possible. - -Cordialement, - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/credit_slip.html b/mails/fr/credit_slip.html deleted file mode 100644 index 6d8098265..000000000 --- a/mails/fr/credit_slip.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}.
           
          Nous vous informons de la génération d'un avoir à votre nom relatif à votre commande ayant pour référence {order_name}.
           
          Vous pouvez accéder à cet avoir et télécharger votre facture dans "Suivi des commandes" de la rubrique "Mon compte" sur notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/credit_slip.txt b/mails/fr/credit_slip.txt deleted file mode 100644 index 78b7cb3aa..000000000 --- a/mails/fr/credit_slip.txt +++ /dev/null @@ -1,12 +0,0 @@ -Bonjour {firstname} {lastname}, - -Nous vous informons de la génération d'un avoir à votre nom relatif à votre commande ayant pour référence {order_name}. - -Vous pouvez accéder à cet avoir et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site {shop_url} - -Merci et à bientôt sur {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/download-product.tpl b/mails/fr/download-product.tpl deleted file mode 100644 index d5eb29e03..000000000 --- a/mails/fr/download-product.tpl +++ /dev/null @@ -1,13 +0,0 @@ -
            -{foreach from=$virtualProducts item=product} -
          • - {$product.name} - {if isset($product.deadline)} - expire le {$product.deadline} - {/if} - {if isset($product.downloadable)} - téléchargeable {$product.downloadable} fois - {/if} -
          • -{/foreach} -
          \ No newline at end of file diff --git a/mails/fr/download_product.html b/mails/fr/download_product.html deleted file mode 100644 index ec6795634..000000000 --- a/mails/fr/download_product.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Produits à télécharger
           
          Vous avez {nbProducts} produit(s) à télécharger.
           
          Voici les liens directs vers ceux-ci : {virtualProducts}
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/download_product.txt b/mails/fr/download_product.txt deleted file mode 100644 index 4e3776f8c..000000000 --- a/mails/fr/download_product.txt +++ /dev/null @@ -1,12 +0,0 @@ -Bonjour {firstname} {lastname}, merci d'avoir passé commande chez {shop_name} ! - -Vous avez {nbProducts} produit(s) à télécharger. - -Voici les liens directs vers ceux-ci : -{virtualProducts} - - -Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site. -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url}?id_order={id_order} - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/employee_password.html b/mails/fr/employee_password.html deleted file mode 100644 index 40b974615..000000000 --- a/mails/fr/employee_password.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Voici vos informations personnelles
           
          Prénom : {firstname}
          Nom : {lastname}
          Mot de passe : {passwd}
          Adresse électronique : {email}
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/employee_password.txt b/mails/fr/employee_password.txt deleted file mode 100644 index c19f340b4..000000000 --- a/mails/fr/employee_password.txt +++ /dev/null @@ -1,15 +0,0 @@ -Bonjour {firstname} {lastname}, - -Voici les informations personnelles concernant votre nouvelle boutique {shop_name} : - -Prénom : {firstname} -Nom : {lastname} -Mot de passe : {passwd} -Adresse électronique : {email} - - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/forward_msg.html b/mails/fr/forward_msg.html deleted file mode 100644 index c3e215745..000000000 --- a/mails/fr/forward_msg.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - -
          {employee} souhaite vous transférer cette discussion.

          {messages}

          {employee} a ajouté "{comment}".
          - - \ No newline at end of file diff --git a/mails/fr/forward_msg.txt b/mails/fr/forward_msg.txt deleted file mode 100644 index 3b5c1b8d7..000000000 --- a/mails/fr/forward_msg.txt +++ /dev/null @@ -1,5 +0,0 @@ -{employee} souhaite vous transférer cette discussion. -Commentaire : {comment} - -{messages} - diff --git a/mails/fr/guest_to_customer.html b/mails/fr/guest_to_customer.html deleted file mode 100644 index 7c0eca1d3..000000000 --- a/mails/fr/guest_to_customer.html +++ /dev/null @@ -1,43 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Votre compte invité a été transformé en compte client
           
          Adresse e-mail : {email}
          Mot de passe : {passwd}
          Vous pouvez accéder à votre compte sur notre site Internet : {shop_url}
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/guest_to_customer.txt b/mails/fr/guest_to_customer.txt deleted file mode 100644 index eb516c892..000000000 --- a/mails/fr/guest_to_customer.txt +++ /dev/null @@ -1,13 +0,0 @@ -Bonjour {firstname} {lastname}, - -Votre compte invité a été transformé en compte client - -Adresse électronique : {email} -Mot de passe : {passwd} - -Vous pouvez accéder à votre compte sur notre site Internet : -{shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/in_transit.html b/mails/fr/in_transit.html deleted file mode 100755 index 8e331dddb..000000000 --- a/mails/fr/in_transit.html +++ /dev/null @@ -1,55 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          La livraison de votre commande est en cours.
           
          Vous pouvez suivre l'avancement de la livraison à l'adresse suivante : {followup}
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/in_transit.txt b/mails/fr/in_transit.txt deleted file mode 100755 index 8c4a97649..000000000 --- a/mails/fr/in_transit.txt +++ /dev/null @@ -1,14 +0,0 @@ -Bonjour {firstname} {lastname}, - -La livraison de votre commande est en cours. - -Vous pouvez suivre l'avancement de la livraison à l'adresse suivante : {followup} - -Vous pouvez accéder à tout moment au suivi de votre commande dans "Historique de mes commandes" de la rubrique "Mon compte" sur notre site. -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/lang.php b/mails/fr/lang.php deleted file mode 100644 index f1694fe5f..000000000 --- a/mails/fr/lang.php +++ /dev/null @@ -1,40 +0,0 @@ - \ No newline at end of file diff --git a/mails/fr/log_alert.html b/mails/fr/log_alert.html deleted file mode 100755 index a0b2f5bc2..000000000 --- a/mails/fr/log_alert.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour,
           
          Nouveau message d'alerte enregistré
           
          Malheureusement, un message d'alerte a été enregistré
           
          Vous pouvez voir ce message dans votre Panneau d'administration > Outils > Log
           
          {shop_name} propulsé par PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/log_alert.txt b/mails/fr/log_alert.txt deleted file mode 100755 index 65cde3e18..000000000 --- a/mails/fr/log_alert.txt +++ /dev/null @@ -1,11 +0,0 @@ -Bonjour, - -Nouveau message d'alerte enregistré. - -Malheureusement, un message d'alerte a été enregistré. - -Vous pouvez voir ce message dans votre Panneau d'administration > Outils > Log. - -{shop_name} - {shop_url} - -{shop_url} propulsé avec PrestaShop™ diff --git a/mails/fr/newsletter.html b/mails/fr/newsletter.html deleted file mode 100644 index a07876ce6..000000000 --- a/mails/fr/newsletter.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Newsletter de {shop_name}
           
          {message}
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/newsletter.txt b/mails/fr/newsletter.txt deleted file mode 100644 index 2c8cce434..000000000 --- a/mails/fr/newsletter.txt +++ /dev/null @@ -1,9 +0,0 @@ -Newsletter de {shop_name} - -Message - -{message} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/order_canceled.html b/mails/fr/order_canceled.html deleted file mode 100644 index 3e7356b1c..000000000 --- a/mails/fr/order_canceled.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          Votre commande a été annulée.
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/order_canceled.txt b/mails/fr/order_canceled.txt deleted file mode 100644 index 58266794d..000000000 --- a/mails/fr/order_canceled.txt +++ /dev/null @@ -1,12 +0,0 @@ -Bonjour {firstname} {lastname}, - -Votre commande ayant pour référence {order_name} a été annulée. - -Vous pouvez accéder à tout moment au suivi de votre commande dans "Historique des commandes" de la rubrique "Mon compte" sur notre site {shop_name}. -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/order_changed.html b/mails/fr/order_changed.html deleted file mode 100644 index b1034e616..000000000 --- a/mails/fr/order_changed.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          Votre commande a été a été modifiée par le marchand.
           
          Vous pouvez consulter votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez consulter votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/order_changed.txt b/mails/fr/order_changed.txt deleted file mode 100644 index c33de15df..000000000 --- a/mails/fr/order_changed.txt +++ /dev/null @@ -1,12 +0,0 @@ -Bonjour {firstname} {lastname}, - -Votre commande ayant pour référence {order_name} a été modifiée par le marchand. - -Vous pouvez à tout moment consulter votre commande dans "Historique des commandes" de la rubrique "Mon compte" sur notre site {shop_name}. -Si vous avez un compte invité, vous pouvez consulter votre commande à cette adresse : {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/order_conf.html b/mails/fr/order_conf.html deleted file mode 100644 index 2ff041941..000000000 --- a/mails/fr/order_conf.html +++ /dev/null @@ -1,120 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname}, merci d'avoir passé commande chez {shop_name} !
           
          Détails de la commande
           
          Commande : {order_name} passée le {date}
          Mode de paiement : {payment}
           
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          RéférenceProduitPrix unitaireQuantitéPrix total
          {products}
          {discounts}
           Total produits{total_products}
           Bons d'achat et réductions{total_discounts}
           Emballage Cadeau{total_wrapping}
           Frais d'expédition{total_shipping}
           Total payé{total_paid}
          -
           
          Livraison
           
          Transporteur : {carrier}
           
          - - - - - - - - -
          Adresse de livraisonAdresse de facturation
          {delivery_block_html}{invoice_block_html}
          -
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/order_conf.txt b/mails/fr/order_conf.txt deleted file mode 100644 index 7b79cb2d8..000000000 --- a/mails/fr/order_conf.txt +++ /dev/null @@ -1,28 +0,0 @@ -Bonjour {firstname} {lastname}, merci d'avoir passé commande chez {shop_name} ! - -Détails de la commande - - Commande : {order_name} passée le {date} - Mode de paiement : {payment} - - Produits : {total_products} - Bons d'achat et réductions : {total_discounts} - Emballage Cadeau : {total_wrapping} - Frais d'expédition : {total_shipping} - Total payé : {total_paid} - - -Livraison - - Transporteur : {carrier} - - Adresse de livraison : - {delivery_block_txt} - - Adresse de facturation : - {invoice_block_txt} - -Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site. -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -{shop_url} réalisé avec PrestaShop™ diff --git a/mails/fr/order_customer_comment.html b/mails/fr/order_customer_comment.html deleted file mode 100644 index 37d7f17a1..000000000 --- a/mails/fr/order_customer_comment.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message d'un client de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour,
           
          Message de {firstname} {lastname} ({email})
           
          Vous avez reçu un nouveau message concernant la commande ayant pour référence {order_name} :

          {message}
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/order_customer_comment.txt b/mails/fr/order_customer_comment.txt deleted file mode 100644 index 7676db4c5..000000000 --- a/mails/fr/order_customer_comment.txt +++ /dev/null @@ -1,8 +0,0 @@ -Bonjour, - -Vous avez reçu un nouveau message concernant la commande ayant pour référence {order_name} : -{message} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/order_merchant_comment.html b/mails/fr/order_merchant_comment.html deleted file mode 100644 index 0ac5f9245..000000000 --- a/mails/fr/order_merchant_comment.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Message de {shop_name}
           
          Vous avez reçu un nouveau message concernant la commande ayant pour référence {order_name} :

          {message}
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/order_merchant_comment.txt b/mails/fr/order_merchant_comment.txt deleted file mode 100644 index aedd6c697..000000000 --- a/mails/fr/order_merchant_comment.txt +++ /dev/null @@ -1,10 +0,0 @@ -Bonjour {firstname} {lastname}, - -Vous avez reçu un nouveau message concernant la commande ayant pour référence {order_name} : -{message} - -Vous pouvez à tout moment consulter vos anciens messages dans votre suivi de commande. - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/order_return_state.html b/mails/fr/order_return_state.html deleted file mode 100644 index 3614ebefa..000000000 --- a/mails/fr/order_return_state.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre bon de retour n°{id_order_return}
           
          Votre bon de retour est passé à l'état "{state_order_return}".
           
          Vous pouvez accéder au suivi de votre bon de retour et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/order_return_state.txt b/mails/fr/order_return_state.txt deleted file mode 100644 index 29b7a2d0c..000000000 --- a/mails/fr/order_return_state.txt +++ /dev/null @@ -1,7 +0,0 @@ -Bonjour {firstname} {lastname}, - -Votre bon de retour {id_order_return} est passé à l'état "{state_order_return}". - -Vous pouvez accéder à tout moment au suivi de votre bon de retour dans "Historique de mes commandes" de la rubrique "Mon compte" sur notre site. - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/outofstock.html b/mails/fr/outofstock.html deleted file mode 100644 index a21de4993..000000000 --- a/mails/fr/outofstock.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          Votre commande est bien enregistrée mais nécessite un réapprovisionnement.
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/outofstock.txt b/mails/fr/outofstock.txt deleted file mode 100644 index 0fcf9662f..000000000 --- a/mails/fr/outofstock.txt +++ /dev/null @@ -1,12 +0,0 @@ -Bonjour {firstname} {lastname}, - -Votre commande ayant pour référence {order_name} est bien enregistrée mais nécessite un réapprovisionnement. - -Vous pouvez accéder à tout moment au suivi de votre commande dans la rubrique "Mon compte". -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/password.html b/mails/fr/password.html deleted file mode 100644 index 3627a7b2a..000000000 --- a/mails/fr/password.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Voici vos codes d'accès
           
          Adresse e-mail : {email}
          Mot de passe : {passwd}
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/password.txt b/mails/fr/password.txt deleted file mode 100644 index 948970976..000000000 --- a/mails/fr/password.txt +++ /dev/null @@ -1,11 +0,0 @@ -Comme demandé, nous avons modifié votre mot de passe, voici un rappel de vos codes d'accès. - -Adresse électronique : {email} -Mot de passe : {passwd} - -Vous pouvez dès à présent passer commande sur notre site Internet : -{shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/password_query.html b/mails/fr/password_query.html deleted file mode 100644 index a01590c3c..000000000 --- a/mails/fr/password_query.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Vous avez demandé à récupérer vos codes d'accès.
          Cette opération vous attribuera un nouveau mot de passe.
           
          Si vous souhaitez confirmer cette demande, cliquez sur le lien suivant :
          {url}
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/password_query.txt b/mails/fr/password_query.txt deleted file mode 100644 index d2b6fac3e..000000000 --- a/mails/fr/password_query.txt +++ /dev/null @@ -1,9 +0,0 @@ -Bonjour {firstname} {lastname} - -Vous avez demandé à récupérer vos codes d'accès. -Cette opération vous attribuera un nouveau mot de passe. - -Si vous souhaitez confirmer cette demande, cliquez sur le lien suivant : -{url} - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/payment.html b/mails/fr/payment.html deleted file mode 100644 index 8ee42d412..000000000 --- a/mails/fr/payment.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          Le paiement pour votre commande a été accepté.
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/payment.txt b/mails/fr/payment.txt deleted file mode 100644 index 2be608dd6..000000000 --- a/mails/fr/payment.txt +++ /dev/null @@ -1,12 +0,0 @@ -Bonjour {firstname} {lastname}, - -Le paiement pour votre commande ayant pour référence {order_name} a été accepté. - -Vous pouvez accéder à tout moment au suivi de votre commande dans "Historique des commandes" de la rubrique "Mon compte" sur notre site. -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/payment_error.html b/mails/fr/payment_error.html deleted file mode 100644 index 2be2d0ea0..000000000 --- a/mails/fr/payment_error.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          Un problème a été constaté pour le paiement de votre commande.
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/payment_error.txt b/mails/fr/payment_error.txt deleted file mode 100644 index af94d69bb..000000000 --- a/mails/fr/payment_error.txt +++ /dev/null @@ -1,12 +0,0 @@ -Bonjour {firstname} {lastname}, - -Un problème a été constaté pour le paiement de votre commande ayant pour référence {order_name}. - -Vous pouvez à tout moment accéder au suivi de votre commande dans la rubrique "Mon compte" du site. -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/preparation.html b/mails/fr/preparation.html deleted file mode 100644 index 2dd2ad381..000000000 --- a/mails/fr/preparation.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          Votre commande a été validée et est en cours de préparation.
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/preparation.txt b/mails/fr/preparation.txt deleted file mode 100644 index 96a918b51..000000000 --- a/mails/fr/preparation.txt +++ /dev/null @@ -1,12 +0,0 @@ -Bonjour {firstname} {lastname}, - -Votre commande ayant pour référence {order_name} est en cours de préparation. - -Vous pouvez accéder à tout moment au suivi de votre commande dans "Historique de mes commandes" de la rubrique "Mon compte" sur notre site. -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/refund.html b/mails/fr/refund.html deleted file mode 100644 index cce98d242..000000000 --- a/mails/fr/refund.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          Votre commande vous a bien été remboursée.
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/refund.txt b/mails/fr/refund.txt deleted file mode 100644 index e25f68818..000000000 --- a/mails/fr/refund.txt +++ /dev/null @@ -1,12 +0,0 @@ -Bonjour {firstname} {lastname}, - -Votre commande ayant pour référence {order_name} vous a bien été remboursée. - -Vous pouvez accéder à tout moment au suivi de votre commande dans la rubrique "Mon compte" du site. -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse : {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/reply_msg.html b/mails/fr/reply_msg.html deleted file mode 100644 index e435dc098..000000000 --- a/mails/fr/reply_msg.html +++ /dev/null @@ -1,16 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - -
          {reply}

          Attention, vous ne devez pas répondre à ce message en utilisant votre logiciel de messagerie, nous ne recevrons pas votre message. Pour répondre, merci d'utiliser exclusivement le lien suivant : {link}
          - - \ No newline at end of file diff --git a/mails/fr/reply_msg.txt b/mails/fr/reply_msg.txt deleted file mode 100644 index d11de09f8..000000000 --- a/mails/fr/reply_msg.txt +++ /dev/null @@ -1,4 +0,0 @@ -{reply} - -Attention, vous ne devez pas répondre à ce message en utilisant votre logiciel de messagerie, nous ne recevrons pas votre message. -Pour répondre, merci d'utiliser exclusivement le lien suivant : {link} diff --git a/mails/fr/shipped.html b/mails/fr/shipped.html deleted file mode 100644 index 7d5b2b2b7..000000000 --- a/mails/fr/shipped.html +++ /dev/null @@ -1,49 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          Votre commande vient d'être expédiée.
          Vous recevrez prochainement un lien vous permettant le suivi de votre colis.
           
          Vous pouvez accéder au suivi de votre commande et télécharger votre facture dans "Historique des commandes" de la rubrique "Mon compte" sur notre site.
          Si vous avez un compte invité, vous pouvez suivre votre commande dans la section "Suivi invité" de notre site.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/shipped.txt b/mails/fr/shipped.txt deleted file mode 100644 index 2d68cf283..000000000 --- a/mails/fr/shipped.txt +++ /dev/null @@ -1,14 +0,0 @@ -Bonjour {firstname} {lastname}, - -Votre commande ayant pour référence {order_name} vient d'être expédiée. - -Vous recevrez prochainement un lien vous permettant le suivi de votre colis. - -Vous pouvez accéder à tout moment au suivi de votre commande dans "Historique de mes commandes" de la rubrique "Mon compte" sur notre site. -Si vous avez un compte invité, vous pouvez suivre votre commande à cette adresse: {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/test.html b/mails/fr/test.html deleted file mode 100644 index 131e0419b..000000000 --- a/mails/fr/test.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - Mail de test - - - - - - - - - - - - - - -
          Bonjour,

          Voici un mail de test de votre boutique.
           
          Généré par PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/test.txt b/mails/fr/test.txt deleted file mode 100644 index b620f3e3d..000000000 --- a/mails/fr/test.txt +++ /dev/null @@ -1,3 +0,0 @@ - Bonjour, - - Voici un mail de test de votre boutique PrestaShop™. \ No newline at end of file diff --git a/mails/fr/voucher.html b/mails/fr/voucher.html deleted file mode 100644 index ab900c5e3..000000000 --- a/mails/fr/voucher.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Historique de votre commande ayant pour référence {order_name}
           
          Nous vous informons de la génération d'un bon de réduction à votre nom relatif à votre commande ayant pour référence {order_name}.
           
          Voici le numéro de votre bon de réduction : {voucher_num}, d'un montant total de {voucher_amount}.
          Copiez-collez ce numéro dans le panier de votre prochain achat avant de régler la commande.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/voucher.txt b/mails/fr/voucher.txt deleted file mode 100644 index eee05f9f6..000000000 --- a/mails/fr/voucher.txt +++ /dev/null @@ -1,13 +0,0 @@ -Bonjour {firstname} {lastname}, - -Nous vous informons de la génération d'un bon de réduction à votre nom relatif à votre commande ayant pour référence {order_name}. - -Voici le numéro de votre bon de réduction : {voucher_num}, d'un montant total de {voucher_amount}. -Copiez-collez ce numéro dans le panier de votre prochain achat avant de régler la commande. - -Merci et à bientôt sur {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/fr/voucher_new.html b/mails/fr/voucher_new.html deleted file mode 100644 index 8626f3990..000000000 --- a/mails/fr/voucher_new.html +++ /dev/null @@ -1,40 +0,0 @@ - - - - - Message de {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Bonjour {firstname} {lastname},
           
          Nous vous informons de la génération d'un bon de réduction.
           
          Voici le numéro de votre bon de réduction : {voucher_num}.
          Copiez-collez ce numéro dans le panier de votre prochain achat avant de régler la commande.
           
          {shop_name} réalisé avec PrestaShop™
          - - \ No newline at end of file diff --git a/mails/fr/voucher_new.txt b/mails/fr/voucher_new.txt deleted file mode 100644 index 0781a7cb2..000000000 --- a/mails/fr/voucher_new.txt +++ /dev/null @@ -1,13 +0,0 @@ -Bonjour {firstname} {lastname}, - -Nous vous informons de la génération d'un bon de réduction. - -Voici le numéro de votre bon de réduction : {voucher_num}. -Copiez-collez ce numéro dans le panier de votre prochain achat avant de régler la commande. - -Merci et à bientôt sur {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} réalisé avec PrestaShop™ \ No newline at end of file diff --git a/mails/index.php b/mails/index.php index 88e934d59..195fab225 100644 --- a/mails/index.php +++ b/mails/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/mails/it/account.html b/mails/it/account.html deleted file mode 100644 index 232284bf7..000000000 --- a/mails/it/account.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          I tuoi dati di login dell'account
           
          Indirizzo e-mail: {email}
          Password: {passwd}
           
          Consigli di sicurezza:

          Tieni al sicuro i dati del tuo account.
          Non far sapere a nessuno i tuoi dati di login.
          Cambia regolarmente la tua password.
          Se sospetti che qualcuno stia utilizzando illegalmente il tuoaccount, avvertici immediatamente.
           
          Adesso puoi effettuare ordini nel nostro sito web: {shop_name}.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/account.txt b/mails/it/account.txt deleted file mode 100644 index cadcb54f6..000000000 --- a/mails/it/account.txt +++ /dev/null @@ -1,20 +0,0 @@ -Salve {firstname} {lastname}, - -Grazie di aver creato un account con {shop_name}. - -I tuoi dati di login dell'account: - -Indirizzo e-mail: {email} -Password: {passwd} - -Adesso puoi effettuare ordini nel nostro sito web: {shop_url} - -Consigli di sicurezza: - -* Tieni al sicuro i dati del tuo account. -* Non far sapere a nessuno i tuoi dati di login. -* Cambia regolarmente la tua password. -* Se sospetti che qualcuno stia utilizzando illegalmente il tuo account, avvertici immediatamente. - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/backoffice_order.html b/mails/it/backoffice_order.html deleted file mode 100644 index 91ae1152c..000000000 --- a/mails/it/backoffice_order.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hi {firstname} {lastname},
           
          A new command has been generated to you.
           
          Go on {order_link} to finalize the payment.
           
          {shop_name} powered by PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/backoffice_order.txt b/mails/it/backoffice_order.txt deleted file mode 100644 index 8f38f4ba0..000000000 --- a/mails/it/backoffice_order.txt +++ /dev/null @@ -1,9 +0,0 @@ -Hi {firstname} {lastname}, - -A new command has been generated to you. - -Go on {order_link} to finalize the payment. - -{shop_name} - {shop_url} - -{shop_url} réalisé par PrestaShop™ diff --git a/mails/it/bankwire.html b/mails/it/bankwire.html deleted file mode 100644 index bfdbc82e7..000000000 --- a/mails/it/bankwire.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          La cronologia del tuo ordine n.{id_order}
           
          Il tuo ordine è stato eseguito con successo, e sarà inviato appena ricevuto il pagamento.
           
          Ricorda che hai scelto di pagare con bonifico bancario. Invia il pagamento a:

          {bankwire_owner}

          {bankwire_details}

          {bankwire_address}

          Order total amount is {total_paid}
           
          Puoi rivedere l'ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account clicando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordine ospite"nel nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/bankwire.txt b/mails/it/bankwire.txt deleted file mode 100644 index 3f30870e7..000000000 --- a/mails/it/bankwire.txt +++ /dev/null @@ -1,23 +0,0 @@ -Salve {firstname} {lastname}, - -Il tuo ordine n.{id_order} è stato eseguito con successo, e sarà inviato appena ricevuto il pagamento. - -Ricorda che hai scelto di pagare con bonifico bancario. Invia il pagamento a: - -{bankwire_owner} - -{bankwire_details} - -{bankwire_address} - -Importo totale dell'ordine {total_paid} - -Puoi rivedere l'ordine e scaricare la fattura dalla sezione "Cronologia ordini" del tuo account cliccando su "Il mio account" nel nostro sito web. -Se hai un account ospite, puoi seguire il tuo ordine in questa pagina: {guest_tracking_url} - -Grazie di aver acquistato con {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/cheque.html b/mails/it/cheque.html deleted file mode 100644 index da67fd741..000000000 --- a/mails/it/cheque.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          La cronologia del tuo ordine {order_name}
           
          Il tuo ordine è stato eseguito con successo, e sarà inviato appena ricevuto il pagamento.
           
          Ricorda che hai scelto di pagare con assegno. Invia il pagamento:

          - dell'importo di {total_paid}

          - pagabile all'ordine di {cheque_name}

          - inviato a {cheque_address_html}
           
          Puoi rivedere l'ordine e scaricare la fattura dalla sezione"Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordine ospite" del nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/cheque.txt b/mails/it/cheque.txt deleted file mode 100644 index d4270e924..000000000 --- a/mails/it/cheque.txt +++ /dev/null @@ -1,22 +0,0 @@ -Salve {firstname} {lastname}, - -Il tuo ordine {order_name} è stato eseguito con successo, e sarà inviato appena ricevuto il pagamento. - -Ricorda che hai scelto di pagare con assegno. Invia il pagamento: - -- dell'importo di {total_paid} - -- pagabile all'ordine di {cheque_name} - -- inviato a {cheque_address} - -Puoi rivedere l'ordine e scaricare la fattura dalla sezione "Cronologia ordini" del tuo account cliccando su "Il mio account" nel nostro sito web. -Se hai un account ospite, puoi seguire il tuo ordine in questa pagina: {guest_tracking_url} - -Grazie di aver acquistato con {shop_name}. - - -{shop_name} - {shop_url} - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/contact.html b/mails/it/contact.html deleted file mode 100644 index d099e7d5b..000000000 --- a/mails/it/contact.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Messaggio dal tuo negozio {shop_name}
           
          Indirizzo e-mail: {email}

          Messaggio: {message}
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/contact.txt b/mails/it/contact.txt deleted file mode 100644 index e25c90dd4..000000000 --- a/mails/it/contact.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hai ricevuto un messaggio da un cliente tramite il tuo negozio: {shop_name} - -Dettagli del messaggio: - -Indirizzo e-mail: {email} - -Messaggio: - -{message} - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/contact_form.html b/mails/it/contact_form.html deleted file mode 100644 index e860c8e66..000000000 --- a/mails/it/contact_form.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Il tuo messaggio è stato correttamente inviato al nostro Servizio Clienti.
           
          Il tuo messaggio: {message}
           
          Risponderemo quanto prima.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/contact_form.txt b/mails/it/contact_form.txt deleted file mode 100644 index f88be8d4b..000000000 --- a/mails/it/contact_form.txt +++ /dev/null @@ -1,12 +0,0 @@ -Il tuo messaggio è stato correttamente inviato al nostro Servizio Clienti. - -Il tuo messaggio: - -{message} - - -Risponderemo quanto prima. - -Cordialmente, - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/credit_slip.html b/mails/it/credit_slip.html deleted file mode 100644 index 37a9f7cb6..000000000 --- a/mails/it/credit_slip.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          La cronologia del tuo ordine n.{id_order}
           
          Vogliamo informarti della creazione di una nota di credito a tuo nome dell'ordine n.{id_order}.
           
          Puoi rivedere questa nota di credito e scaricare la fattura dalla sezione "Controllo ordini"del tuo account cliccando su "Il mio account" nel nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/credit_slip.txt b/mails/it/credit_slip.txt deleted file mode 100644 index 29dc1719f..000000000 --- a/mails/it/credit_slip.txt +++ /dev/null @@ -1,12 +0,0 @@ -Salve {firstname} {lastname}, - -Vogliamo informarti della creazione di una nota di credito a tuo nome dell'ordine n.{id_order}. - -Puoi rivedere questa nota di credito e scaricare la fattura dalla sezione "Controllo ordini" del tuo account cliccando su "Il mio account" nel nostro sito web. - -Grazie di aver acquistato con {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/download-product.tpl b/mails/it/download-product.tpl deleted file mode 100644 index e3ceccc3a..000000000 --- a/mails/it/download-product.tpl +++ /dev/null @@ -1,13 +0,0 @@ -
            -{foreach from=$virtualProducts item=product} -
          • - {$product.name} - {if isset($product.deadline)} - expires on {$product.deadline} - {/if} - {if isset($product.downloadable)} - downloadable {$product.downloadable} times - {/if} -
          • -{/foreach} -
          \ No newline at end of file diff --git a/mails/it/download_product.html b/mails/it/download_product.html deleted file mode 100644 index a023e9381..000000000 --- a/mails/it/download_product.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname}, grazie di aver acquistato con {shop_name}.
           
          Prodotto/i da scaricare
           
          Hai {nbProducts} prodotto/i da scaricare.
           
          Qui di seguito trovarai i link per questi prodotti: {virtualProducts}
           
          Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordini ospite"del nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/download_product.txt b/mails/it/download_product.txt deleted file mode 100644 index 0d7b2a449..000000000 --- a/mails/it/download_product.txt +++ /dev/null @@ -1,11 +0,0 @@ -{firstname} {lastname}, grazie del tuo ordine su {shop_name}! - -Hai {nbProducts} prodotto/i da scaricare. - -Qui di seguito troverai i link per questi prodotti: -{virtualProducts} - -Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordini" del tuo account cliccando su "Il mio account" nel nostro sito web. -Se hai un account ospite, puoi seguire il tuo ordine in questa pagina: {guest_tracking_url} - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/employee_password.html b/mails/it/employee_password.html deleted file mode 100644 index a62ac1ac5..000000000 --- a/mails/it/employee_password.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          I tuoi dati personali di login
           
          Nome: {firstname}
          Cognome: {lastname}
          Password: {passwd}
          Indirizzo e-mail: {email}
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/employee_password.txt b/mails/it/employee_password.txt deleted file mode 100644 index 7627048fb..000000000 --- a/mails/it/employee_password.txt +++ /dev/null @@ -1,14 +0,0 @@ -Salve {firstname} {lastname}, - -I dati personali di login del tuo negozio {shop_name}: - -* Nome: {firstname} -* Cognome: {lastname} -* Password: {passwd} -* Indirizzo e-mail: {email} - -{shop_name} - {shop_url} - - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/forward_msg.html b/mails/it/forward_msg.html deleted file mode 100644 index ebf655e30..000000000 --- a/mails/it/forward_msg.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - -
          {employee} desidera inviarti questa chat.

          {messages}

          {employee} ha aggiunto "{comment}".
          - - - \ No newline at end of file diff --git a/mails/it/forward_msg.txt b/mails/it/forward_msg.txt deleted file mode 100644 index 041546841..000000000 --- a/mails/it/forward_msg.txt +++ /dev/null @@ -1,4 +0,0 @@ -{employee} desidera inviarti questa chat. -Commento: {comment} - -{messages} diff --git a/mails/it/guest_to_customer.html b/mails/it/guest_to_customer.html deleted file mode 100644 index 309d3c4b0..000000000 --- a/mails/it/guest_to_customer.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          Il tuo account ospite è stato trasformato in account cliente
           
          Indirizzo e-mail: {email}
          Password: {passwd}
           
          Fai attenzione a non condividere con altri i tuoi dati di login.

          Puoi accedere al tuo account nel nostro sito web: {shop_url}
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/guest_to_customer.txt b/mails/it/guest_to_customer.txt deleted file mode 100644 index 1def939df..000000000 --- a/mails/it/guest_to_customer.txt +++ /dev/null @@ -1,15 +0,0 @@ - Salve {firstname} {lastname}, - - Il tuo account ospite è stato trasformato in account cliente: - - Indirizzo e-mail: {email} - Password: {passwd} - - - Puoi accedere al tuo account nel nostro sito web: {shop_url} - - Fai attenzione a non condividere con altri i tuoi dati di login. - - - - {shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/in_transit.html b/mails/it/in_transit.html deleted file mode 100644 index fb6ab8286..000000000 --- a/mails/it/in_transit.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          La cronologia del tuo ordine n.{id_order}
           
          Il tuo ordine è attualmente in viaggio.
           
          Puoi controllare la posizione del tuo pacco cliccando nel link seguente: {followup}
           
          Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordini ospite" del nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/in_transit.txt b/mails/it/in_transit.txt deleted file mode 100644 index 4af38990a..000000000 --- a/mails/it/in_transit.txt +++ /dev/null @@ -1,16 +0,0 @@ -Salve {firstname} {lastname}, - -Il tuo ordine è attualmente in viaggio. - -Puoi controllare la posizione del tuo pacco cliccando nel link seguente: {followup} - -Puoi anche rivedere questo ordine e scaricare la tua fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. -Se hai un account ospite, puoi seguire l'ordine in questa pagina: {guest_tracking_url} - -Grazie per aver acquistato con {shop_name}! - -{shop_name} - {shop_url} - - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/lang.php b/mails/it/lang.php deleted file mode 100644 index 5b1cddfc2..000000000 --- a/mails/it/lang.php +++ /dev/null @@ -1,42 +0,0 @@ - \ No newline at end of file diff --git a/mails/it/log_alert.html b/mails/it/log_alert.html deleted file mode 100755 index f139a74d2..000000000 --- a/mails/it/log_alert.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve,
           
          Nuovo messaggio di avviso
           
          Purtroppo è stato registrato un nuovo messaggio di avviso.
           
          Puoi controllarlo nel tuo Back office > Strumenti> Log del nostro sito.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/log_alert.txt b/mails/it/log_alert.txt deleted file mode 100755 index 2a64e2cb6..000000000 --- a/mails/it/log_alert.txt +++ /dev/null @@ -1,11 +0,0 @@ -Salve, - -Nuovo messaggio di avviso - -Purtroppo è stato registrato un nuovo messaggio di avviso. - -Puoi controllarlo nel tuo Back office > Strumenti > Log del nostro sito. - -{shop_name} - {shop_url} - -{shop_url} powered by PrestaShop™ diff --git a/mails/it/newsletter.html b/mails/it/newsletter.html deleted file mode 100644 index 78816108c..000000000 --- a/mails/it/newsletter.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Newsletter da {shop_name}
           
          {message}
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/newsletter.txt b/mails/it/newsletter.txt deleted file mode 100644 index a43a26877..000000000 --- a/mails/it/newsletter.txt +++ /dev/null @@ -1,9 +0,0 @@ -Newsletter da {shop_name} - -Messaggio - -{message} - - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/order_canceled.html b/mails/it/order_canceled.html deleted file mode 100644 index bf03ef834..000000000 --- a/mails/it/order_canceled.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          Riguardo al tuo ordine n.{id_order}
           
          Il tuo ordine è stato cancellato.
           
          Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordini ospite" nel nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/order_canceled.txt b/mails/it/order_canceled.txt deleted file mode 100644 index b1f9b647c..000000000 --- a/mails/it/order_canceled.txt +++ /dev/null @@ -1,14 +0,0 @@ -Salve {firstname} {lastname}, - -Riguardo al tuo ordine n.{id_order}: - -Il tuo ordine è stato cancellato. - -Puoi rivedere questo ordine e scaricare la tua fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. -Se hai un account ospite, puoi seguire l'ordine in questa pagina: {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/order_changed.html b/mails/it/order_changed.html deleted file mode 100644 index 62b96dadf..000000000 --- a/mails/it/order_changed.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hi {firstname} {lastname},
           
          Your order with the reference {order_name} - Order changed
           
          Your order with the reference {order_name} from {shop_name} has been changed by the merchant.
           
          You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop.

          If you have a guest account, you can follow your order via the "Guest Tracking" section on our shop.
           
          {shop_name} powered by PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/order_changed.txt b/mails/it/order_changed.txt deleted file mode 100644 index 3e460a8d3..000000000 --- a/mails/it/order_changed.txt +++ /dev/null @@ -1,11 +0,0 @@ -Hi {firstname} {lastname}, - -Your order with the reference {order_name} from {shop_name} has been changed by the merchant. - -You can review your order and download your invoice from the "Order history" section of your customer account by clicking "My account" on our shop. - -If you have guest account, you can follow your order using this link: {shop_url}?controller=guest-tracking - -{shop_name} - {shop_url} - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/order_conf.html b/mails/it/order_conf.html deleted file mode 100644 index 022d90366..000000000 --- a/mails/it/order_conf.html +++ /dev/null @@ -1,121 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname}, grazie di aver acquistato con {shop_name}.
           
          Dati dell'ordine
           
          Ordine: {order_name} effettuato il {date}
          Pagamento: {payment}
           
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          RiferimentoProdottoPrezzo unitarioQuantitàPrezzo totale
          {products}
          {discounts}
           Prodotti{total_products}
           Sconti{total_discounts}
           Carta regalo{total_wrapping}
           Spedizione{total_shipping}
           Totale pagato{total_paid}
          -
           
          Spedizione
           
          Mezzo di spedizione: {carrier}
           
          - - - - - - - - -
          INDIRIZZO DI CONSEGNAINDIRIZZO DI FATTURAZIONE
          {delivery_block_html}{invoice_block_html}
          -
           
          Puoi rivedere l'ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordini ospite" del nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/order_conf.txt b/mails/it/order_conf.txt deleted file mode 100644 index 0c3789a47..000000000 --- a/mails/it/order_conf.txt +++ /dev/null @@ -1,30 +0,0 @@ -Salve {firstname} {lastname}, grazie del tuo ordine su {shop_name}! - -Dettagli dell'ordine - - Ordine: {order_name} eseguito il {date} - Pagamento: {payment} - - Prodotti: {total_products} - Sconti: {total_discounts} - Spedizione: {total_shipping} - Carta regalo: {total_wrapping} - Totale: {total_paid} - - -Spedizione - - Mezzo di spedizione: {carrier} - - Indirizzo di consegna: - - {delivery_block_html} - - Indirizzo di fatturazione: - - {delivery_block_html} - -Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. -Se hai un account ospite, puoi seguire il tuo ordine in questa pagina: {guest_tracking_url} - -{shop_url} powered by PrestaShop™ diff --git a/mails/it/order_customer_comment.html b/mails/it/order_customer_comment.html deleted file mode 100644 index 1050f00dd..000000000 --- a/mails/it/order_customer_comment.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Messaggio da un cliente da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hi,
           
          Messaggio da {firstname} {lastname} ({email})
           
          Hai ricevuto un nuovo messaggio riguardo all'ordine n.{id_order}:

          {message}
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/order_customer_comment.txt b/mails/it/order_customer_comment.txt deleted file mode 100644 index 088096d7b..000000000 --- a/mails/it/order_customer_comment.txt +++ /dev/null @@ -1,8 +0,0 @@ -Salve {firstname} {lastname}, - -Hai ricevuto un nuovo messaggio riguardo all'ordine n.{id_order}: - -{message} - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/order_merchant_comment.html b/mails/it/order_merchant_comment.html deleted file mode 100644 index fa66fde76..000000000 --- a/mails/it/order_merchant_comment.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          Messaggio da {shop_name}
           
          Hai ricevuto un nuovo messaggio riguardante l'ordine n.{id_order}:

          {message}
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/order_merchant_comment.txt b/mails/it/order_merchant_comment.txt deleted file mode 100644 index 85a017b59..000000000 --- a/mails/it/order_merchant_comment.txt +++ /dev/null @@ -1,10 +0,0 @@ -Messaggio da {shop_name} - -Salve {firstname} {lastname}, - -Hai ricevuto un nuovo messaggio riguardo all'ordine n.{id_order}: -{message} - - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/order_return_state.html b/mails/it/order_return_state.html deleted file mode 100644 index 1d00a9593..000000000 --- a/mails/it/order_return_state.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          Cronologia della restituzione dell'ordine n.{id_order_return}
           
          Il tuo buono di restituzione è cambiato in "{state_order_return}".
           
          Puoi rivedere questo ordine nella sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/order_return_state.txt b/mails/it/order_return_state.txt deleted file mode 100644 index acda21587..000000000 --- a/mails/it/order_return_state.txt +++ /dev/null @@ -1,11 +0,0 @@ -Salve {firstname} {lastname}, - -La cronologia del tuo buono di restituzione n.{id_order_return} è cambiata in "{state_order_return}". - -Puoi rivedere questa restituzione dell'ordine nella sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. - -{shop_name} - {shop_url} - - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/outofstock.html b/mails/it/outofstock.html deleted file mode 100644 index e7176cb71..000000000 --- a/mails/it/outofstock.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          La cronologia del tuo ordine n. id_order}
           
          Purtroppo, uno o più articoli del tuo ordine n.{id_order} sono al momento esauriti. Questo può provocare un leggero ritardo nella consegna. Ti preghiamo di scusarci e ti assicuriamo che stiamo facendo di tutto per risolvere il problema.
           
          Puoi rivedere questo ordine e scaricare la fattura nella sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite puoi seguire il tuo ordine nella sezione "Controllo ordini ospite" nel nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/outofstock.txt b/mails/it/outofstock.txt deleted file mode 100644 index 82418ad44..000000000 --- a/mails/it/outofstock.txt +++ /dev/null @@ -1,14 +0,0 @@ - Salve {firstname} {lastname}, - - La cronologia del tuo ordine n.{id_order} - -Purtroppo, uno o più articoli del tuo ordine n.{id_order} sono al momento esauriti. Questo può provocare un leggero ritardo nella consegna. Ti preghiamo di scusarci e ti assicuriamo che stiamo facendo di tutto per risolvere il problema. - -Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. -Se hai un account ospite, puoi seguire il tuo ordine in questa pagina: {guest_tracking_url} - - {shop_name} - {shop_url} - - - - {shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/password.html b/mails/it/password.html deleted file mode 100644 index 8cf5b8311..000000000 --- a/mails/it/password.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Messagio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          I tuoi nuovi dati di login
           
          Indirizzo e-mail: {email}
          Password: {passwd}
           
          Fai attenzione a non condividere con nessuno i tuoi dati di login.

          Adesso puoi effettuare un ordine nel nostro sito web: {shop_url}
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/password.txt b/mails/it/password.txt deleted file mode 100644 index 36652f721..000000000 --- a/mails/it/password.txt +++ /dev/null @@ -1,12 +0,0 @@ -Salve {firstname} {lastname}, - -I tuoi nuovi dati di login: - -Indirizzo e-mail address: {email} -Password: {passwd} - -Adesso puoi effettuare un ordine nel nostro sito web: {shop_url} - -Fai attenzione a non condividere con nessuno questi dati di login. - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/password_query.html b/mails/it/password_query.html deleted file mode 100644 index 288bcefc2..000000000 --- a/mails/it/password_query.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          Hai chiesto di restituire i tuoi codici di accesso di {shop_name},
          Nota che questo farà cambiare la tua password attuale.
           
          Se davvero vuoi farlo, clicca nel link seguente:
          {url}
           
          {shop_name} realised by PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/password_query.txt b/mails/it/password_query.txt deleted file mode 100644 index 3f468f21f..000000000 --- a/mails/it/password_query.txt +++ /dev/null @@ -1,9 +0,0 @@ -Salve {firstname} {lastname}, - -Hai chiesto di restituire i tuoi codici di accesso di {shop_name}. -Nota che questo farà cambiare la tua password attuale. - -Se vuoi davvero farlo, clicca nel link seguente : -{url} - -{shop_url} powered by PrestaShop™ diff --git a/mails/it/payment.html b/mails/it/payment.html deleted file mode 100644 index 4c2683f4a..000000000 --- a/mails/it/payment.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          La cronologia del tuo ordine n.{id_order}
           
          Il pagamento per il tuo ordine è stato elaborato.
           
          Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/payment.txt b/mails/it/payment.txt deleted file mode 100644 index 8b8cd4762..000000000 --- a/mails/it/payment.txt +++ /dev/null @@ -1,13 +0,0 @@ - Salve {firstname} {lastname}, - - La tua cronologia dell'ordine n.{id_order} - - Il pagamento per il tuo ordine è stato elaborato. - - Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. - - {shop_name} - {shop_url} - - Grazie di aver acquistato con {shop_name}. - - {shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/payment_error.html b/mails/it/payment_error.html deleted file mode 100644 index e8fa594ea..000000000 --- a/mails/it/payment_error.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          La cronologia del tuo ordine n. id_order}
           
          Si è verificato un problema con il tuo pagamento dell'ordine n.{id_order}. Contattaci appena puoi.
           
          Il tuo ordine non sarà inviato fino a che non avremo risolto il problema.
           
          Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordini ospite" del nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/payment_error.txt b/mails/it/payment_error.txt deleted file mode 100644 index d416aae38..000000000 --- a/mails/it/payment_error.txt +++ /dev/null @@ -1,14 +0,0 @@ -Salve {firstname} {lastname}, - -Si è verificato un problema con il tuo pagamento dell'ordine n.{id_order}. Contattaci appena puoi. - -Il tuo ordine non sarà inviato fino a che non avremo risolto il problema. - -Puoi rivedere questo ordine e scaricare la tua fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. -Se hai un account ospite, puoi seguire il tuo ordine in questa pagina: {guest_tracking_url} - -{shop_name} - {shop_url} - - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/preparation.html b/mails/it/preparation.html deleted file mode 100644 index 976097207..000000000 --- a/mails/it/preparation.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          Cronologia del tuo ordine n.{id_order}
           
          Stiamo elaborando il tuo ordine.
           
          Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordini ospitedel nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/preparation.txt b/mails/it/preparation.txt deleted file mode 100644 index 377787db6..000000000 --- a/mails/it/preparation.txt +++ /dev/null @@ -1,14 +0,0 @@ - Salve {firstname} {lastname}, - - La cronologia del tuo ordine n.{id_order} - - Stiamo elaborando il tuo ordine. - - Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. - Se hai un account ospite, puoi seguire il tuo ordine in questa pagina: {guest_tracking_url} - - {shop_name} - {shop_url} - - - - {shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/refund.html b/mails/it/refund.html deleted file mode 100644 index 5c2b49233..000000000 --- a/mails/it/refund.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          Cronologia del tuo ordine n.{id_order}
           
          Il pagamento del tuo ordine è stato rimborsato.
           
          Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordini ospite" nel nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/refund.txt b/mails/it/refund.txt deleted file mode 100644 index 132bb88a6..000000000 --- a/mails/it/refund.txt +++ /dev/null @@ -1,12 +0,0 @@ - Salve {firstname} {lastname}, - - Il pagamento del tuo ordine è stato rimborsato. - - Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. - Se hai un account ospite, puoi seguire il tuo ordine in questa pagina: {guest_tracking_url} - - {shop_name} - {shop_url} - - - - {shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/reply_msg.html b/mails/it/reply_msg.html deleted file mode 100644 index 8fa22b89a..000000000 --- a/mails/it/reply_msg.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - -
          {reply}

          Non rispondere a questo messaggio usando la tua mail cliente, il tuo messaggio non ci arriverebbe.
          Per rispondere, usa esclusivamente il link seguente: {link}.
          - - - \ No newline at end of file diff --git a/mails/it/reply_msg.txt b/mails/it/reply_msg.txt deleted file mode 100644 index 66066d5c1..000000000 --- a/mails/it/reply_msg.txt +++ /dev/null @@ -1,4 +0,0 @@ -{reply} - -Non rispondere a questo messaggio usando la tua e-mail cliente, il tuo messaggio non ci arriverebbe. -Per rispondere, usa esclusivamente il link seguente: {link} diff --git a/mails/it/shipped.html b/mails/it/shipped.html deleted file mode 100644 index c113f8c1c..000000000 --- a/mails/it/shipped.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          Cronologia del tuo ordine n.{id_order}
           
          Il tuo ordine è stato spedito.
          Riceverai presto un URL su cui cliccare per rintracciare i progressi di consegna del tuo pacco.
           
          Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web.
          Se hai un account ospite, puoi seguire il tuo ordine nella sezione "Controllo ordini ospite"nel nostro sito web.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/shipped.txt b/mails/it/shipped.txt deleted file mode 100644 index 907b90210..000000000 --- a/mails/it/shipped.txt +++ /dev/null @@ -1,16 +0,0 @@ -Salve {firstname} {lastname}, - -Il tuo ordine è stato appena spedito. - -Riceverai presto un URL su cui cliccare per rintracciare i progressi di consegna del tuo pacco. - -Puoi rivedere questo ordine e scaricare la fattura dalla sezione "Cronologia ordine" del tuo account cliccando su "Il mio account" nel nostro sito web. - Se hai un account ospite, puoi seguire il tuo ordine in questa pagina: {guest_tracking_url} - -Grazie di aver acquistato con {shop_name}! - -{shop_name} - {shop_url} - - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/test.html b/mails/it/test.html deleted file mode 100644 index 1ed586876..000000000 --- a/mails/it/test.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - Mail di prova - - - - - - - - - - - - - - -
          Salve,

          Questa è una mail di prova da parte del tuo negozio.
           
          powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/test.txt b/mails/it/test.txt deleted file mode 100644 index ad38277f0..000000000 --- a/mails/it/test.txt +++ /dev/null @@ -1,3 +0,0 @@ - Salve, - - Questa è una mail di prova da parte del tuo negozio online PrestaShop™. \ No newline at end of file diff --git a/mails/it/voucher.html b/mails/it/voucher.html deleted file mode 100644 index e1d7593bb..000000000 --- a/mails/it/voucher.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - Messaggio da {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Salve {firstname} {lastname},
           
          Cronologia del tuo ordine n.{id_order}
           
          Vorremmo informarti della creazione di un buono sconto a tuo nome in seguito al tuo ordine n.{id_order}.
           
          Ecco il codice del tuo buono:{voucher_num}, per l'importo di {voucher_amount}.
          Basta che durante il processo di pagamento del prossimo ordine tu copi/incolli questo codice.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/voucher.txt b/mails/it/voucher.txt deleted file mode 100644 index f9e6abad9..000000000 --- a/mails/it/voucher.txt +++ /dev/null @@ -1,14 +0,0 @@ -Salve {firstname} {lastname}, - -Vorremmo informarti della creazione di un buono sconto a tuo nome in seguito al tuo ordine n.{id_order}. - -Ecco il codice del tuo buono: {voucher_num}, per l'importo di {voucher_amount}. - -Basta che durante il processo di pagamento del prossimo ordine tu copi/incolli questo codice. - -Grazie di aver acquistato a {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} powered by PrestaShop™ \ No newline at end of file diff --git a/mails/it/voucher_new.html b/mails/it/voucher_new.html deleted file mode 100644 index d2d9b63f2..000000000 --- a/mails/it/voucher_new.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - Message from {shop_name} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          {shop_name}
           
          Hi {firstname} {lastname},
           
          This is to inform you about the creation of a voucher.
           
          Here is the code of your voucher : {voucher_num}.
          Simply copy/paste this code during the payment process for your next order.
           
          {shop_name} powered with PrestaShop™
          - - - \ No newline at end of file diff --git a/mails/it/voucher_new.txt b/mails/it/voucher_new.txt deleted file mode 100644 index 1761525de..000000000 --- a/mails/it/voucher_new.txt +++ /dev/null @@ -1,14 +0,0 @@ -Hi {firstname} {lastname}, - -This is to inform you about the creation of a voucher. - -Here is the code of your voucher : {voucher_num}. - -Simply copy/paste this code during the payment process for your next order. - -Thank you for shopping at {shop_name}. - -{shop_name} - {shop_url} - - -{shop_url} powered by PrestaShop diff --git a/manufacturer.php b/manufacturer.php index 2d5915ae6..92715f48d 100644 --- a/manufacturer.php +++ b/manufacturer.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -34,4 +34,4 @@ require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); -Tools::redirect('index.php?controller=manufacturer'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file +Tools::redirect('index.php?controller=manufacturer'.((count($_GET) || count($_POST)) ? '&'.http_build_query(array_merge($_GET, $_POST), '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); \ No newline at end of file diff --git a/modules/bankwire/bankwire.php b/modules/bankwire/bankwire.php index 22f5483d9..057ca719a 100644 --- a/modules/bankwire/bankwire.php +++ b/modules/bankwire/bankwire.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -40,7 +40,7 @@ class BankWire extends PaymentModule { $this->name = 'bankwire'; $this->tab = 'payments_gateways'; - $this->version = '0.5'; + $this->version = '0.6'; $this->author = 'PrestaShop'; $this->currencies = true; @@ -57,12 +57,12 @@ class BankWire extends PaymentModule parent::__construct(); $this->displayName = $this->l('Bank Wire'); - $this->description = $this->l('Accept payments by bank wire.'); - $this->confirmUninstall = $this->l('Are you sure you want to delete your details?'); + $this->description = $this->l('Accept payments for your products via bank wire.'); + $this->confirmUninstall = $this->l('Are you sure about removing these details?'); if (!isset($this->owner) || !isset($this->details) || !isset($this->address)) - $this->warning = $this->l('Account owner and details must be configured in order to use this module correctly.'); + $this->warning = $this->l('Account owner and account details must be configured before using this module.'); if (!count(Currency::checkPaymentCurrencies($this->id))) - $this->warning = $this->l('No currency set for this module'); + $this->warning = $this->l('No currency has been set for this module.'); $this->extra_mail_vars = array( '{bankwire_owner}' => Configuration::get('BANK_WIRE_OWNER'), @@ -112,9 +112,9 @@ class BankWire extends PaymentModule private function _displayBankWire() { - $this->_html .= ''.$this->l('This module allows you to accept payments by bank wire.').'

          - '.$this->l('If the client chooses this payment mode, the order will change its status into a \'Waiting for payment\' status.').'
          - '.$this->l('Therefore, you must manually confirm the order as soon as you receive the wire.').'


          '; + $this->_html .= ''.$this->l('This module allows you to accept secure payments by bank wire.').'

          + '.$this->l('If the client chooses to pay by bank wire, the order\'s status will change to "Waiting for Payment."').'
          + '.$this->l('That said, you must manually confirm the order upon receiving the bank wire. ').'


          '; } private function _displayForm() @@ -124,13 +124,13 @@ class BankWire extends PaymentModule
          '.$this->l('Contact details').' - + @@ -177,6 +177,7 @@ class BankWire extends PaymentModule $this->smarty->assign(array( 'this_path' => $this->_path, + 'this_path_bw' => $this->_path, 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' )); return $this->display(__FILE__, 'payment.tpl'); diff --git a/modules/bankwire/config.xml b/modules/bankwire/config.xml index 08550b4b3..abb916c61 100755 --- a/modules/bankwire/config.xml +++ b/modules/bankwire/config.xml @@ -2,11 +2,11 @@ bankwire - - + + - Are you sure you want to delete your details? + Are you sure about removing these details? 1 1 diff --git a/modules/bankwire/controllers/front/index.php b/modules/bankwire/controllers/front/index.php index b37b3d3c4..3f4b16e7e 100644 --- a/modules/bankwire/controllers/front/index.php +++ b/modules/bankwire/controllers/front/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/controllers/front/payment.php b/modules/bankwire/controllers/front/payment.php index e90f6b240..58d61bdf1 100644 --- a/modules/bankwire/controllers/front/payment.php +++ b/modules/bankwire/controllers/front/payment.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -49,6 +49,7 @@ class BankwirePaymentModuleFrontController extends ModuleFrontController 'currencies' => $this->module->getCurrency((int)$cart->id_currency), 'total' => $cart->getOrderTotal(true, Cart::BOTH), 'this_path' => $this->module->getPathUri(), + 'this_path_bw' => $this->module->getPathUri(), 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->module->name.'/' )); diff --git a/modules/bankwire/controllers/front/validation.php b/modules/bankwire/controllers/front/validation.php index feb3cc73c..6cbaa4fef 100644 --- a/modules/bankwire/controllers/front/validation.php +++ b/modules/bankwire/controllers/front/validation.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/controllers/index.php b/modules/bankwire/controllers/index.php index f642dd55e..fd6bae0d3 100644 --- a/modules/bankwire/controllers/index.php +++ b/modules/bankwire/controllers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/index.php b/modules/bankwire/index.php index 3d9fb1394..3f6561f72 100644 --- a/modules/bankwire/index.php +++ b/modules/bankwire/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/payment.php b/modules/bankwire/payment.php index 87de811b0..faca7ee9a 100644 --- a/modules/bankwire/payment.php +++ b/modules/bankwire/payment.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/translations/de.php b/modules/bankwire/translations/de.php deleted file mode 100644 index e8b9471db..000000000 --- a/modules/bankwire/translations/de.php +++ /dev/null @@ -1,53 +0,0 @@ -bankwire_85ee0d0492a4e37e6c183520f5d59c40'] = 'Banküberweisung'; -$_MODULE['<{bankwire}prestashop>bankwire_f652b92eefd4ecfe61ef5fb118157a05'] = 'Zahlungen per Banküberweisung annehmen'; -$_MODULE['<{bankwire}prestashop>bankwire_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Sind Sie sicher, dass Sie Ihre Details löschen möchten?'; -$_MODULE['<{bankwire}prestashop>bankwire_f05d09f37c9a02f0737c1e71142028a9'] = 'Kontoinhaber und Details müssen konfiguriert werden, um dieses Modul korrekt zu nutzen'; -$_MODULE['<{bankwire}prestashop>bankwire_4402acab1c8f90dcf4a31dc96833bd86'] = 'Keine Währung für dieses Modul eingestellte'; -$_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = 'Konto-Details erforderlich.'; -$_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Kontoinhaber erforderlich.'; -$_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; -$_MODULE['<{bankwire}prestashop>bankwire_fcec4d73cccd149a2d18695fd8785f88'] = 'Dieses Modul ermöglicht Ihnen Zahlungen per Banküberweisung.'; -$_MODULE['<{bankwire}prestashop>bankwire_b6af2d31afe71aedcceca73cc27fec29'] = 'Wenn der Kunde diese Zahlungsmethode wählt, wird der Bestellstatus auf \"Wartet auf Zahlung\" umgestellt.'; -$_MODULE['<{bankwire}prestashop>bankwire_0daeb8f6c1874ec9442e821b524d37c1'] = 'Aus diesem Grund müssen Sie die Bestellung manuell bestätigen, sobald Sie die Überweisung erhalten.'; -$_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Kontaktangaben'; -$_MODULE['<{bankwire}prestashop>bankwire_17e6954ea60d238857324fea1f10b8f3'] = 'Bitte spezifizieren Sie die Bankverbindungsdetails für Kunden.'; -$_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Kontoinhaber'; -$_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Details'; -$_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'wie Zweigstelle, IBAN-Nummer, BIC, etc.'; -$_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Bankadresse'; -$_MODULE['<{bankwire}prestashop>bankwire_b17f3f4dcf653a5776792498a9b44d6a'] = 'Einstellungen aktualisieren'; -$_MODULE['<{bankwire}prestashop>validation_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Diese Zahlungsmodlität ist nich verfügbar.'; -$_MODULE['<{bankwire}prestashop>payment_execution_c5e8668ba5e211603955f0b5e913d83d'] = 'Zahlung per Banküberweisung'; -$_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Bestellsumme'; -$_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Ihr Warenkorb ist leer.'; -$_MODULE['<{bankwire}prestashop>payment_execution_e40a43534d7f4ece69347847d75401e0'] = 'Banküberweisung'; -$_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'Sie möchten per Banküberweisung zahlen.'; -$_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Hier ist eine kurze Zusammenfassung Ihrer Bestellung:'; -$_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Der Gesamtbetrag Ihrer Bestellung beträgt'; -$_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = '(Inkl. Mwst.)'; -$_MODULE['<{bankwire}prestashop>payment_execution_e2c147f82d998eeeb147ae172a31a88e'] = 'Wir nehmen bestimmte Währungen per Banküberweisung an.'; -$_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Wählen Sie eine der folgenden Möglichkeiten:'; -$_MODULE['<{bankwire}prestashop>payment_execution_2c1ce705702e11fd5e2188c2353c0c86'] = 'Wir nehmen folgende Währung per Banküberweisung an:'; -$_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'Die Kontoinformationen zur Banküberweisung stehen auf der folgenden Seite.'; -$_MODULE['<{bankwire}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Bitte bestätigen Sie Ihre Bestellung durch Klicken auf \"KAUFEN\"'; -$_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Ich bestätige meine Bestellung'; -$_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Andere Zahlungsmethoden'; -$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Zahlung per Banküberweisung'; -$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Zahlung per Banküberweisung (längerer Bestellvorgang)'; -$_MODULE['<{bankwire}prestashop>payment_return_88526efe38fd18179a127024aba8c1d7'] = 'Ihre Bestellung auf %s ist abgeschlossen.'; -$_MODULE['<{bankwire}prestashop>payment_return_1552c5916ccfe019f35d91fd8955755e'] = 'Bitte senden Sie uns folgenden Betrag per Banküberweisung:'; -$_MODULE['<{bankwire}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'folgenden Betrag'; -$_MODULE['<{bankwire}prestashop>payment_return_c51326a2ac458845d579a82a92f111f0'] = 'an den Kontoinhaber von'; -$_MODULE['<{bankwire}prestashop>payment_return_de6d813f05e3916a86b89bd8b1a8a489'] = 'mit dieser Bankverbindung'; -$_MODULE['<{bankwire}prestashop>payment_return_619b26a60df1af3649d2e8920a7949cd'] = 'an diese Bank'; -$_MODULE['<{bankwire}prestashop>payment_return_63fb3f7c94ee5d8027bf599885de279d'] = 'Vergessen Sie nicht Ihre Bestellnummer #%d in den Titel Ihrer Bankverbindung anzugeben.'; -$_MODULE['<{bankwire}prestashop>payment_return_1faa25b80a8d31e5ef25a78d3336606d'] = 'Vergessen Sie nicht Ihre Auftrags-Referenz-Nummer #%d in den Titel Ihrer Bankverbindung anzugeben.'; -$_MODULE['<{bankwire}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Eine E-Mail wurde Ihnen mit diesen Informationen gesendet.'; -$_MODULE['<{bankwire}prestashop>payment_return_c4457a9f2f20e39386008bbb2cd3a78f'] = 'Ihre Bestellung wird abgesendet, sobald wir Ihre Überweisung erhalten haben.'; -$_MODULE['<{bankwire}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Bei Fragen oder für weitere Informationen, kontaktieren Sie bitte unseren'; -$_MODULE['<{bankwire}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'Kunden-Support'; -$_MODULE['<{bankwire}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Wir haben bei Ihrer Bestellung ein Problem festgestellt. Wenn Sie denken, dies sei ein Fehler, können Sie an unseren'; diff --git a/modules/bankwire/translations/en.php b/modules/bankwire/translations/en.php deleted file mode 100644 index 9839c82f9..000000000 --- a/modules/bankwire/translations/en.php +++ /dev/null @@ -1,4 +0,0 @@ -bankwire_85ee0d0492a4e37e6c183520f5d59c40'] = 'Trasferencia bancaria'; -$_MODULE['<{bankwire}prestashop>bankwire_f652b92eefd4ecfe61ef5fb118157a05'] = 'Se aceptan pagos por trasferencia bancaria'; -$_MODULE['<{bankwire}prestashop>bankwire_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = '¿Está seguro de querer borrar los detalles?'; -$_MODULE['<{bankwire}prestashop>bankwire_f05d09f37c9a02f0737c1e71142028a9'] = 'El propietario y detalles de la cuenta deben configurarse para usar el módulo correctamente'; -$_MODULE['<{bankwire}prestashop>bankwire_4402acab1c8f90dcf4a31dc96833bd86'] = 'Ninguna divisa disponible para este módulo'; -$_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = 'se necesitan los detalles de la cuenta.'; -$_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Se necesita el propietario de la cuenta.'; -$_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'Actualización realizada con éxito'; -$_MODULE['<{bankwire}prestashop>bankwire_fcec4d73cccd149a2d18695fd8785f88'] = 'Este módulo permite aceptar pagos por trasferencia bancaria.'; -$_MODULE['<{bankwire}prestashop>bankwire_b6af2d31afe71aedcceca73cc27fec29'] = 'si el cliente elije este modo de pago, el pedido cambiará su estado a \"pendiente de pago\".'; -$_MODULE['<{bankwire}prestashop>bankwire_0daeb8f6c1874ec9442e821b524d37c1'] = 'Por lo tanto, deberá confirmar el pedido en cuanto reciba la trasferencia.'; -$_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Detalles contacto'; -$_MODULE['<{bankwire}prestashop>bankwire_17e6954ea60d238857324fea1f10b8f3'] = 'Por favor, especifique los detalles de la cuenta para sus clientes'; -$_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Propietario de la cuenta'; -$_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Detalles'; -$_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'tales como: sucursal bancaria, código IBAN, BIC, etc.'; -$_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Dirección agencia bancaria'; -$_MODULE['<{bankwire}prestashop>bankwire_b17f3f4dcf653a5776792498a9b44d6a'] = 'Ajustes actualizados'; -$_MODULE['<{bankwire}prestashop>validation_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Esta forma de pago no está disponible.'; -$_MODULE['<{bankwire}prestashop>payment_execution_c5e8668ba5e211603955f0b5e913d83d'] = 'Pago por transferencia bancaria'; -$_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Resumen del pedido'; -$_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Su carrito está vacío'; -$_MODULE['<{bankwire}prestashop>payment_execution_e40a43534d7f4ece69347847d75401e0'] = 'Transferencia bancaria'; -$_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'Ha elegido pagar por transferencia bancaria'; -$_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Resumen de su pedido:'; -$_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'El importe total de su pedido asciende a'; -$_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = 'IVA incluido'; -$_MODULE['<{bankwire}prestashop>payment_execution_e2c147f82d998eeeb147ae172a31a88e'] = 'Aceptamos diferentes monedas para la transferencia bancaria.'; -$_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Elija entre las siguientes:'; -$_MODULE['<{bankwire}prestashop>payment_execution_2c1ce705702e11fd5e2188c2353c0c86'] = 'Aceptamos las siguientes monedas para las transferencias bancarias:'; -$_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'La información para realizar la trasferencia bancaria aparecerá en la página siguiente.'; -$_MODULE['<{bankwire}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Por favor, confirme su pedido pulsando en \"Confirmo mi pedido\"'; -$_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Confirmo mi pedido'; -$_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Otros modos de pago'; -$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Pago por transferencia bancaria'; -$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Pago por transferencia bancaria (el proceso llevará más tiempo)'; -$_MODULE['<{bankwire}prestashop>payment_return_88526efe38fd18179a127024aba8c1d7'] = 'Su pedido %s está completo.'; -$_MODULE['<{bankwire}prestashop>payment_return_1552c5916ccfe019f35d91fd8955755e'] = 'por favor, háganos una transferencia por:'; -$_MODULE['<{bankwire}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'por un valor de'; -$_MODULE['<{bankwire}prestashop>payment_return_c51326a2ac458845d579a82a92f111f0'] = 'al propietario de la cuenta'; -$_MODULE['<{bankwire}prestashop>payment_return_de6d813f05e3916a86b89bd8b1a8a489'] = 'con los siguientes datos'; -$_MODULE['<{bankwire}prestashop>payment_return_619b26a60df1af3649d2e8920a7949cd'] = 'a este banco'; -$_MODULE['<{bankwire}prestashop>payment_return_63fb3f7c94ee5d8027bf599885de279d'] = 'No te olvides de insertar su número de pedido #%d en el tema de su transferencia bancaria'; -$_MODULE['<{bankwire}prestashop>payment_return_1faa25b80a8d31e5ef25a78d3336606d'] = 'No te olvides de insertar tu número de pedido %s en el tema de su transferencia bancaria.'; -$_MODULE['<{bankwire}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Le hemos enviado un email con los datos anteriores.'; -$_MODULE['<{bankwire}prestashop>payment_return_c4457a9f2f20e39386008bbb2cd3a78f'] = 'Su pedido será enviado próximamente, en cuanto recibamos su pago.'; -$_MODULE['<{bankwire}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Para cualquier duda o para más información, póngase en contacto con nuestro servicio'; -$_MODULE['<{bankwire}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'de atención al cliente'; -$_MODULE['<{bankwire}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Hay un problema con su pedido, póngase en contacto con el servicio de atención al cliente.'; diff --git a/modules/bankwire/translations/fr.php b/modules/bankwire/translations/fr.php deleted file mode 100644 index 5f87e532d..000000000 --- a/modules/bankwire/translations/fr.php +++ /dev/null @@ -1,53 +0,0 @@ -bankwire_85ee0d0492a4e37e6c183520f5d59c40'] = 'Virement bancaire'; -$_MODULE['<{bankwire}prestashop>bankwire_f652b92eefd4ecfe61ef5fb118157a05'] = 'Accepter les paiements par virement.'; -$_MODULE['<{bankwire}prestashop>bankwire_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Êtes-vous certain de vouloir effacer vos données ?'; -$_MODULE['<{bankwire}prestashop>bankwire_f05d09f37c9a02f0737c1e71142028a9'] = 'Le titulaire du compte et les informations bancaires doivent être configurés.'; -$_MODULE['<{bankwire}prestashop>bankwire_4402acab1c8f90dcf4a31dc96833bd86'] = 'Aucune devise disponible pour ce module'; -$_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = 'Les détails du compte sont requis.'; -$_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Le titulaire du compte est requis.'; -$_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'Mise à jour réussie'; -$_MODULE['<{bankwire}prestashop>bankwire_fcec4d73cccd149a2d18695fd8785f88'] = 'Ce module vous permet d\'accepter les paiements par virement bancaire.'; -$_MODULE['<{bankwire}prestashop>bankwire_b6af2d31afe71aedcceca73cc27fec29'] = 'Si le client choisit ce mode de paiement, la commande passera à l\'état \"Paiement en attente\".'; -$_MODULE['<{bankwire}prestashop>bankwire_0daeb8f6c1874ec9442e821b524d37c1'] = 'Par conséquent, vous devez confirmer manuellement la commande dès que vous recevrez le virement.'; -$_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Coordonnées'; -$_MODULE['<{bankwire}prestashop>bankwire_17e6954ea60d238857324fea1f10b8f3'] = 'Veuillez spécifier les détails du compte en banque pour les clients'; -$_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Titulaire'; -$_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Détails'; -$_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'Comme le code banque, l\'IBAN ou encore le BIC'; -$_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Adresse de la banque'; -$_MODULE['<{bankwire}prestashop>bankwire_b17f3f4dcf653a5776792498a9b44d6a'] = 'Mettre à jour'; -$_MODULE['<{bankwire}prestashop>validation_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Cette méthode de paiement n\'est pas disponible.'; -$_MODULE['<{bankwire}prestashop>payment_execution_c5e8668ba5e211603955f0b5e913d83d'] = 'Paiement par virement bancaire'; -$_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Récapitulatif de commande'; -$_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Votre panier est vide.'; -$_MODULE['<{bankwire}prestashop>payment_execution_e40a43534d7f4ece69347847d75401e0'] = 'virement bancaire'; -$_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'Vous avez choisi de régler par virement bancaire.'; -$_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Voici un bref récapitulatif de votre commande :'; -$_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'Le montant total de votre commande s\'élève à'; -$_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = 'TTC'; -$_MODULE['<{bankwire}prestashop>payment_execution_e2c147f82d998eeeb147ae172a31a88e'] = 'Nous acceptons plusieurs devises pour votre virement.'; -$_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Merci de choisir parmi les suivantes :'; -$_MODULE['<{bankwire}prestashop>payment_execution_2c1ce705702e11fd5e2188c2353c0c86'] = 'Nous acceptons la devise suivante pour votre paiement :'; -$_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'Nos coordonnées bancaires seront affichées sur la page suivante.'; -$_MODULE['<{bankwire}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Veuillez confirmer votre commande en cliquant sur \"Je confirme ma commande\"'; -$_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Je confirme ma commande'; -$_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Autres moyens de paiement'; -$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Payer par virement bancaire'; -$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Payer par virement bancaire (traitement plus long)'; -$_MODULE['<{bankwire}prestashop>payment_return_88526efe38fd18179a127024aba8c1d7'] = 'Votre commande sur %s a bien été enregistrée.'; -$_MODULE['<{bankwire}prestashop>payment_return_1552c5916ccfe019f35d91fd8955755e'] = 'Veuillez nous envoyer un virement bancaire avec :'; -$_MODULE['<{bankwire}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'un montant de'; -$_MODULE['<{bankwire}prestashop>payment_return_c51326a2ac458845d579a82a92f111f0'] = 'à l\'ordre de'; -$_MODULE['<{bankwire}prestashop>payment_return_de6d813f05e3916a86b89bd8b1a8a489'] = 'suivant ces détails'; -$_MODULE['<{bankwire}prestashop>payment_return_619b26a60df1af3649d2e8920a7949cd'] = 'à cette banque'; -$_MODULE['<{bankwire}prestashop>payment_return_63fb3f7c94ee5d8027bf599885de279d'] = 'N\'oubliez pas d\'indiquer votre numéro de commande n°%d dans le sujet de votre virement.'; -$_MODULE['<{bankwire}prestashop>payment_return_1faa25b80a8d31e5ef25a78d3336606d'] = 'N\'oubliez pas d\'indiquer votre référence de commande %s dans le sujet de votre virement.'; -$_MODULE['<{bankwire}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Un e-mail contenant ces informations vous a été envoyé.'; -$_MODULE['<{bankwire}prestashop>payment_return_c4457a9f2f20e39386008bbb2cd3a78f'] = 'Votre commande sera expédiée dès réception de votre virement.'; -$_MODULE['<{bankwire}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Pour toute question ou information complémentaire, veuillez contacter notre'; -$_MODULE['<{bankwire}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'support client'; -$_MODULE['<{bankwire}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Nous avons rencontré un problème avec votre commande. Merci de prendre contact avec notre support client'; diff --git a/modules/bankwire/translations/index.php b/modules/bankwire/translations/index.php index 3d9fb1394..3f6561f72 100644 --- a/modules/bankwire/translations/index.php +++ b/modules/bankwire/translations/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/translations/it.php b/modules/bankwire/translations/it.php deleted file mode 100644 index d32f1c23a..000000000 --- a/modules/bankwire/translations/it.php +++ /dev/null @@ -1,53 +0,0 @@ -bankwire_85ee0d0492a4e37e6c183520f5d59c40'] = 'Bonifico Bancario'; -$_MODULE['<{bankwire}prestashop>bankwire_f652b92eefd4ecfe61ef5fb118157a05'] = 'Accetto pagamenti tramite bonifico bancario'; -$_MODULE['<{bankwire}prestashop>bankwire_69a1a3ad8dd5da6db3c4da838a0cf9c7'] = 'Sei sicuro di voler cancellare i tuoi dati?'; -$_MODULE['<{bankwire}prestashop>bankwire_f05d09f37c9a02f0737c1e71142028a9'] = 'Il proprietario dell\'account e i dati devono essere configurati per usare questo modulo correttamente'; -$_MODULE['<{bankwire}prestashop>bankwire_4402acab1c8f90dcf4a31dc96833bd86'] = 'Nessuna valuta impostata per questo modulo'; -$_MODULE['<{bankwire}prestashop>bankwire_bfa43217dfe8261ee7cb040339085677'] = 'i dati dell\'account sono obbligatori.'; -$_MODULE['<{bankwire}prestashop>bankwire_ccab155f173ac76f79eb192703f86b18'] = 'Il proprietario dell\'account è obbligatorio.'; -$_MODULE['<{bankwire}prestashop>bankwire_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; -$_MODULE['<{bankwire}prestashop>bankwire_fcec4d73cccd149a2d18695fd8785f88'] = 'Questo modulo ti permette di accettare pagamenti tramite bonifico bancario.'; -$_MODULE['<{bankwire}prestashop>bankwire_b6af2d31afe71aedcceca73cc27fec29'] = 'Se il cliente sceglie questa modalità di pagamento, l\'ordine cambierà il proprio status in \'attesa di pagamento\'.'; -$_MODULE['<{bankwire}prestashop>bankwire_0daeb8f6c1874ec9442e821b524d37c1'] = 'Pertanto, dovrai confermare l\'ordine non appena ricevi il bonifico'; -$_MODULE['<{bankwire}prestashop>bankwire_5dd532f0a63d89c5af0243b74732f63c'] = 'Dati di contatto'; -$_MODULE['<{bankwire}prestashop>bankwire_17e6954ea60d238857324fea1f10b8f3'] = 'Specifica i dati del bonifico bancario per i clienti'; -$_MODULE['<{bankwire}prestashop>bankwire_857216dd1b374de9bf54068fcd78a8f3'] = 'Intestatario del conto'; -$_MODULE['<{bankwire}prestashop>bankwire_3ec365dd533ddb7ef3d1c111186ce872'] = 'Dati'; -$_MODULE['<{bankwire}prestashop>bankwire_6b154cafbab54ba3a1e76a78c290c02a'] = 'Come filiale della banca, codice IBAN, BIC, ecc'; -$_MODULE['<{bankwire}prestashop>bankwire_f9a1a1bb716cbae0503d351ea2af4b34'] = 'Indirizzo della banca'; -$_MODULE['<{bankwire}prestashop>bankwire_b17f3f4dcf653a5776792498a9b44d6a'] = 'Aggiornare le impostazioni'; -$_MODULE['<{bankwire}prestashop>validation_e2b7dec8fa4b498156dfee6e4c84b156'] = 'Questo metodo di pagamento non è disponibile.'; -$_MODULE['<{bankwire}prestashop>payment_execution_c5e8668ba5e211603955f0b5e913d83d'] = 'Pagamento bonifico bancario'; -$_MODULE['<{bankwire}prestashop>payment_execution_f1d3b424cd68795ecaa552883759aceb'] = 'Sintesi dell\'ordine'; -$_MODULE['<{bankwire}prestashop>payment_execution_879f6b8877752685a966564d072f498f'] = 'Il carrello è vuoto.'; -$_MODULE['<{bankwire}prestashop>payment_execution_e40a43534d7f4ece69347847d75401e0'] = 'bonifico bancario'; -$_MODULE['<{bankwire}prestashop>payment_execution_afda466128ee0594745d9f8152699b74'] = 'Hai scelto di pagare con bonifico bancario.'; -$_MODULE['<{bankwire}prestashop>payment_execution_c884ed19483d45970c5bf23a681e2dd2'] = 'Ecco un breve riepilogo del tuo ordine:'; -$_MODULE['<{bankwire}prestashop>payment_execution_e2867a925cba382f1436d1834bb52a1c'] = 'L\'importo totale del tuo ordine è'; -$_MODULE['<{bankwire}prestashop>payment_execution_1f87346a16cf80c372065de3c54c86d9'] = '(tasse incl.)'; -$_MODULE['<{bankwire}prestashop>payment_execution_e2c147f82d998eeeb147ae172a31a88e'] = 'Si accettano le valute diverse da inviare tramite bonifico bancario.'; -$_MODULE['<{bankwire}prestashop>payment_execution_a7a08622ee5c8019b57354b99b7693b2'] = 'Scegli una delle seguenti:'; -$_MODULE['<{bankwire}prestashop>payment_execution_2c1ce705702e11fd5e2188c2353c0c86'] = 'Accettiamo le seguente valute da inviare tramite bonifico bancario:'; -$_MODULE['<{bankwire}prestashop>payment_execution_3dd021316505c0204989f984246c6ff1'] = 'Le informazioni sul conto corrente saranno visualizzate nella pagina successiva.'; -$_MODULE['<{bankwire}prestashop>payment_execution_0881a11f7af33bc1b43e437391129d66'] = 'Conferma l\'ordine cliccando su \'confermo il mio ordine\''; -$_MODULE['<{bankwire}prestashop>payment_execution_46b9e3665f187c739c55983f757ccda0'] = 'Confermo il mio ordine'; -$_MODULE['<{bankwire}prestashop>payment_execution_569fd05bdafa1712c4f6be5b153b8418'] = 'Altri metodi di pagamento'; -$_MODULE['<{bankwire}prestashop>payment_5e1695822fc5af98f6b749ea3cbc9b4c'] = 'Paga con bonifico bancario'; -$_MODULE['<{bankwire}prestashop>payment_eb1d50032721fa4c9d3518c417f91b9d'] = 'Paga con bonifico bancario (l\'elaborazione dell\'ordine sarà più lunga)'; -$_MODULE['<{bankwire}prestashop>payment_return_88526efe38fd18179a127024aba8c1d7'] = 'Il tuo ordine su %s è completo.'; -$_MODULE['<{bankwire}prestashop>payment_return_1552c5916ccfe019f35d91fd8955755e'] = 'Inviaci un bonifico bancario con:'; -$_MODULE['<{bankwire}prestashop>payment_return_a35abd2d31d9e1da82599bc67e166506'] = 'un importo di'; -$_MODULE['<{bankwire}prestashop>payment_return_c51326a2ac458845d579a82a92f111f0'] = 'al proprietario del conto'; -$_MODULE['<{bankwire}prestashop>payment_return_de6d813f05e3916a86b89bd8b1a8a489'] = 'con questi dati'; -$_MODULE['<{bankwire}prestashop>payment_return_619b26a60df1af3649d2e8920a7949cd'] = 'a questa banca'; -$_MODULE['<{bankwire}prestashop>payment_return_63fb3f7c94ee5d8027bf599885de279d'] = 'Non dimenticarti di inserire il tuo numero d\'ordine #%d nel campo oggetto del tuo bonifico.'; -$_MODULE['<{bankwire}prestashop>payment_return_1faa25b80a8d31e5ef25a78d3336606d'] = 'Non dimenticarti di inserire la tua referenza d\'ordine %s nel campo oggetto del tuo bonifico.'; -$_MODULE['<{bankwire}prestashop>payment_return_13f4ac6dc75b5829499cb9cf8b733071'] = 'Ti è stata inviata una e-mail con queste informazioni.'; -$_MODULE['<{bankwire}prestashop>payment_return_c4457a9f2f20e39386008bbb2cd3a78f'] = 'Il tuo ordine verrà inviato non appena avremo ricevuto la tua transazione.'; -$_MODULE['<{bankwire}prestashop>payment_return_0db71da7150c27142eef9d22b843b4a9'] = 'Per eventuali domande o per ulteriori informazioni, contatta la nostra'; -$_MODULE['<{bankwire}prestashop>payment_return_64430ad2835be8ad60c59e7d44e4b0b1'] = 'assistenza clienti'; -$_MODULE['<{bankwire}prestashop>payment_return_8de637e24570c1edb0357826a2ad5aea'] = 'Abbiamo notato un problema con il tuo ordine. Se pensi che sia un errore, puoi contattare il nostro'; diff --git a/modules/bankwire/validation.php b/modules/bankwire/validation.php index a090b94a3..d4f4e6562 100644 --- a/modules/bankwire/validation.php +++ b/modules/bankwire/validation.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/views/index.php b/modules/bankwire/views/index.php index f642dd55e..fd6bae0d3 100644 --- a/modules/bankwire/views/index.php +++ b/modules/bankwire/views/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/views/templates/front/index.php b/modules/bankwire/views/templates/front/index.php index 3ee2b6d56..c7a193905 100644 --- a/modules/bankwire/views/templates/front/index.php +++ b/modules/bankwire/views/templates/front/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/views/templates/front/payment_execution.tpl b/modules/bankwire/views/templates/front/payment_execution.tpl index 512ead4a5..2d903529e 100644 --- a/modules/bankwire/views/templates/front/payment_execution.tpl +++ b/modules/bankwire/views/templates/front/payment_execution.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,12 +18,12 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} -{capture name=path}{l s='Bank wire payment' mod='bankwire'}{/capture} +{capture name=path}{l s='Bank-wire payment.' mod='bankwire'}{/capture} {include file="$tpl_dir./breadcrumb.tpl"}

          {l s='Order summary' mod='bankwire'}

          @@ -35,10 +35,10 @@

          {l s='Your shopping cart is empty.' mod='bankwire'}

          {else} -

          {l s='Bank wire payment' mod='bankwire'}

          -
          +

          {l s='Bank-wire payment.' mod='bankwire'}

          +

          - {l s='bank wire' mod='bankwire'} + {l s='Bank wire' mod='bankwire'} {l s='You have chosen to pay by bank wire.' mod='bankwire'}

          {l s='Here is a short summary of your order:' mod='bankwire'} @@ -53,7 +53,7 @@

          - {if $currencies|@count > 1} - {l s='We accept several currencies to be sent by bank wire.' mod='bankwire'} + {l s='We allow several currencies to be sent via bank wire.' mod='bankwire'}

          {l s='Choose one of the following:' mod='bankwire'} {else} - {l s='We accept the following currency to be sent by bank wire:' mod='bankwire'} {$currencies.0.name} + {l s='We allow the following currency to be sent via bank wire:' mod='bankwire'} {$currencies.0.name} {/if}

          {l s='Bank wire account information will be displayed on the next page.' mod='bankwire'}

          - {l s='Please confirm your order by clicking \'I confirm my order\'' mod='bankwire'}. + {l s='Please confirm your order by clicking "Place my order."' mod='bankwire'}.

          - - {l s='Other payment methods' mod='bankwire'} + + {l s='Other payment methods' mod='bankwire'}

          {/if} diff --git a/modules/bankwire/views/templates/hook/index.php b/modules/bankwire/views/templates/hook/index.php index 3ee2b6d56..c7a193905 100644 --- a/modules/bankwire/views/templates/hook/index.php +++ b/modules/bankwire/views/templates/hook/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/bankwire/views/templates/hook/payment.tpl b/modules/bankwire/views/templates/hook/payment.tpl index 4a612a70d..c2fa55e40 100644 --- a/modules/bankwire/views/templates/hook/payment.tpl +++ b/modules/bankwire/views/templates/hook/payment.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,14 +18,14 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *}

          - - {l s='Pay by bank wire' mod='bankwire'} + + {l s='Pay by bank wire' mod='bankwire'} {l s='Pay by bank wire (order process will be longer)' mod='bankwire'}

          \ No newline at end of file diff --git a/modules/bankwire/views/templates/hook/payment_return.tpl b/modules/bankwire/views/templates/hook/payment_return.tpl index 1d5f376d7..063a13bc2 100644 --- a/modules/bankwire/views/templates/hook/payment_return.tpl +++ b/modules/bankwire/views/templates/hook/payment_return.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} @@ -26,22 +26,22 @@ {if $status == 'ok'}

          {l s='Your order on %s is complete.' sprintf=$shop_name mod='bankwire'}

          - {l s='Please send us a bank wire with:' mod='bankwire'} -

          - {l s='an amount of' mod='bankwire'} {$total_to_pay} -

          - {l s='to the account owner of' mod='bankwire'} {if $bankwireOwner}{$bankwireOwner}{else}___________{/if} -

          - {l s='with these details' mod='bankwire'} {if $bankwireDetails}{$bankwireDetails}{else}___________{/if} -

          - {l s='to this bank' mod='bankwire'} {if $bankwireAddress}{$bankwireAddress}{else}___________{/if} + {l s='Please send us a bank wire with' mod='bankwire'} +

          - {l s='Amount' mod='bankwire'} {$total_to_pay} +

          - {l s='Name of account owner' mod='bankwire'} {if $bankwireOwner}{$bankwireOwner}{else}___________{/if} +

          - {l s='Include these details' mod='bankwire'} {if $bankwireDetails}{$bankwireDetails}{else}___________{/if} +

          - {l s='Bank name' mod='bankwire'} {if $bankwireAddress}{$bankwireAddress}{else}___________{/if} {if !isset($reference)}

          - {l s='Do not forget to insert your order number #%d in the subject of your bank wire' sprintf=$id_order mod='bankwire'} {else}

          - {l s='Do not forget to insert your order reference %s in the subject of your bank wire.' sprintf=$reference mod='bankwire'} - {/if}

          {l s='An e-mail has been sent to you with this information.' mod='bankwire'} -

          {l s='Your order will be sent as soon as we receive your settlement.' mod='bankwire'} -

          {l s='For any questions or for further information, please contact our' mod='bankwire'} {l s='customer support' mod='bankwire'}. + {/if}

          {l s='An email has been sent with this information.' mod='bankwire'} +

          {l s='Your order will be sent as soon as we receive payment.' mod='bankwire'} +

          {l s='If you have questions, comments or concerns, please contact our' mod='bankwire'} {l s='expert customer support team. ' mod='bankwire'}.

          {else}

          - {l s='We noticed a problem with your order. If you think this is an error, you can contact our' mod='bankwire'} - {l s='customer support' mod='bankwire'}. + {l s='We noticed a problem with your order. If you think this is an error, feel free to contact our' mod='bankwire'} + {l s='expert customer support team. ' mod='bankwire'}.

          {/if} diff --git a/modules/bankwire/views/templates/index.php b/modules/bankwire/views/templates/index.php index b37b3d3c4..3f4b16e7e 100644 --- a/modules/bankwire/views/templates/index.php +++ b/modules/bankwire/views/templates/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockadvertising/blockadvertising.php b/modules/blockadvertising/blockadvertising.php index 16c3ff1f4..70b616cfa 100644 --- a/modules/blockadvertising/blockadvertising.php +++ b/modules/blockadvertising/blockadvertising.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -52,7 +52,7 @@ class BlockAdvertising extends Module parent::__construct(); $this->displayName = $this->l('Block advertising'); - $this->description = $this->l('Adds a block to display an advertisement.'); + $this->description = $this->l('Adds an advertisement block to selected sections of your e-commerce webiste.'); $this->initialize(); } @@ -139,7 +139,7 @@ class BlockAdvertising extends Module // Copy the image in the module directory with its new name if (!move_uploaded_file($_FILES['adv_img']['tmp_name'], _PS_MODULE_DIR_.$this->name.'/'.$this->adv_imgname.'.'.Configuration::get('BLOCKADVERT_IMG_EXT'))) - $errors .= $this->l('Error move uploaded file'); + $errors .= $this->l('File upload error.'); } } @@ -157,6 +157,7 @@ class BlockAdvertising extends Module // Reset the module properties $this->initialize(); + $this->_clearCache('blockadvertising.tpl'); } if ($errors) echo $this->displayError($errors); @@ -187,12 +188,12 @@ class BlockAdvertising extends Module $output .= ''; } else - $output .= '
          '.$this->l('no image').'
          '; + $output .= '
          '.$this->l('No image').'
          '; $output .= '

          -

          '.$this->l('Image will be displayed as 155x163.').'

          +

          '.$this->l('Image will be displayed as 155x163').'


          @@ -216,13 +217,14 @@ class BlockAdvertising extends Module public function hookRightColumn($params) { - $this->smarty->assign(array( - 'image' => $this->context->link->protocol_content.$this->adv_img, - 'adv_link' => $this->adv_link, - 'adv_title' => $this->adv_title, - )); + if (!$this->isCached('blockadvertising.tpl', $this->getCacheId())) + $this->smarty->assign(array( + 'image' => $this->context->link->protocol_content.$this->adv_img, + 'adv_link' => $this->adv_link, + 'adv_title' => $this->adv_title, + )); - return $this->display(__FILE__, 'blockadvertising.tpl'); + return $this->display(__FILE__, 'blockadvertising.tpl', $this->getCacheId()); } public function hookLeftColumn($params) diff --git a/modules/blockadvertising/blockadvertising.tpl b/modules/blockadvertising/blockadvertising.tpl index 45f945034..007b75abb 100644 --- a/modules/blockadvertising/blockadvertising.tpl +++ b/modules/blockadvertising/blockadvertising.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *} diff --git a/modules/blockadvertising/config.xml b/modules/blockadvertising/config.xml index 9830b4ea6..62b227aae 100755 --- a/modules/blockadvertising/config.xml +++ b/modules/blockadvertising/config.xml @@ -1,9 +1,9 @@ blockadvertising - + - + 1 diff --git a/modules/blockadvertising/index.php b/modules/blockadvertising/index.php index 3d9fb1394..3f6561f72 100644 --- a/modules/blockadvertising/index.php +++ b/modules/blockadvertising/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockadvertising/translations/de.php b/modules/blockadvertising/translations/de.php deleted file mode 100644 index 061caed5f..000000000 --- a/modules/blockadvertising/translations/de.php +++ /dev/null @@ -1,16 +0,0 @@ -blockadvertising_fd4c71c948857cce596a69fbaea7426b'] = 'Werbeblock'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_a7339a98fd0ebea5ed982f92eed11c70'] = 'Fügt einen block für Werbeanzeigen hinzu'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_226ed577d0eff50725be6447bcd5a2f0'] = 'Fehler bewegt hochgeladene Datei'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_6e7be6d836003f069c00cd217660913b'] = 'Werbeblock-Konfiguration'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_a21056e22c4d62b400b5dd96dafe22a3'] = 'Sie können das Standardbild nicht entfernen (sondern Sie können es ändern)'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_83b5a65e518c21ed0a5f2b383dd9b617'] = 'Bild löschen'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_706bebc78ad992a07e4c1ce0f39def81'] = 'kein Bild'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_8c38cf08a0d0a01bd44c682479432350'] = 'Bild ändern'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_936823d20c5582b055bccdc6fd03b9d1'] = 'Bild wird mit 155x163 gezeigt'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_9ce38727cff004a058021a6c7351a74a'] = 'Bild-Link'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_b78a3223503896721cca1303f776159b'] = 'Titel'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_ad3d06d03d94223fa652babc913de686'] = 'Bestätigen'; diff --git a/modules/blockadvertising/translations/en.php b/modules/blockadvertising/translations/en.php deleted file mode 100644 index 9839c82f9..000000000 --- a/modules/blockadvertising/translations/en.php +++ /dev/null @@ -1,4 +0,0 @@ -blockadvertising_fd4c71c948857cce596a69fbaea7426b'] = 'Bloque de publicidad'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_a7339a98fd0ebea5ed982f92eed11c70'] = 'Añadir un bloque para mostrar la publicidad'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_226ed577d0eff50725be6447bcd5a2f0'] = 'error al desplazar el fichero uploado'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_6e7be6d836003f069c00cd217660913b'] = 'Configuración del bloque de publicidad'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_a21056e22c4d62b400b5dd96dafe22a3'] = 'No puede suprimir la imagen por defecto (pero puede cambiarla abajo) '; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_83b5a65e518c21ed0a5f2b383dd9b617'] = 'Eliminar la imagen'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_706bebc78ad992a07e4c1ce0f39def81'] = 'Ninguna imagen'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_8c38cf08a0d0a01bd44c682479432350'] = 'Cambiar de imagen:'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_936823d20c5582b055bccdc6fd03b9d1'] = 'La imagen se mostrará como 155x163.'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_9ce38727cff004a058021a6c7351a74a'] = 'Enlace de la imagen'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_b78a3223503896721cca1303f776159b'] = 'Título'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_ad3d06d03d94223fa652babc913de686'] = 'Validar'; diff --git a/modules/blockadvertising/translations/fr.php b/modules/blockadvertising/translations/fr.php deleted file mode 100644 index 3d6be4460..000000000 --- a/modules/blockadvertising/translations/fr.php +++ /dev/null @@ -1,16 +0,0 @@ -blockadvertising_fd4c71c948857cce596a69fbaea7426b'] = 'Bloc publicité'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_a7339a98fd0ebea5ed982f92eed11c70'] = 'Ajoute un bloc affichant une publicité'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_226ed577d0eff50725be6447bcd5a2f0'] = 'Erreur de déplacement du fichier mis en ligne'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_6e7be6d836003f069c00cd217660913b'] = 'Configuration du bloc de publicité'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_a21056e22c4d62b400b5dd96dafe22a3'] = 'Vous ne pouvez pas supprimer l\'image par défaut (Mais vous pouvez la modifier ci-dessous)'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_83b5a65e518c21ed0a5f2b383dd9b617'] = 'Supprimer l\'image'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_706bebc78ad992a07e4c1ce0f39def81'] = 'pas d\'image'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_8c38cf08a0d0a01bd44c682479432350'] = 'Changer l\'image'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_936823d20c5582b055bccdc6fd03b9d1'] = 'L\'image sera affichée en 155x163.'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_9ce38727cff004a058021a6c7351a74a'] = 'Lien de l\'image'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_b78a3223503896721cca1303f776159b'] = 'Titre'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_ad3d06d03d94223fa652babc913de686'] = 'Valider'; diff --git a/modules/blockadvertising/translations/index.php b/modules/blockadvertising/translations/index.php index 3d9fb1394..3f6561f72 100644 --- a/modules/blockadvertising/translations/index.php +++ b/modules/blockadvertising/translations/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockadvertising/translations/it.php b/modules/blockadvertising/translations/it.php deleted file mode 100644 index 7e36f1d02..000000000 --- a/modules/blockadvertising/translations/it.php +++ /dev/null @@ -1,16 +0,0 @@ -blockadvertising_fd4c71c948857cce596a69fbaea7426b'] = 'Blocco pubblicità'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_a7339a98fd0ebea5ed982f92eed11c70'] = 'Aggiunge un blocco per visualizzare un messaggio pubblicitario'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_226ed577d0eff50725be6447bcd5a2f0'] = 'Errore sposta il file caricato'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_6e7be6d836003f069c00cd217660913b'] = 'Pubblicità blocco di configurazione'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_a21056e22c4d62b400b5dd96dafe22a3'] = 'Non puoi cancellare l\'immagine predefinita (ma puoi cambiarla sotto).'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_83b5a65e518c21ed0a5f2b383dd9b617'] = 'elimina l\'immagine'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_706bebc78ad992a07e4c1ce0f39def81'] = 'nessuna immagine'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_8c38cf08a0d0a01bd44c682479432350'] = 'Cambia immagine'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_936823d20c5582b055bccdc6fd03b9d1'] = 'Immagine verrà visualizzata come 155x163.'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_9ce38727cff004a058021a6c7351a74a'] = 'Immagine Link'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_b78a3223503896721cca1303f776159b'] = 'Titolo'; -$_MODULE['<{blockadvertising}prestashop>blockadvertising_ad3d06d03d94223fa652babc913de686'] = 'Convalidare'; diff --git a/modules/blockbestsellers/blockbestsellers-home.tpl b/modules/blockbestsellers/blockbestsellers-home.tpl index d1b6ada44..08d1c6818 100644 --- a/modules/blockbestsellers/blockbestsellers-home.tpl +++ b/modules/blockbestsellers/blockbestsellers-home.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,14 +18,14 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *}
          -

          {l s='Top sellers' mod='blockbestsellers'}

          +

          {l s='Top sellers' mod='blockbestsellers'}

          {if isset($best_sellers) AND $best_sellers} {else} -

          {l s='No best sellers at this time' mod='blockbestsellers'}

          +

          {l s='No best sellers' mod='blockbestsellers'}

          {/if}
          diff --git a/modules/blockbestsellers/blockbestsellers.php b/modules/blockbestsellers/blockbestsellers.php index ea8eb2bb2..58b79ff51 100644 --- a/modules/blockbestsellers/blockbestsellers.php +++ b/modules/blockbestsellers/blockbestsellers.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -36,14 +36,14 @@ class BlockBestSellers extends Module { $this->name = 'blockbestsellers'; $this->tab = 'front_office_features'; - $this->version = '1.1'; + $this->version = '1.2'; $this->author = 'PrestaShop'; $this->need_instance = 0; parent::__construct(); - $this->displayName = $this->l('Top seller block'); - $this->description = $this->l('Add a block displaying the shop\'s top sellers.'); + $this->displayName = $this->l('Top-seller block'); + $this->description = $this->l('Add a block displaying your store\'s top-selling products.'); } /** @@ -51,14 +51,53 @@ class BlockBestSellers extends Module */ public function install() { - if (!parent::install() || - !$this->registerHook('rightColumn') || - !$this->registerHook('header') || - !$this->registerHook('updateOrderStatus') || - !ProductSale::fillProductSales()) + $this->_clearCache('blockbestsellers.tpl'); + $this->_clearCache('blockbestsellers-home.tpl'); + + if (!parent::install() + || !$this->registerHook('rightColumn') + || !$this->registerHook('header') + || !$this->registerHook('actionOrderStatusPostUpdate') + || !$this->registerHook('addproduct') + || !$this->registerHook('updateproduct') + || !$this->registerHook('deleteproduct') + || !ProductSale::fillProductSales() + ) return false; return true; } + + public function uninstall() + { + $this->_clearCache('blockbestsellers.tpl'); + $this->_clearCache('blockbestsellers-home.tpl'); + + return parent::uninstall(); + } + + public function hookAddProduct($params) + { + $this->_clearCache('blockbestsellers.tpl'); + $this->_clearCache('blockbestsellers-home.tpl'); + } + + public function hookUpdateProduct($params) + { + $this->_clearCache('blockbestsellers.tpl'); + $this->_clearCache('blockbestsellers-home.tpl'); + } + + public function hookDeleteProduct($params) + { + $this->_clearCache('blockbestsellers.tpl'); + $this->_clearCache('blockbestsellers-home.tpl'); + } + + public function hookActionOrderStatusPostUpdate($params) + { + $this->_clearCache('blockbestsellers.tpl'); + $this->_clearCache('blockbestsellers-home.tpl'); + } /** * Called in administration -> module -> configure @@ -68,7 +107,7 @@ class BlockBestSellers extends Module $output = '

          '.$this->displayName.'

          '; if (Tools::isSubmit('submitBestSellers')) { - Configuration::updateValue('PS_BLOCK_BESTSELLERS_DISPLAY', (int)(Tools::getValue('always_display'))); + Configuration::updateValue('PS_BLOCK_BESTSELLERS_DISPLAY', (int)Tools::getValue('always_display')); $output .= '
          '.$this->l('Settings updated').'
          '; } return $output.$this->displayForm(); @@ -80,81 +119,76 @@ class BlockBestSellers extends Module
          '.$this->l('Settings').' - +
          -

          '.$this->l('Show the block even if no product is available.').'

          +

          '.$this->l('Show the block even if no products are available.').'

          '; } - - public function hookRightColumn($params) - { - if (Configuration::get('PS_CATALOG_MODE')) - return; - - $currency = new Currency($params['cookie']->id_currency); - $bestsellers = ProductSale::getBestSalesLight((int)($params['cookie']->id_lang), 0, 5); - - if (!$bestsellers && !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY')) - return; - $best_sellers = array(); - - if ($bestsellers) - foreach ($bestsellers as $bestseller) - { - $bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency); - $best_sellers[] = $bestseller; - } - - $this->smarty->assign(array( - 'best_sellers' => $best_sellers, - 'mediumSize' => Image::getSize('medium_default'), - 'smallSize' => Image::getSize('small_default') - )); - return $this->display(__FILE__, 'blockbestsellers.tpl'); - } - - public function hookLeftColumn($params) - { - return $this->hookRightColumn($params); - } public function hookHeader($params) { if (Configuration::get('PS_CATALOG_MODE')) return; - $this->context->controller->addCSS(($this->_path).'blockbestsellers.css', 'all'); + $this->context->controller->addCSS($this->_path.'blockbestsellers.css', 'all'); } - + public function hookHome($params) { - if (Configuration::get('PS_CATALOG_MODE')) - return; + if (!$this->isCached('blockbestsellers-home.tpl', $this->getCacheId('blockbestsellers-home'))) + { + $best_sellers = $this->getBestSellers($params); + if ($best_sellers === false) + return; - $currency = new Currency($params['cookie']->id_currency); - $bestsellers = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 4); - if (!$bestsellers && !Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY')) - return; - $best_sellers = array(); - - if ($bestsellers) - foreach ($bestsellers as $bestseller) - { - $bestseller['price'] = Tools::displayPrice(Product::getPriceStatic((int)($bestseller['id_product'])), $currency); - $best_sellers[] = $bestseller; -} - - $this->smarty->assign(array( - 'best_sellers' => $best_sellers, - 'homeSize' => Image::getSize('home_default'))); - return $this->display(__FILE__, 'blockbestsellers-home.tpl'); + $this->smarty->assign(array( + 'best_sellers' => $best_sellers, + 'homeSize' => Image::getSize(ImageType::getFormatedName('home')))); + } + return $this->display(__FILE__, 'blockbestsellers-home.tpl', $this->getCacheId('blockbestsellers-home')); } -} + public function hookRightColumn($params) + { + if (!$this->isCached('blockbestsellers.tpl', $this->getCacheId('blockbestsellers'))) + { + $best_sellers = $this->getBestSellers($params); + if ($best_sellers === false) + return; + $this->smarty->assign(array( + 'best_sellers' => $best_sellers, + 'mediumSize' => Image::getSize(ImageType::getFormatedName('medium')), + 'smallSize' => Image::getSize(ImageType::getFormatedName('small')) + )); + } + return $this->display(__FILE__, 'blockbestsellers.tpl', $this->getCacheId('blockbestsellers')); + } + + public function hookLeftColumn($params) + { + return $this->hookRightColumn($params); + } + + protected function getBestSellers($params) + { + if (Configuration::get('PS_CATALOG_MODE')) + return false; + + if (!($result = ProductSale::getBestSalesLight((int)$params['cookie']->id_lang, 0, 5))) + return (Configuration::get('PS_BLOCK_BESTSELLERS_DISPLAY') ? array() : false); + + $bestsellers = array(); + $currency = new Currency($params['cookie']->id_currency); + $usetax = (Product::getTaxCalculationMethod((int)$this->context->customer->id) != PS_TAX_EXC); + foreach ($result as &$row) + $row['price'] = Tools::displayPrice(Product::getPriceStatic((int)$row['id_product'], $usetax), $currency); + return $result; + } +} \ No newline at end of file diff --git a/modules/blockbestsellers/blockbestsellers.tpl b/modules/blockbestsellers/blockbestsellers.tpl index 59a4df44a..21f1b2176 100644 --- a/modules/blockbestsellers/blockbestsellers.tpl +++ b/modules/blockbestsellers/blockbestsellers.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,32 +18,33 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *}
          -

          {l s='Top sellers' mod='blockbestsellers'}

          +

          {l s='Top sellers' mod='blockbestsellers'}

          {if $best_sellers|@count > 0} -

          » {l s='All best sellers' mod='blockbestsellers'}

          +

          » {l s='All best sellers' mod='blockbestsellers'}

          {else}

          {l s='No best sellers at this time' mod='blockbestsellers'}

          {/if} diff --git a/modules/blockbestsellers/config.xml b/modules/blockbestsellers/config.xml index 9bf0a39be..b8a2515a0 100755 --- a/modules/blockbestsellers/config.xml +++ b/modules/blockbestsellers/config.xml @@ -1,9 +1,9 @@ blockbestsellers - - - + + + 1 diff --git a/modules/blockbestsellers/img/index.php b/modules/blockbestsellers/img/index.php index 3d9fb1394..3f6561f72 100644 --- a/modules/blockbestsellers/img/index.php +++ b/modules/blockbestsellers/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockbestsellers/index.php b/modules/blockbestsellers/index.php index dac3eca51..a230e5ac6 100644 --- a/modules/blockbestsellers/index.php +++ b/modules/blockbestsellers/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockbestsellers/translations/de.php b/modules/blockbestsellers/translations/de.php deleted file mode 100644 index 9469e6623..000000000 --- a/modules/blockbestsellers/translations/de.php +++ /dev/null @@ -1,21 +0,0 @@ -blockbestsellers-home_3cb29f0ccc5fd220a97df89dafe46290'] = 'Verkaufshits'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Mehr'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_4351cfebe4b61d8aa5efa1d020710005'] = 'Anzeigen'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_eae99cd6a931f3553123420b16383812'] = 'Alle Verkaufshits'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_f7be84d6809317a6eb0ff3823a936800'] = 'Momentan keine Verkaufshits'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_6232eaff79c9ccb6c1a66e5a75a212d5'] = 'Block Verkaufshits'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_95d17a0a1b5ea2de13a3565ed400ebbb'] = 'Block mit Verkaufshits des Shops hinzufügen'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_530c88f8210e022b39128e3f0409bbcf'] = 'Block immer anzeigen'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_a8a670d89a6d2f3fa59942fc591011ef'] = 'Block anzeigen, auch wenn kein Produkt verfügbar ist.'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_3cb29f0ccc5fd220a97df89dafe46290'] = 'Verkaufshits'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_eae99cd6a931f3553123420b16383812'] = 'Alle Verkaufshits'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f7be84d6809317a6eb0ff3823a936800'] = 'Momentan keine Verkaufshits'; diff --git a/modules/blockbestsellers/translations/en.php b/modules/blockbestsellers/translations/en.php deleted file mode 100644 index 9839c82f9..000000000 --- a/modules/blockbestsellers/translations/en.php +++ /dev/null @@ -1,4 +0,0 @@ -blockbestsellers-home_3cb29f0ccc5fd220a97df89dafe46290'] = 'Mejores ventas'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Más'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_4351cfebe4b61d8aa5efa1d020710005'] = 'Vista'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_eae99cd6a931f3553123420b16383812'] = 'Los productos más vendidos'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_f7be84d6809317a6eb0ff3823a936800'] = 'No hay productos más vendidos en este momento'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_6232eaff79c9ccb6c1a66e5a75a212d5'] = 'Bloque de mejores ventas'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_95d17a0a1b5ea2de13a3565ed400ebbb'] = 'Añadir un bloque para mostrar las mejores ventas de la tienda'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c888438d14855d7d96a2724ee9c306bd'] = 'Actualización realizada con éxito'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_530c88f8210e022b39128e3f0409bbcf'] = 'Mostrar este bloque siempre'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_a8a670d89a6d2f3fa59942fc591011ef'] = 'Mostrar este bloque aunque no haya productos disponibles'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_3cb29f0ccc5fd220a97df89dafe46290'] = 'Mejores ventas'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_eae99cd6a931f3553123420b16383812'] = 'Los productos más vendidos'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f7be84d6809317a6eb0ff3823a936800'] = 'No hay productos más vendidos en este momento'; diff --git a/modules/blockbestsellers/translations/fr.php b/modules/blockbestsellers/translations/fr.php deleted file mode 100644 index 9e75556a2..000000000 --- a/modules/blockbestsellers/translations/fr.php +++ /dev/null @@ -1,21 +0,0 @@ -blockbestsellers-home_3cb29f0ccc5fd220a97df89dafe46290'] = 'Meilleures ventes'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Plus d\'infos'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_4351cfebe4b61d8aa5efa1d020710005'] = 'Voir'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_eae99cd6a931f3553123420b16383812'] = 'Toutes les meilleures ventes'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_f7be84d6809317a6eb0ff3823a936800'] = 'Pas encore de meilleure vente'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_6232eaff79c9ccb6c1a66e5a75a212d5'] = 'Bloc meilleures ventes'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_95d17a0a1b5ea2de13a3565ed400ebbb'] = 'Ajoute un bloc qui affiche les meilleures ventes de la boutique'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_530c88f8210e022b39128e3f0409bbcf'] = 'Toujours afficher ce bloc'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_a8a670d89a6d2f3fa59942fc591011ef'] = 'Afficher ce bloc même si aucun produit disponible'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_3cb29f0ccc5fd220a97df89dafe46290'] = 'Meilleures ventes'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_eae99cd6a931f3553123420b16383812'] = 'Toutes les meilleures ventes'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f7be84d6809317a6eb0ff3823a936800'] = 'Pas encore de meilleure vente'; diff --git a/modules/blockbestsellers/translations/index.php b/modules/blockbestsellers/translations/index.php index 3d9fb1394..3f6561f72 100644 --- a/modules/blockbestsellers/translations/index.php +++ b/modules/blockbestsellers/translations/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockbestsellers/translations/it.php b/modules/blockbestsellers/translations/it.php deleted file mode 100644 index 26c2e3be1..000000000 --- a/modules/blockbestsellers/translations/it.php +++ /dev/null @@ -1,21 +0,0 @@ -blockbestsellers-home_3cb29f0ccc5fd220a97df89dafe46290'] = 'Migliori vendite'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_d3da97e2d9aee5c8fbe03156ad051c99'] = 'Più'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_4351cfebe4b61d8aa5efa1d020710005'] = 'Visualizza'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_eae99cd6a931f3553123420b16383812'] = 'Tutte le migliori vendite'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers-home_f7be84d6809317a6eb0ff3823a936800'] = 'Non ci sono migliori vendite in questo momento'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_6232eaff79c9ccb6c1a66e5a75a212d5'] = 'Blocco migliori vendite'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_95d17a0a1b5ea2de13a3565ed400ebbb'] = 'Aggiungi un blocco che mostra le migliori vendite del negozio'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_530c88f8210e022b39128e3f0409bbcf'] = 'Visualizza sempre blocco'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_a8a670d89a6d2f3fa59942fc591011ef'] = 'Mostra il blocco anche se nessun prodotto è disponibile.'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_3cb29f0ccc5fd220a97df89dafe46290'] = 'Migliori vendite'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_eae99cd6a931f3553123420b16383812'] = 'Tutte le migliori vendite'; -$_MODULE['<{blockbestsellers}prestashop>blockbestsellers_f7be84d6809317a6eb0ff3823a936800'] = 'Non ci sono migliori vendite in questo momento'; diff --git a/modules/blockbestsellers/upgrade/install-1.2.php b/modules/blockbestsellers/upgrade/install-1.2.php new file mode 100644 index 000000000..1c636719c --- /dev/null +++ b/modules/blockbestsellers/upgrade/install-1.2.php @@ -0,0 +1,9 @@ +registerHook('addproduct') && $object->registerHook('updateproduct') && $object->registerHook('deleteproduct') && $object->registerHook('actionOrderStatusPostUpdate')); +} diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index 70ac4bf75..3c2658756 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -1,5 +1,5 @@ /* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,7 +18,7 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -35,13 +35,13 @@ var ajaxCart = { overrideButtonsInThePage : function(){ //for every 'add' buttons... $('.ajax_add_to_cart_button').unbind('click').click(function(){ - var idProduct = $(this).attr('rel').replace('ajax_id_product_', ''); + var idProduct = $(this).attr('rel').replace('nofollow', '').replace('ajax_id_product_', ''); if ($(this).attr('disabled') != 'disabled') ajaxCart.add(idProduct, null, false, this); return false; }); //for product page 'add' button... - $('body#product p#add_to_cart input').unbind('click').click(function(){ + $('#add_to_cart input').unbind('click').click(function(){ ajaxCart.add( $('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null); return false; }); @@ -52,11 +52,8 @@ var ajaxCart = { var customizationId = 0; var productId = 0; var productAttributeId = 0; - if ($($(this).parent().parent()).attr('name') == 'customization') - // Reverse two levels: a >> div >> li - var customizableProductDiv = $($(this).parent().parent()).find("div[id^=deleteCustomizableProduct_]"); - else - var customizableProductDiv = $($(this).parent()).find("div[id^=deleteCustomizableProduct_]"); + var customizableProductDiv = $($(this).parent().parent()).find("div[id^=deleteCustomizableProduct_]"); + if (customizableProductDiv && $(customizableProductDiv).length) { $(customizableProductDiv).each(function(){ @@ -94,26 +91,28 @@ var ajaxCart = { // try to expand the cart expand : function(){ - if ($('#cart_block #cart_block_list').hasClass('collapsed')) + if ($('#cart_block_list').hasClass('collapsed')) { - $('#header #cart_block #cart_block_summary').slideUp(200, function(){ + $('#cart_block_summary').slideUp(200, function(){ $(this).addClass('collapsed').removeClass('expanded'); - $('#header #cart_block #cart_block_list').slideDown({ + $('#cart_block_list').slideDown({ duration: 450, complete: function(){$(this).addClass('expanded').removeClass('collapsed');} }); }); // toogle the button expand/collapse button - $('#cart_block h4 span#block_cart_expand').fadeOut('slow', function(){ - $('#cart_block h4 span#block_cart_collapse').fadeIn('fast'); + $('#block_cart_expand').fadeOut('slow', function(){ + $('#block_cart_collapse').fadeIn('fast'); }); // save the expand statut in the user cookie $.ajax({ - type: 'GET', - url: baseDir + 'modules/blockcart/blockcart-set-collapse.php', + type: 'POST', + headers: { "cache-control": "no-cache" }, + url: baseDir + 'modules/blockcart/blockcart-set-collapse.php' + '?rand=' + new Date().getTime(), async: true, - data: 'ajax_blockcart_display=expand' + '&rand=' + new Date().getTime() + cache: false, + data: 'ajax_blockcart_display=expand' }); @@ -122,8 +121,9 @@ var ajaxCart = { // Fix display when using back and previous browsers buttons refresh : function(){ $.ajax({ - type: 'GET', - url: baseUri, + type: 'POST', + headers: { "cache-control": "no-cache" }, + url: baseUri + '?rand=' + new Date().getTime(), async: true, cache: false, dataType : "json", @@ -138,23 +138,25 @@ var ajaxCart = { // try to collapse the cart collapse : function(){ - if ($('#cart_block #cart_block_list').hasClass('expanded')) + if ($('#cart_block_list').hasClass('expanded')) { - $('#header #cart_block #cart_block_list').slideUp('slow', function(){ + $('#cart_block_list').slideUp('slow', function(){ $(this).addClass('collapsed').removeClass('expanded'); - $('#header #cart_block #cart_block_summary').slideDown(450, function(){ + $('#cart_block_summary').slideDown(450, function(){ $(this).addClass('expanded').removeClass('collapsed'); }); }); - $('#cart_block h4 span#block_cart_collapse').fadeOut('slow', function(){ - $('#cart_block h4 span#block_cart_expand').fadeIn('fast'); + $('#block_cart_collapse').fadeOut('slow', function(){ + $('#block_cart_expand').fadeIn('fast'); }); // save the expand statut in the user cookie $.ajax({ - type: 'GET', - url: baseDir + 'modules/blockcart/blockcart-set-collapse.php', + type: 'POST', + headers: { "cache-control": "no-cache" }, + url: baseDir + 'modules/blockcart/blockcart-set-collapse.php' + '?rand=' + new Date().getTime(), async: true, + cache: false, data: 'ajax_blockcart_display=collapse' + '&rand=' + new Date().getTime() }); } @@ -167,7 +169,7 @@ var ajaxCart = { //reactive the button when adding has finished if (addedFromProductPage) - $('body#product p#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled'); + $('#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled'); else $('.ajax_add_to_cart_button').removeAttr('disabled'); }, @@ -180,21 +182,22 @@ var ajaxCart = { return ; } emptyCustomizations(); - //disabled the button when adding to do not double add if user double click + //disabled the button when adding to not double add if user double click if (addedFromProductPage) { - $('body#product p#add_to_cart input').attr('disabled', true).removeClass('exclusive').addClass('exclusive_disabled'); + $('#add_to_cart input').attr('disabled', true).removeClass('exclusive').addClass('exclusive_disabled'); $('.filled').removeClass('filled'); } else $(callerElement).attr('disabled', true); - if ($('#cart_block #cart_block_list').hasClass('collapsed')) + if ($('#cart_block_list').hasClass('collapsed')) this.expand(); //send the ajax request to the server $.ajax({ type: 'POST', - url: baseUri, + headers: { "cache-control": "no-cache" }, + url: baseUri + '?rand=' + new Date().getTime(), async: true, cache: false, dataType : "json", @@ -216,7 +219,7 @@ var ajaxCart = { $picture.css({'position': 'absolute', 'top': pictureOffsetOriginal.top, 'left': pictureOffsetOriginal.left}); var pictureOffset = $picture.offset(); - if ($('#cart_block').offset().top && $('#cart_block').offset().left) + if ($('#cart_block')[0] && $('#cart_block').offset().top && $('#cart_block').offset().left) var cartBlockOffset = $('#cart_block').offset(); else var cartBlockOffset = $('#shopping_cart').offset(); @@ -229,6 +232,7 @@ var ajaxCart = { .animate({ 'width': $element.attr('width')*0.66, 'height': $element.attr('height')*0.66, 'opacity': 0.2, 'top': cartBlockOffset.top + 30, 'left': cartBlockOffset.left + 15 }, 1000) .fadeOut(100, function() { ajaxCart.updateCartInformation(jsonData, addedFromProductPage); + $(this).remove(); }); } else @@ -239,7 +243,7 @@ var ajaxCart = { alert("Impossible to add the product to the cart.\n\ntextStatus: '" + textStatus + "'\nerrorThrown: '" + errorThrown + "'\nresponseText:\n" + XMLHttpRequest.responseText); //reactive the button when adding has finished if (addedFromProductPage) - $('body#product p#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled'); + $('#add_to_cart input').removeAttr('disabled').addClass('exclusive').removeClass('exclusive_disabled'); else $(callerElement).removeAttr('disabled'); } @@ -251,7 +255,8 @@ var ajaxCart = { //send the ajax request to the server $.ajax({ type: 'POST', - url: baseUri, + headers: { "cache-control": "no-cache" }, + url: baseUri + '?rand=' + new Date().getTime(), async: true, cache: false, dataType : "json", @@ -268,7 +273,7 @@ var ajaxCart = { //hide the products displayed in the page but no more in the json data hideOldProducts : function(jsonData) { //delete an eventually removed product of the displayed cart (only if cart is not empty!) - if ($('#cart_block #cart_block_list dl.products').length > 0) + if ($('#cart_block_list dl.products').length > 0) { var removedProductId = null; var removedProductData = null; @@ -308,13 +313,13 @@ var ajaxCart = { // If the cart is now empty, show the 'no product in the cart' message and close detail if($('#cart_block dl.products dt').length == 0) { - $("#header #cart_block").stop(true, true).slideUp(200); - $('p#cart_block_no_products:hidden').slideDown(450); - $('div#cart_block dl.products').remove(); + $("#cart_block").stop(true, true).slideUp(200); + $('#cart_block_no_products:hidden').slideDown(450); + $('#cart_block dl.products').remove(); } }); }); - $('dd#cart_block_combination_of_' + ids[0] + (ids[1] ? '_'+ids[1] : '') + (ids[2] ? '_'+ids[2] : '')).fadeTo('fast', 0, function(){ + $('#cart_block_combination_of_' + ids[0] + (ids[1] ? '_'+ids[1] : '') + (ids[2] ? '_'+ids[2] : '')).fadeTo('fast', 0, function(){ $(this).slideUp('fast', function(){ $(this).remove(); }); @@ -327,7 +332,7 @@ var ajaxCart = { hideOldProductCustomizations : function (product, domIdProduct) { - var customizationList = $('#cart_block #cart_block_list ul#customization_' + product['id'] + '_' + product['idCombination']); + var customizationList = $('#customization_' + product['id'] + '_' + product['idCombination']); if(customizationList.length > 0) { $(customizationList).find("li").each(function(){ @@ -343,10 +348,11 @@ var ajaxCart = { }); }); } - var removeLinks = $('#cart_block_product_' + domIdProduct).find('a.ajax_cart_block_remove_link'); + + var removeLinks = $('#' + domIdProduct).find('.ajax_cart_block_remove_link'); if (!product.hasCustomizedDatas && !removeLinks.length) - $('#' + domIdProduct + ' span.remove_link').html(' '); - if (parseFloat(product.price_float) <= 0) + $('#' + domIdProduct + ' span.remove_link').html(' '); + if (product.is_gift) $('#' + domIdProduct + ' span.remove_link').html(''); }, @@ -372,7 +378,7 @@ var ajaxCart = { else { $('#vouchers tbody').html(''); - + for (i=0;i 0) @@ -399,7 +405,7 @@ var ajaxCart = { // Update product quantity updateProductQuantity : function (product, quantity) { - $('dt#cart_block_product_' + product.id + '_' + (product.idCombination ? product.idCombination : '0')+ '_' + (product.idAddressDelivery ? product.idAddressDelivery : '0') + ' .quantity').fadeTo('fast', 0, function() { + $('#cart_block_product_' + product.id + '_' + (product.idCombination ? product.idCombination : '0')+ '_' + (product.idAddressDelivery ? product.idAddressDelivery : '0') + ' .quantity').fadeTo('fast', 0, function() { $(this).text(quantity); $(this).fadeTo('fast', 1, function(){ $(this).fadeTo('fast', 0, function(){ @@ -423,30 +429,30 @@ var ajaxCart = { if (this.id != undefined) { //create a container for listing the products and hide the 'no product in the cart' message (only if the cart was empty) - if ($('div#cart_block dl.products').length == 0) + + if ($('#cart_block dl.products').length == 0) { - $('p#cart_block_no_products').before('
          '); - $('p#cart_block_no_products').hide(); + $('#cart_block_no_products').before('
          '); + $('#cart_block_no_products').hide(); } //if product is not in the displayed cart, add a new product's line var domIdProduct = this.id + '_' + (this.idCombination ? this.idCombination : '0') + '_' + (this.idAddressDelivery ? this.idAddressDelivery : '0'); - var domIdProductAttribute = this.id + '_' + (this.idCombination ? this.idCombination : '0'); - if ($('#cart_block dt#cart_block_product_'+ domIdProduct ).length == 0) + if ($('#cart_block_product_'+ domIdProduct).length == 0) { var productId = parseInt(this.id); var productAttributeId = (this.hasAttributes ? parseInt(this.attributes) : 0); var content = ''; if (this.hasAttributes) content += '
          '.$this->l('Please specify the bank wire account details for customers').'.

          '.$this->l('Please specify the bank wire account details for customers.').'.

          '.$this->l('Account owner').'
          '.$this->l('Details').' -

          '.$this->l('Such as bank branch, IBAN number, BIC, etc.').'

          +

          '.$this->l('Such as bank branch, IBAN number, BIC, etc...').'

          - - {foreach from=$discounts item=discount} - {if $discount.value_real > 0} - - - - - - +
          1x{$discount.name|cat:' : '|cat:$discount.description|truncate:18:'...'|escape:'htmlall':'UTF-8'}-{if $priceDisplay == 1}{convertPrice price=$discount.value_tax_exc}{else}{convertPrice price=$discount.value_real}{/if} - {if strlen($discount.code)} - {l s='Delete' mod='blockcart'} - {/if} -
          + {foreach from=$discounts item=discount} + {if $discount.value_real > 0} + + + + + + + + {/if} + {/foreach} - {/if} -

          {$shipping_cost} {l s='Shipping' mod='blockcart'} @@ -158,18 +154,18 @@ var delete_txt = '{l s='Delete' mod='blockcart'}'; {if $use_taxes && $display_tax_label == 1 && $show_tax} {if $priceDisplay == 0}

          - {l s='Prices are tax included' mod='blockcart'} + {l s='Prices include tax.' mod='blockcart'}

          {/if} {if $priceDisplay == 1}

          - {l s='Prices are tax excluded' mod='blockcart'} + {l s='Prices do not include tax.' mod='blockcart'}

          {/if} {/if}

          - {if $order_process == 'order'}{l s='Cart' mod='blockcart'}{/if} - {l s='Check out' mod='blockcart'} + {if $order_process == 'order'}{l s='Cart' mod='blockcart'}{/if} + {l s='Checkout' mod='blockcart'}

        diff --git a/modules/blockcart/img/icon/index.php b/modules/blockcart/img/icon/index.php index 26dc64ad8..3f6561f72 100644 --- a/modules/blockcart/img/icon/index.php +++ b/modules/blockcart/img/icon/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockcart/img/index.php b/modules/blockcart/img/index.php index e163a4459..6f5ff3bab 100644 --- a/modules/blockcart/img/index.php +++ b/modules/blockcart/img/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockcart/index.php b/modules/blockcart/index.php index 26dc64ad8..3f6561f72 100644 --- a/modules/blockcart/index.php +++ b/modules/blockcart/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockcart/translations/de.php b/modules/blockcart/translations/de.php deleted file mode 100644 index 051cc05ec..000000000 --- a/modules/blockcart/translations/de.php +++ /dev/null @@ -1,33 +0,0 @@ -blockcart_c2e1362a9710a3dd86f937c2ea1f336d'] = 'Block Warenkorb'; -$_MODULE['<{blockcart}prestashop>blockcart_e03093a5753b436ee1de63b6e3e1bd02'] = 'Fügt einen Block mit dem Warenkorb des Kunden hinzu'; -$_MODULE['<{blockcart}prestashop>blockcart_eb4ae207521bbe6403f7fe9564d38cda'] = 'Ajax: ungültige Wahl.'; -$_MODULE['<{blockcart}prestashop>blockcart_c888438d14855d7d96a2724ee9c306bd'] = 'Einstellungen aktualisiert'; -$_MODULE['<{blockcart}prestashop>blockcart_f4f70727dc34561dfde1a3c529b6205c'] = 'Einstellungen'; -$_MODULE['<{blockcart}prestashop>blockcart_614a8820aa4ac08ce2ee398a41b10778'] = 'Ajax-Warenkorb'; -$_MODULE['<{blockcart}prestashop>blockcart_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Aktiviert'; -$_MODULE['<{blockcart}prestashop>blockcart_b9f5c797ebbf55adccdd8539a65a0241'] = 'Deaktiviert'; -$_MODULE['<{blockcart}prestashop>blockcart_dba281afb9a38e654ea9dab4cd6cb0ca'] = 'Ajax-Modus für Warenkorb aktivieren (kompatibel mit Standardthema)'; -$_MODULE['<{blockcart}prestashop>blockcart_c9cc8cce247e49bae79f15173ce97354'] = 'Speichern'; -$_MODULE['<{blockcart}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Benutzereinstellung Nr.'; -$_MODULE['<{blockcart}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'dieses Produkt aus meinem Warenkorb entfernen'; -$_MODULE['<{blockcart}prestashop>blockcart_c6995d6cc084c192bc2e742f052a5c74'] = 'Kostenloser Versand'; -$_MODULE['<{blockcart}prestashop>blockcart_e7a6ca4e744870d455a57b644f696457'] = 'Gratis!'; -$_MODULE['<{blockcart}prestashop>blockcart_f2a6c498fb90ee345d997f888fce3b18'] = 'Löschen'; -$_MODULE['<{blockcart}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'Warenkorb'; -$_MODULE['<{blockcart}prestashop>blockcart_86024cad1e83101d97359d7351051156'] = 'Produkte'; -$_MODULE['<{blockcart}prestashop>blockcart_f5bf48aa40cad7891eb709fcf1fde128'] = 'Produkt'; -$_MODULE['<{blockcart}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(Leer)'; -$_MODULE['<{blockcart}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Produkt-Detail'; -$_MODULE['<{blockcart}prestashop>blockcart_3d9e3bae9905a12dae384918ed117a26'] = 'Anpassung #%d:'; -$_MODULE['<{blockcart}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'Keine Produkte'; -$_MODULE['<{blockcart}prestashop>blockcart_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Versand'; -$_MODULE['<{blockcart}prestashop>blockcart_ba794350deb07c0c96fe73bd12239059'] = 'Verpackung'; -$_MODULE['<{blockcart}prestashop>blockcart_4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Steuer'; -$_MODULE['<{blockcart}prestashop>blockcart_96b0141273eabab320119c467cdcaf17'] = 'Insgesamt'; -$_MODULE['<{blockcart}prestashop>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'Preise inkl. MwSt.'; -$_MODULE['<{blockcart}prestashop>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'Preise zzgl. MwSt.'; -$_MODULE['<{blockcart}prestashop>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'KAUFEN'; diff --git a/modules/blockcart/translations/en.php b/modules/blockcart/translations/en.php deleted file mode 100644 index 9839c82f9..000000000 --- a/modules/blockcart/translations/en.php +++ /dev/null @@ -1,4 +0,0 @@ -blockcart_c2e1362a9710a3dd86f937c2ea1f336d'] = 'Carrito'; -$_MODULE['<{blockcart}prestashop>blockcart_e03093a5753b436ee1de63b6e3e1bd02'] = 'Añadir un bloque que contenga el carrito de compra del cliente'; -$_MODULE['<{blockcart}prestashop>blockcart_eb4ae207521bbe6403f7fe9564d38cda'] = 'Ajax: opción incorrecta.'; -$_MODULE['<{blockcart}prestashop>blockcart_c888438d14855d7d96a2724ee9c306bd'] = 'Actualización realizada con éxito'; -$_MODULE['<{blockcart}prestashop>blockcart_f4f70727dc34561dfde1a3c529b6205c'] = 'Configuración'; -$_MODULE['<{blockcart}prestashop>blockcart_614a8820aa4ac08ce2ee398a41b10778'] = 'Carrito Ajax'; -$_MODULE['<{blockcart}prestashop>blockcart_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activado'; -$_MODULE['<{blockcart}prestashop>blockcart_b9f5c797ebbf55adccdd8539a65a0241'] = 'Desactivado'; -$_MODULE['<{blockcart}prestashop>blockcart_dba281afb9a38e654ea9dab4cd6cb0ca'] = 'Modo AJAX para el carrito (compatible con el tema por defecto)'; -$_MODULE['<{blockcart}prestashop>blockcart_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar'; -$_MODULE['<{blockcart}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Personalización n°'; -$_MODULE['<{blockcart}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'eliminar este producto de mi carrito'; -$_MODULE['<{blockcart}prestashop>blockcart_c6995d6cc084c192bc2e742f052a5c74'] = 'Envío gratuito!'; -$_MODULE['<{blockcart}prestashop>blockcart_e7a6ca4e744870d455a57b644f696457'] = '¡Gratis!'; -$_MODULE['<{blockcart}prestashop>blockcart_f2a6c498fb90ee345d997f888fce3b18'] = 'Eliminar'; -$_MODULE['<{blockcart}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'carrito'; -$_MODULE['<{blockcart}prestashop>blockcart_86024cad1e83101d97359d7351051156'] = 'productos'; -$_MODULE['<{blockcart}prestashop>blockcart_f5bf48aa40cad7891eb709fcf1fde128'] = 'producto'; -$_MODULE['<{blockcart}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = 'vacío'; -$_MODULE['<{blockcart}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Detalle producto'; -$_MODULE['<{blockcart}prestashop>blockcart_3d9e3bae9905a12dae384918ed117a26'] = 'Personalización n°%d:'; -$_MODULE['<{blockcart}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'No hay productos'; -$_MODULE['<{blockcart}prestashop>blockcart_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Transporte'; -$_MODULE['<{blockcart}prestashop>blockcart_ba794350deb07c0c96fe73bd12239059'] = 'Embalaje'; -$_MODULE['<{blockcart}prestashop>blockcart_4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Impuestos'; -$_MODULE['<{blockcart}prestashop>blockcart_96b0141273eabab320119c467cdcaf17'] = 'Total'; -$_MODULE['<{blockcart}prestashop>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'Estos precios se entienden IVA incluído'; -$_MODULE['<{blockcart}prestashop>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'Estos precios se entienden sin IVA'; -$_MODULE['<{blockcart}prestashop>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Confirmar'; diff --git a/modules/blockcart/translations/fr.php b/modules/blockcart/translations/fr.php deleted file mode 100644 index 9b4e1ee29..000000000 --- a/modules/blockcart/translations/fr.php +++ /dev/null @@ -1,33 +0,0 @@ -blockcart_c2e1362a9710a3dd86f937c2ea1f336d'] = 'Bloc panier'; -$_MODULE['<{blockcart}prestashop>blockcart_e03093a5753b436ee1de63b6e3e1bd02'] = 'Ajoute un bloc avec le contenu du panier du client'; -$_MODULE['<{blockcart}prestashop>blockcart_eb4ae207521bbe6403f7fe9564d38cda'] = 'Ajax : choix non valable.'; -$_MODULE['<{blockcart}prestashop>blockcart_c888438d14855d7d96a2724ee9c306bd'] = 'Paramètres mis à jour'; -$_MODULE['<{blockcart}prestashop>blockcart_f4f70727dc34561dfde1a3c529b6205c'] = 'Paramètres'; -$_MODULE['<{blockcart}prestashop>blockcart_614a8820aa4ac08ce2ee398a41b10778'] = 'Panier Ajax'; -$_MODULE['<{blockcart}prestashop>blockcart_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Activé'; -$_MODULE['<{blockcart}prestashop>blockcart_b9f5c797ebbf55adccdd8539a65a0241'] = 'Désactivé'; -$_MODULE['<{blockcart}prestashop>blockcart_dba281afb9a38e654ea9dab4cd6cb0ca'] = 'Activer le mode Ajax du panier (compatible avec le thème par défaut)'; -$_MODULE['<{blockcart}prestashop>blockcart_c9cc8cce247e49bae79f15173ce97354'] = 'Enregistrer'; -$_MODULE['<{blockcart}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Personnalisation n°'; -$_MODULE['<{blockcart}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'supprimer cet article du panier'; -$_MODULE['<{blockcart}prestashop>blockcart_c6995d6cc084c192bc2e742f052a5c74'] = 'Livraison gratuite !'; -$_MODULE['<{blockcart}prestashop>blockcart_e7a6ca4e744870d455a57b644f696457'] = 'Gratuit !'; -$_MODULE['<{blockcart}prestashop>blockcart_f2a6c498fb90ee345d997f888fce3b18'] = 'Supprimer'; -$_MODULE['<{blockcart}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'Panier'; -$_MODULE['<{blockcart}prestashop>blockcart_86024cad1e83101d97359d7351051156'] = 'articles'; -$_MODULE['<{blockcart}prestashop>blockcart_f5bf48aa40cad7891eb709fcf1fde128'] = 'article'; -$_MODULE['<{blockcart}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(vide)'; -$_MODULE['<{blockcart}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Détails de l\'article'; -$_MODULE['<{blockcart}prestashop>blockcart_3d9e3bae9905a12dae384918ed117a26'] = 'Personnalisation n°%d :'; -$_MODULE['<{blockcart}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'Aucun produit'; -$_MODULE['<{blockcart}prestashop>blockcart_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Expédition'; -$_MODULE['<{blockcart}prestashop>blockcart_ba794350deb07c0c96fe73bd12239059'] = 'Emballage'; -$_MODULE['<{blockcart}prestashop>blockcart_4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Taxes'; -$_MODULE['<{blockcart}prestashop>blockcart_96b0141273eabab320119c467cdcaf17'] = 'Total'; -$_MODULE['<{blockcart}prestashop>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'Les prix sont TTC'; -$_MODULE['<{blockcart}prestashop>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'Les prix sont HT'; -$_MODULE['<{blockcart}prestashop>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Commander'; diff --git a/modules/blockcart/translations/index.php b/modules/blockcart/translations/index.php index 3d9fb1394..3f6561f72 100644 --- a/modules/blockcart/translations/index.php +++ b/modules/blockcart/translations/index.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ diff --git a/modules/blockcart/translations/it.php b/modules/blockcart/translations/it.php deleted file mode 100644 index a2382b645..000000000 --- a/modules/blockcart/translations/it.php +++ /dev/null @@ -1,33 +0,0 @@ -blockcart_c2e1362a9710a3dd86f937c2ea1f336d'] = 'Blocco carrello'; -$_MODULE['<{blockcart}prestashop>blockcart_e03093a5753b436ee1de63b6e3e1bd02'] = 'Aggiunge un blocco contenente il carrello del cliente'; -$_MODULE['<{blockcart}prestashop>blockcart_eb4ae207521bbe6403f7fe9564d38cda'] = 'Ajax: scelta non valida.'; -$_MODULE['<{blockcart}prestashop>blockcart_c888438d14855d7d96a2724ee9c306bd'] = 'Impostazioni aggiornate'; -$_MODULE['<{blockcart}prestashop>blockcart_f4f70727dc34561dfde1a3c529b6205c'] = 'Impostazioni'; -$_MODULE['<{blockcart}prestashop>blockcart_614a8820aa4ac08ce2ee398a41b10778'] = 'Carrello Ajax'; -$_MODULE['<{blockcart}prestashop>blockcart_00d23a76e43b46dae9ec7aa9dcbebb32'] = 'Attivato'; -$_MODULE['<{blockcart}prestashop>blockcart_b9f5c797ebbf55adccdd8539a65a0241'] = 'Disattivato'; -$_MODULE['<{blockcart}prestashop>blockcart_dba281afb9a38e654ea9dab4cd6cb0ca'] = 'Attivare la modalità di AJAX per il carrello (compatibile con il tema di default)'; -$_MODULE['<{blockcart}prestashop>blockcart_c9cc8cce247e49bae79f15173ce97354'] = 'Salva'; -$_MODULE['<{blockcart}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Personalizzazione n.'; -$_MODULE['<{blockcart}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'rimuovi questo prodotto dal mio carrello'; -$_MODULE['<{blockcart}prestashop>blockcart_c6995d6cc084c192bc2e742f052a5c74'] = 'Spedizione gratuita!'; -$_MODULE['<{blockcart}prestashop>blockcart_e7a6ca4e744870d455a57b644f696457'] = 'Gratis!'; -$_MODULE['<{blockcart}prestashop>blockcart_f2a6c498fb90ee345d997f888fce3b18'] = 'Elimina'; -$_MODULE['<{blockcart}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'Carrello'; -$_MODULE['<{blockcart}prestashop>blockcart_86024cad1e83101d97359d7351051156'] = 'prodotti'; -$_MODULE['<{blockcart}prestashop>blockcart_f5bf48aa40cad7891eb709fcf1fde128'] = 'prodotto'; -$_MODULE['<{blockcart}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(vuoto)'; -$_MODULE['<{blockcart}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Dettaglio prodotto'; -$_MODULE['<{blockcart}prestashop>blockcart_3d9e3bae9905a12dae384918ed117a26'] = 'Personalizzazione #%d:'; -$_MODULE['<{blockcart}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'Nessun prodotto'; -$_MODULE['<{blockcart}prestashop>blockcart_ea9cf7e47ff33b2be14e6dd07cbcefc6'] = 'Spedizione'; -$_MODULE['<{blockcart}prestashop>blockcart_ba794350deb07c0c96fe73bd12239059'] = 'Imballaggio'; -$_MODULE['<{blockcart}prestashop>blockcart_4b78ac8eb158840e9638a3aeb26c4a9d'] = 'Tasse'; -$_MODULE['<{blockcart}prestashop>blockcart_96b0141273eabab320119c467cdcaf17'] = 'Totale'; -$_MODULE['<{blockcart}prestashop>blockcart_0d11c2b75cf03522c8d97938490466b2'] = 'I prezzi sono IVA inclusa'; -$_MODULE['<{blockcart}prestashop>blockcart_41202aa6b8cf7ae885644717dab1e8b4'] = 'I prezzi sono IVA esclusa'; -$_MODULE['<{blockcart}prestashop>blockcart_377e99e7404b414341a9621f7fb3f906'] = 'Check out'; diff --git a/modules/blockcategories/blockcategories.php b/modules/blockcategories/blockcategories.php index d03b40d29..bdaca904e 100644 --- a/modules/blockcategories/blockcategories.php +++ b/modules/blockcategories/blockcategories.php @@ -1,6 +1,6 @@ -* @copyright 2007-2012 PrestaShop SA +* @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 */ @@ -114,7 +114,7 @@ class BlockCategories extends Module -

        '.$this->l('Activate dynamic (animated) mode for sublevels').'

        +

        '.$this->l('Activate dynamic (animated) mode for sublevels.').'

        @@ -128,10 +128,10 @@ class BlockCategories extends Module
        - +
        -

        '.$this->l('Set the number of footer columns').'

        +

        '.$this->l('Define the number of footer columns.').'

        @@ -156,31 +156,23 @@ class BlockCategories extends Module } public function hookLeftColumn($params) - { - $id_customer = (int)$params['cookie']->id_customer; - // Get all groups for this customer and concatenate them as a string: "1,2,3..." - // It is necessary to keep the group query separate from the main select query because it is used for the cache - $groups = $id_customer ? implode(', ', Customer::getGroupsStatic($id_customer)) : Configuration::get('PS_UNIDENTIFIED_GROUP'); - $id_product = (int)Tools::getValue('id_product', 0); - $id_category = (int)Tools::getValue('id_category', 0); - $id_lang = (int)$params['cookie']->id_lang; - $smartyCacheId = 'blockcategories|'.$this->context->shop->id.'_'.$groups.'_'.$id_lang.'_'.$id_product.'_'.$id_category; - $this->context->smarty->cache_lifetime = 31536000; // 1 Year - Tools::enableCache(); - if (!$this->isCached('blockcategories.tpl', $smartyCacheId)) + { + if (!$this->isCached('blockcategories.tpl', $this->getCacheId())) { + // Get all groups for this customer and concatenate them as a string: "1,2,3..." + $groups = implode(', ', Customer::getGroupsStatic((int)$this->context->customer->id)); $maxdepth = Configuration::get('BLOCK_CATEG_MAX_DEPTH'); if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite + SELECT DISTINCT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite FROM `'._DB_PREFIX_.'category` c - INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.$id_lang.Shop::addSqlRestrictionOnLang('cl').') + INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)$this->context->language->id.Shop::addSqlRestrictionOnLang('cl').') INNER JOIN `'._DB_PREFIX_.'category_shop` cs ON (cs.`id_category` = c.`id_category` AND cs.`id_shop` = '.(int)$this->context->shop->id.') WHERE (c.`active` = 1 OR c.`id_category` = '.(int)Configuration::get('PS_HOME_CATEGORY').') AND c.`id_category` != '.(int)Configuration::get('PS_ROOT_CATEGORY').' '.((int)$maxdepth != 0 ? ' AND `level_depth` <= '.(int)$maxdepth : '').' AND c.id_category IN (SELECT id_category FROM `'._DB_PREFIX_.'category_group` WHERE `id_group` IN ('.pSQL($groups).')) ORDER BY `level_depth` ASC, '.(Configuration::get('BLOCK_CATEG_SORT') ? 'cl.`name`' : 'cs.`position`').' '.(Configuration::get('BLOCK_CATEG_SORT_WAY') ? 'DESC' : 'ASC'))) - return Tools::restoreCacheSettings(); + return; $resultParents = array(); $resultIds = array(); @@ -194,6 +186,9 @@ class BlockCategories extends Module $blockCategTree = $this->getTree($resultParents, $resultIds, Configuration::get('BLOCK_CATEG_MAX_DEPTH')); unset($resultParents, $resultIds); + $id_category = (int)Tools::getValue('id_category'); + $id_product = (int)Tools::getValue('id_product'); + $isDhtml = (Configuration::get('BLOCK_CATEG_DHTML') == 1 ? true : false); if (Tools::isSubmit('id_category')) { @@ -220,31 +215,33 @@ class BlockCategories extends Module $this->smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl'); $this->smarty->assign('isDhtml', $isDhtml); } - $display = $this->display(__FILE__, 'blockcategories.tpl', $smartyCacheId); - Tools::restoreCacheSettings(); + $display = $this->display(__FILE__, 'blockcategories.tpl', $this->getCacheId()); return $display; } + protected function getCacheId($name = null) + { + parent::getCacheId($name); + + $groups = implode(', ', Customer::getGroupsStatic((int)$this->context->customer->id)); + $id_product = (int)Tools::getValue('id_product', 0); + $id_category = (int)Tools::getValue('id_category', 0); + $id_lang = (int)$this->context->language->id; + return 'blockcategories|'.(int)Tools::usingSecureMode().'|'.$this->context->shop->id.'|'.$groups.'|'.$id_lang.'|'.$id_product.'|'.$id_category; + } + public function hookFooter($params) { - $id_customer = (int)($params['cookie']->id_customer); // Get all groups for this customer and concatenate them as a string: "1,2,3..." - $groups = $id_customer ? implode(', ', Customer::getGroupsStatic($id_customer)) : _PS_DEFAULT_CUSTOMER_GROUP_; - $id_product = (int)(Tools::getValue('id_product', 0)); - $id_category = (int)(Tools::getValue('id_category', 0)); - $id_lang = (int)($params['cookie']->id_lang); - $smartyCacheId = 'blockcategories|'.$this->context->shop->id.'_'.$groups.'_'.$id_lang.'_'.$id_product.'_'.$id_category; - $this->context->smarty->cache_lifetime = 31536000; // 1 Year - Tools::enableCache(); - if (!$this->isCached('blockcategories_footer.tpl', $smartyCacheId)) + if (!$this->isCached('blockcategories_footer.tpl', $this->getCacheId())) { $maxdepth = Configuration::get('BLOCK_CATEG_MAX_DEPTH'); - + $groups = implode(', ', Customer::getGroupsStatic((int)$this->context->customer->id)); if (!$result = Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS(' - SELECT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite + SELECT DISTINCT c.id_parent, c.id_category, cl.name, cl.description, cl.link_rewrite FROM `'._DB_PREFIX_.'category` c '.Shop::addSqlAssociation('category', 'c').' - LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.$id_lang.Shop::addSqlRestrictionOnLang('cl').') + LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND cl.`id_lang` = '.(int)$this->context->language->id.Shop::addSqlRestrictionOnLang('cl').') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) WHERE (c.`active` = 1 OR c.`id_category` = 1) '.((int)($maxdepth) != 0 ? ' AND `level_depth` <= '.(int)($maxdepth) : '').' @@ -273,6 +270,9 @@ class BlockCategories extends Module $isDhtml = (Configuration::get('BLOCK_CATEG_DHTML') == 1 ? true : false); + $id_category = (int)Tools::getValue('id_category'); + $id_product = (int)Tools::getValue('id_product'); + if (Tools::isSubmit('id_category')) { $this->context->cookie->last_visited_category = $id_category; @@ -296,8 +296,8 @@ class BlockCategories extends Module $this->smarty->assign('branche_tpl_path', _PS_MODULE_DIR_.'blockcategories/category-tree-branch.tpl'); $this->smarty->assign('isDhtml', $isDhtml); } - $display = $this->display(__FILE__, 'blockcategories_footer.tpl', $smartyCacheId); - Tools::restoreCacheSettings(); + $display = $this->display(__FILE__, 'blockcategories_footer.tpl', $this->getCacheId()); + return $display; } @@ -315,6 +315,7 @@ class BlockCategories extends Module private function _clearBlockcategoriesCache() { $this->_clearCache('blockcategories.tpl'); + $this->_clearCache('blockcategories_footer.tpl'); } public function hookCategoryAddition($params) diff --git a/modules/blockcategories/blockcategories.tpl b/modules/blockcategories/blockcategories.tpl index 11f574448..f9f62be46 100644 --- a/modules/blockcategories/blockcategories.tpl +++ b/modules/blockcategories/blockcategories.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,14 +18,14 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *}
        -

        {l s='Categories' mod='blockcategories'}

        +

        {l s='Categories' mod='blockcategories'}

          {foreach from=$blockCategTree.children item=child name=blockCategTree} diff --git a/modules/blockcategories/blockcategories_footer.tpl b/modules/blockcategories/blockcategories_footer.tpl index 439b1e49e..12d947b1c 100644 --- a/modules/blockcategories/blockcategories_footer.tpl +++ b/modules/blockcategories/blockcategories_footer.tpl @@ -1,5 +1,5 @@ {* -* 2007-2012 PrestaShop +* 2007-2013 PrestaShop * * NOTICE OF LICENSE * @@ -18,14 +18,14 @@ * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA -* @copyright 2007-2012 PrestaShop SA +* @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 *}